Tokens & DPoP
Your application authenticates to the gateway with a phantom token — a capability token minted for one agent. It is short-lived, scoped, and revocable, and it stands in for the real provider key (which never leaves the server).Token shape
env—liveorsandbox(mirrors the route’s sandbox flag).kind— the capability class (below).- The token is validated by a capability HMAC bound to your tenant master key, so a token minted for one tenant can’t be replayed against another.
Token kinds
Scoping
A token’s scope can constrain:- Providers — which upstream providers the token may reach.
- IP / CIDR — the source ranges allowed to present the token (enforced via a shared CIDR matcher).
- Expiry — every token can carry a TTL; expired tokens are rejected at the edge.
DPoP (sender-constrained tokens)
Setdpop_required: true on a token to make it sender-constrained per RFC 9449. The client generates a key pair and sends a DPoP proof JWT on every request; the gateway binds the token to that key’s thumbprint (jkt) and rejects the token if presented without a matching proof.
This means a leaked token is useless without the corresponding private key — the single most effective mitigation for the “unscoped env-var key” problem that dominates agent deployments. DPoP nonces are tracked in a durable, cross-worker store so replayed proofs are rejected even behind multiple workers.
OIDC workload federation (CI without static secrets)
CI systems and workloads can exchange a short-lived OIDC id_token (e.g. a GitHub Actions token) for a scoped phantom token via RFC 8693 token exchange, so no long-lived secret is stored in the pipeline:Impossible-travel detection
Set a gateway’sgeo_velocity_action to catch a token used from two places too far apart to be the same holder (a leaked credential in use elsewhere):
- off (default) — no geo check.
- warn / block — classify each request’s location against the token’s last-used location and emit an alertable
ai_gateway.geo_velocity_anomalyaudit event (severity scaled by how implausible the travel is). These feed the token’s security-events view and any compliance alert rules.
ai_gateway.refresh_theft. Both feeds surface on the token’s security-events view.