# How Capture works

> The capture service, the notary, and the capture modes.

Part of the Exalto Capture docs. Page: https://capture.exalto.ai/docs/how-it-works. Every page is listed in https://capture.exalto.ai/llms.txt; the whole site in one file is https://capture.exalto.ai/llms-full.txt.

Capture is a capture service between your client and the provider. With the [SDK](https://capture.exalto.ai/docs/sdk) it runs inside your own process; with [hosted capture](https://capture.exalto.ai/docs/hosted-capture), Exalto runs it for your organization. Your client's requests go through it, and it relays each one through a notary to the provider and records it.

What gets recorded, and who besides you sees the request, depends on the **capture mode**.

## The request path

**Figure.** In Notarized mode only your process and the provider see the plaintext. The notary relays encrypted records it cannot read.

1. The client sends an ordinary provider request through the SDK.
2. The SDK runs the provider's TLS session through the notary, which relays encrypted records it cannot read.
3. The notary opens the provider connection and witnesses the session. The proof is computed later, when the Trace is sealed.

Sees plaintext: Your client, Capture SDK, Provider. The notary sees ciphertext only.

The response streams back to your client as it arrives. When it ends, the notary signs a receipt for the session and the SDK hands your code an encrypted checkpoint of the exchange. The Trace is now **Captured**. Nothing slow happens on the request path: the TLSNotary proof is computed later, only for the calls you choose to [seal](https://capture.exalto.ai/docs/seal-and-verify).

## Capture modes

| Mode | The notary sees | Each request becomes | Exalto services used |
| --- | --- | --- | --- |
| Notarized | Ciphertext, sizes and timing only | A Captured Trace you can seal into a proof | Notary on each request; sealing when you ask |
| Witnessed | The full request and response, credential included | A Trace sealed by the notary's receipt | Notary on each request |
| Off | Nothing | Nothing: no Trace, no evidence | None |

A failed request never falls back to another mode.

### Notarized

The notary never receives your credentials or your plaintext. It opens the connection to the provider and relays the encrypted TLS records, which lets it witness the session without reading it. Your process still holds both, and so does the encrypted checkpoint it returns: whoever holds that checkpoint and its capture key can rebuild the request. Later, sealing turns the checkpoint into a TLSNotary proof that anyone can check against the notary's public key.

### Witnessed

The notary receives your request in full, credential included, and vouches for the exchange with a signed receipt.

**Figure.** In Witnessed mode the notary relays the plaintext exchange itself, so it sees the request, the response and the credential.

1. The client sends an ordinary provider request through the SDK.
2. The SDK sends the plaintext request, credential included, to the notary over TLS.
3. The notary opens the provider connection, relays the exchange, and signs a receipt over the redacted request and response.

Sees plaintext: Your client, Capture SDK, Notary, Provider.

The notary holds the plaintext only in memory for the session. It never logs or stores it, and the receipt contains no credential value. A Witnessed Trace is sealed as soon as the call completes and sealing costs one signature at any size, but the evidence is the notary operator's word, not a proof.

### Off

Nothing is recorded, and no Exalto service takes part. With the SDK, that's any call you make without it. Hosted capture has an Off mode that forwards requests straight to the provider.

**Figure.** With hosted capture off, the gateway forwards each request straight to the provider. No notary takes part and nothing is kept.

1. The client sends an ordinary provider request to the gateway.
2. The gateway forwards it straight to the provider over HTTPS. Nothing is recorded and no notary takes part.

Sees plaintext: Your agent, Exalto gateway, Provider. No notary takes part.

Requests made with capture off can never be sealed or verified later.

### Choose the mode

With the SDK you choose for each call: `capture` for Notarized, `witness` for Witnessed. For hosted capture, the organization has one mode at a time, which an owner sets in the web app. Each request takes the mode in force when it arrives, so a change applies only to later requests. Turning hosted capture back on connects to the notary first; if that fails, capture stays off rather than recording some other way.

## Fixed providers

Capture isn't a general proxy. It sends only `POST` requests to five fixed provider hostnames, which the SDK takes from the request URL and the gateway from its fixed routes; nothing can point it at another host. In Notarized and Witnessed modes the notary, not your process, resolves and connects to that hostname, and it checks it against its own allowlist. The [SDK page](https://capture.exalto.ai/docs/sdk#what-can-be-captured) lists them.

## Sealing later

A Captured Trace doesn't depend on the original connection, the provider, or even the notary instance that witnessed it. Any notary holding the same signing key can finish the proof from the encrypted checkpoint, as long as Exalto's Registry still lists a notary that seals for that key. A failed or interrupted seal can be retried: the checkpoint is never consumed.

## Next steps

- **[Traces](https://capture.exalto.ai/docs/traces)**: The two states and two evidence kinds every Trace has.

- **[Trust model](https://capture.exalto.ai/docs/trust-model)**: Who sees what in each mode, and what the evidence proves.
