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
| Key | Token | Who holds it | May call |
|---|---|---|---|
| Gateway | gk_<16 hex>.<secret> | a gateway, in its secret store | evaluation only |
| Agent | ak_<16 hex>.<secret> | one agent's runtime, never the model | sent beside a gateway key, as X-Agent-Token |
| Console | ck_... | Caroline itself | evaluation, 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.
- A new gateway: + New gateway, its id, a name, its key's name and why, then Add it and make its key. A gateway is created with its first key.
- Another key for a gateway: + New key on its card.
- An agent's key: + New key for an agent, pick the agent, name the key, Make the key. The agent must be one Caroline's directory holds.
{ "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.
| State | Means |
|---|---|
pending | issued; the PDP does not hold it yet |
live | the PDP accepts it |
revoking | revoked here; the PDP has not taken the revocation yet |
revoked | the 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
- Rotate by issuing a second key to the same gateway, deploying it, then revoking the first. The binding belongs to the gateway, so it stays.
- Revoke on the key, a reason, then Revoke for good. It is final. A revocation acts first and is recorded after, so a leaked key never waits on the audit disk.
- Removing an agent from the directory revokes its live keys in the same change.
{ "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.
| Part | Choices |
|---|---|
| Agents | every agent Caroline holds, or only these (up to 256) |
| Agent keys | as each agent's record says, or each agent sends its own key |
| People | no, only agents; only people Caroline holds; or anyone |
| Actions | any action on any kind of record, or only these (up to 64 pairs; either half may be *) |
| Records | only 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.
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.
What a binding does not cover
- The person an agent acts for: the rules check that.
- Individual record ids, and a binding per key.
- Search and explain: a gateway key cannot call them at all.
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).