<!-- Generated by website/scripts/sync-docs.mjs from docs/design.md. Edit that file, not this one. -->

# How it works

> Every page of this site: https://dyokto.github.io/laissez/llms.txt

## Pieces

- **Forward proxy (`HTTPS_PROXY`)**. Agents open tunnels with CONNECT. A host:port the agent's policy does not name gets 403 before anything is dialed. Allowed hosts without credential brokering are tunnelled as is, until one side closes or no byte has moved in either direction for five minutes.
- **Credential injection with TLS interception, only where needed**. For hosts where laissez injects a credential (GitHub today), it terminates the agent's TLS with an in-memory CA generated at start. The CA's key never touches disk, and its certificate carries critical name constraints (RFC 5280 §4.2.1.10) for exactly the intercepted host names and no IP addresses. laissez replaces any `Authorization` header the agent sent, never reads or changes bodies, and forwards over a new TLS connection with Go's certificate verification on.
- **Identity in**. An X509-SVID as the TLS client certificate to the proxy, verified against the trust bundle of the trust domain the SVID names; a JWT-SVID as `Proxy-Authorization: Bearer`, verified against a JWKS / SPIFFE bundle; or, on a Unix socket, the peer's uid (and optionally executable path) from the kernel, mapped to a SPIFFE ID. If two are presented they must name the same SPIFFE ID.
- **GitHub**. Mints installation access tokens limited to the repositories and permissions in the agent's policy, signs the App JWT itself (RS256), caches each token until five minutes before it expires, and refuses a token if GitHub grants more than was asked. Injects `Bearer` for `api.github.com` and `Basic x-access-token:<token>` for git smart HTTP on `github.com`; other paths on `github.com` are refused.
- **AWS**. Serves the container credentials endpoint the AWS SDKs read (`AWS_CONTAINER_CREDENTIALS_FULL_URI`). Each request is authenticated by the value of `AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE`: a JWT-SVID, or a per-agent random token laissez writes at start. laissez calls STS `AssumeRole` with the agent's inline session policy, `DurationSeconds=900`, and `SourceIdentity` / `RoleSessionName` derived from the SPIFFE ID, signed with a built-in SigV4 signer.
- **Audit**. One JSON line per decision: time, agent SPIFFE ID, identity method, destination, method, path, credential kind, scope, the first 16 hex characters of SHA-256 of the minted token, decision, reason. If the audit record cannot be written, the request is refused.
- **Strict configuration**. One TOML file. Unknown keys, missing references, non-loopback plain-text listeners and unscoped GitHub grants are errors, and `laissez check` reports them without starting anything.

## Running it

```sh
laissez check --config laissez.toml
AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... laissez run --config laissez.toml
```

[examples/laissez.toml](https://github.com/dyokto/laissez/blob/main/examples/laissez.toml) documents every key. The agent's environment then needs:

```sh
HTTPS_PROXY=https://127.0.0.1:8443        # or http:// for a loopback listener without TLS
SSL_CERT_FILE=/path/to/bundle-with-laissez-ca.pem
AWS_CONTAINER_CREDENTIALS_FULL_URI=http://127.0.0.1:8091/v1/credentials
AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE=/path/to/agent-jwt-svid
```

The AWS variables are needed only when the agent has an `[agent.aws]` policy. The AWS credentials in laissez's own environment sign `AssumeRole` calls and are never handed to agents.

## What it does not do

- It does not stop an agent from misusing a credential within its scope. A token that can write to one repository can still push a bad commit to it. See [THREAT-MODEL.md](https://dyokto.github.io/laissez/threat-model/).
- It does not inspect or filter bodies. There is no DLP.
- It does not forward plain `http://` requests. Only CONNECT is served.
- It has no wildcard host rules. Each host:port is listed.
- v0 does not do GCP credentials, generic RFC 8693 token exchange, DPoP, or WIMSE workload identity tokens. RFC 8693 exchange is planned for v0.2, against [dyokto/omega](https://github.com/dyokto/omega).
- It does not fetch trust bundles from a SPIFFE Workload API or federation endpoint. Bundles are files, read at start.
- It is not a sandbox. An agent that can reach the network without the proxy is not covered; enforce that with the platform (network policy, firewall, container egress rules).
