> ## Documentation Index
> Fetch the complete documentation index at: https://quintsecurity.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# System Architecture

> Three-tier architecture: ES extension (truth), forward proxy (intent), and the cloud platform. Covers session detection, event ingestion, and the API service.

# System Architecture

Quint is a three-tier security platform that combines OS-level ground truth (EndpointSecurity system extension), intent-level interception (forward proxy plus MCP gateway), and a cloud platform for fleet-wide visibility. The key security signal is **divergence** between what an agent claims to do and what actually happens on disk.

## Target-state architecture

The diagram below is Quint's **enterprise-ready target state** — the north-star topology the platform is converging on. Events flow from an MDM-managed endpoint fleet over the SNS/SQS bus into stream processing and tiered hot/warm/cold storage, with per-tenant egress to customer SIEMs and a dedicated fleet-management plane. Note that the behavioral stream **ranks only and never makes an enforcement decision**. The tiers described in the rest of this page are the **current shipping implementation** this target state builds on.

<Frame caption="Quint — enterprise-ready target-state architecture.">
  <img src="https://mintcdn.com/quintsecurity/Dn1t2E0kIEoFQMrU/images/quint-target-state.png?fit=max&auto=format&n=Dn1t2E0kIEoFQMrU&q=85&s=5b08586e31347963baa69f0c318ee708" alt="Quint enterprise-ready target-state architecture: MDM-managed endpoint fleet, SNS/SQS event bus, behavioral/alerts/pipeline stream processing, hot/warm/cold storage tiers, per-tenant egress, and fleet management plane." width="2844" height="3750" data-path="images/quint-target-state.png" />
</Frame>

## Three-Tier Architecture

```mermaid theme={null}
flowchart TD
    subgraph T1["Tier 1: Edge (macOS pkg)"]
        ES["EndpointSecurity Extension (Swift)<br/>9 event types, code-signing detection"]
        NE["Network Extension (Swift)<br/>Transparent LLM API interception"]
        Daemon["Go Daemon<br/>LaunchDaemon service"]
        FwdProxy["HTTPS Forward Proxy<br/>MITM TLS, 7 LLM parsers"]
        MCPGateway["MCP Gateway and Stdio Relay"]
        UniSession["Unified Session Tracker<br/>process scanner, PID reaper"]
        Forwarder["Cloud Forwarder<br/>batch 500, 1s flush, overflow-to-disk"]

        ES -->|Unix socket + auth| Daemon
        NE -->|Unix socket :9091| Daemon
        FwdProxy --> Daemon
        MCPGateway --> Daemon
        Daemon --> UniSession
        Daemon --> Forwarder
    end

    subgraph T2["Tier 2: Cloud Platform (AWS ECS)"]
        Ingest["Ingest Service<br/>/v1/ingest, deploy-token auth"]
        SNS["SNS FIFO + SQS fan-out"]
        Pipeline["Pipeline Service<br/>Postgres writer, monthly partitions"]
        SessionProc["Session Processor<br/>upserts sessions table"]
        AlertProc["Alert Processor<br/>rule evaluation"]
        API["API Service<br/>REST + SSE"]
        PG[("PostgreSQL<br/>RLS, monthly partitions")]
        Redis[("Redis<br/>token cache, SSE pubsub")]

        Forwarder -->|HTTPS batch| Ingest
        Ingest --> SNS
        SNS --> Pipeline
        SNS --> SessionProc
        SNS --> AlertProc
        Pipeline --> PG
        SessionProc --> PG
        AlertProc --> PG
        API --> PG
        API --> Redis
    end

    subgraph T3["Tier 3: Dashboard (Vercel)"]
        Dashboard["Next.js app<br/>session-centric views"]
        API --> Dashboard
    end

    style T1 fill:#1a1a2e,stroke:#FF3C22,stroke-width:2px
    style T2 fill:#1a1a2e,stroke:#58a6ff,stroke-width:2px
    style T3 fill:#1a1a2e,stroke:#a371f7,stroke-width:2px
```

### Tier 1: Edge

Runs on the user's machine as a signed `.pkg` install.

* **QuintAgent.app** hosts two system extensions:
  * [Endpoint Security](/edge/endpoint-security) for kernel-level process and file events
  * [Network Extension](/edge/network-extension) for transparent LLM API interception
