CarolineDocs

Connect / Gateway keys and binding

Gateway keys and binding

A key proves which gateway or agent is asking. A binding says what that gateway may ask about. Both are set by an author, both are recorded, and the engine holds every change within a second or so.

Three kinds of key

KeyTokenWho holds itMay call
Gatewaygk_<16 hex>.<secret>a gateway, in its secret storeevaluation only
Agentak_<16 hex>.<secret>one agent's runtime, never the modelsent beside a gateway key, as X-Agent-Token
Consoleck_...Caroline itselfevaluation, search and explain

The secret is 32 random bytes. Caroline keeps only its SHA-256 and shows the token once, when it is issued. It is never stored, logged, listed or recorded.

Issue a key

The Keys page has a card per gateway and per AI agent, each with its keys by name.

POST/api/v1/keysauthor
{ "kind": "gateway", "principal": "partner-mcp", "name": "Partner MCP gateway",
  "label": "prod 2026-12", "reason": "Partner pilot" }

Answers 201 with the key id and the token. A gateway id is lower-case letters, digits and hyphens, up to 63 characters; console is reserved.

Know when it is in force

Each key has a state, so you never have to guess whether the engine has caught up.

StateMeans
pendingissued; the PDP does not hold it yet
livethe PDP accepts it
revokingrevoked here; the PDP has not taken the revocation yet
revokedthe PDP refuses it

When Caroline cannot ask the PDP, a key stays pending or revoking: it is never shown as live or revoked on a guess.

Rotate and revoke

POST/api/v1/keys/{key_id}/revokeauthor
{ "reason": "Key left on a build server" }

Bind the gateway

An unbound gateway may ask about any subject and any record: its card says Anything: not limited. Bind every gateway an outside party runs, with Limit what it may ask about on its card (Change what it may ask about later, Remove the limit to unbind). A call outside the binding is refused whatever the rules say, and the answer names no rule and no record, so a narrow gateway learns nothing beyond its binding.

PartChoices
Agentsevery agent Caroline holds, or only these (up to 256)
Agent keysas each agent's record says, or each agent sends its own key
Peopleno, only agents; only people Caroline holds; or anyone
Actionsany action on any kind of record, or only these (up to 64 pairs; either half may be *)
Recordsonly records Caroline holds, or also records a call describes

An empty list allows nothing: a way to stop a gateway without revoking its keys.

See what a binding would refuse before you save it

A save that could take something away is checked against the gateway's recent real calls first. If calls allowed now would be refused, nothing is saved and you see them:

Of the PDP's last 64 calls, 12 came through partner-mcp, and 3 that were allowed
would now be refused: a_finance_bot prepare on payment_order (3).

Choose Save anyway to go ahead. The ledger keeps the preview with the change.

PUT/api/v1/gateways/{id}/bindingauthor

The binding and a reason, the gateway's version in If-Match ("none" before its first binding) and a fresh Idempotency-Key. A save that would refuse recent calls answers 409 confirm_needed with the preview; send it again with "confirm": true.

POST/api/v1/gateways/{id}/binding/removeauthor

What a binding does not cover

Every change is in the ledger

key_issued, key_revoked and gateway_binding records carry the kind, the principal, the key id, the label, who acted and why. An issue or a binding is recorded before it is made; when the ledger cannot record, nothing is issued (503 ledger_unavailable).

Caroline DocsAuthZEN 1.0 · OPA