* **Go daemon** runs as a LaunchDaemon. It operates the [forward proxy](/edge/forward-proxy) (MITM TLS plus MCP relay/gateway), the [unified session tracker](/edge/daemon), and the cloud forwarder. Events stream to `api.quintai.dev` via HTTPS.
* **Audit log** at `~/.quint/quint.db` with Ed25519 signatures and SHA-256 hash chaining. Every captured request, response, and tool call is attributable to a specific session.

### Tier 2: Cloud Platform

Deployed on AWS ECS Fargate. Five services share one Postgres instance and one Redis cache:

| Service           | Role                                   |
| ----------------- | -------------------------------------- |
| ingest            | Authenticate, validate, fan out to SNS |
| pipeline          | Consume SQS, write `actions` table     |
| session-processor | Upsert `sessions` table                |
| alert-processor   | Evaluate rules, write `alerts`         |
| api               | Dashboard and public API               |

Row-level security is enabled on all tenant tables using `app.current_org_id`. The `actions` table is partitioned by month. See [Cloud Overview](/cloud/overview) for the full model.

### Tier 3: Dashboard

Next.js on Vercel. Reads from the API service over Supabase JWT or API key. Session-centric views with drill-down into each action. See [Dashboard Architecture](/dashboard/architecture).

## Signal: Intent vs. Truth

The proxy sees what the agent **claims** to do. The ES extension sees what the OS **actually** does. Divergence is the high-confidence signal.

Example: an agent that says "read `config.json`" but actually opens `~/.ssh/id_rsa`. Tier 1 captures the tool call. Tier 2 captures the file open. The mismatch triggers an alert.

## End-to-End Flow

See [How It Works](/concepts/how-it-works) for a single tool call traced through all layers.

## Deployment Topology

### Production (AWS)

| Service           | Resources             | Purpose                                |
| ----------------- | --------------------- | -------------------------------------- |
| API Service       | ECS Fargate           | REST API, event ingest                 |
| Ingest            | ECS Fargate           | Token auth, validation, fan-out        |
| Pipeline          | ECS Fargate           | SQS consumer, Postgres writer          |
| Session Processor | ECS Fargate           | Session lifecycle upserts              |
| Alert Processor   | ECS Fargate           | Rule evaluation                        |
| PostgreSQL        | RDS t4g.medium        | Events, sessions, partitioned by month |
| Redis             | ElastiCache t4g.micro | L1 cache, rate limiting, SSE pubsub    |
| ALB               | Elastic Load Balancer | HTTPS termination with ACM certificate |

Infrastructure is fully Terraformed under `quint-platform/infra/terraform/environments/prod/`.

### Endpoint (macOS)

| Component      | Footprint          | Purpose                            |
| -------------- | ------------------ | ---------------------------------- |
| QuintAgent.app | \~20MB disk        | Container for system extensions    |
| ES Extension   | \~50MB RAM steady  | OS-level event capture             |
| NE Extension   | \~40MB RAM steady  | Transparent network interception   |
| Go Daemon      | \~100MB RAM steady | Proxy, session tracking, forwarder |
| Local SQLite   | 10-100MB           | Signed audit log (rolling)         |

## Security Properties

<Note>
  Source code content, credentials, and full LLM conversation bodies never leave the machine. Only structured metadata (tool name, capability, risk decomposition) goes to the cloud.
</Note>

* **Audit log tampering:** Ed25519 signature per row, chained by `prev_hash`. A single modification breaks the chain.
* **TLS MITM:** per-hostname leaf certs signed by a local CA that never leaves the machine.
* **Cloud auth:** deploy tokens are SHA-256 hashed in Redis, JWT for dashboard users.
* **Tenant isolation:** Postgres RLS on every tenant table, SNS/SQS FIFO ordering per session.

## Design Principles

1. **Local-first capture, cloud-first scoring.** Raw bodies stay on the machine. Normalized events flow to the cloud.
2. **Lossy at the edge, durable in the cloud.** Under backpressure, the edge drops events rather than block user traffic. The cloud retries.
3. **Zero client changes where possible.** Forward proxy plus NE means no SDK integration, no new endpoints.
4. **Session-centric model.** Everything anchors to sessions, not raw events. Audit rows, cloud events, and dashboard views all join on `session_id`.
5. **Code signing first.** Agent detection uses macOS code signing as the highest-confidence signal, falling back to process name and path matching only when signing data is unavailable.
6. **Tenant isolation at every layer.** Deploy tokens are scoped to organizations. Postgres uses monthly partitions with row-level security. Cloud queues use FIFO ordering keyed by session.
