A leaked key starts a race you did not schedule: the finder — a scanner bot, usually, within minutes of a public posting — against your revocation. Everything in this playbook exists to make your side of that race boring and fast.
The short answer
Run four moves in order. Revoke the compromised credential at the provider and confirm the gateway is refusing it. Attribute: query the decision log for every call under that credential, especially in the window since the leak, and classify what was done with it. Rotate: issue the replacement with the same or narrower scope, verified live before the old one's absence breaks work. Hunt the path: find how the key escaped — log, repo, ticket, transcript — and close that path, because rotating without closing it just issues the next leak a fresh key.
Check your own setup as you read: run the free Spend Guard self-check or test a policy in the playground — five minutes, no signup, and the gaps it names map to the controls below.
Worked example: 34 minutes from alert to closed
At 11:02 a scanner alert told a fictional logistics firm, Redpath Haulage, that a key-shaped string matching one of its agent credentials had appeared in a public code snippet pasted by a contractor. 11:06 — the credential was revoked at the provider; the gateway log confirmed refusals under it. 11:19 — attribution complete: the key's legitimate agent had used it normally until 10:58; between 10:59 and 11:05 an unknown caller had made 41 calls, all read-only lookups of rate tables, no writes, no exports. 11:27 — replacement issued at narrower scope and verified live. 11:36 — path found: the contractor's snippet came from a debug bundle the agent itself had generated, which included an environment echo.
Total exposure window: about six minutes of third-party use, read-only, fully enumerated. The firm's review credited two preparations: per-agent keys, which made the blast radius one agent instead of eleven, and the drill programme, which had rehearsed revocation twice that year. The debug bundle generator was fixed to redact credential-shaped strings — the same output filter their secrets programme had recommended — and the playbook gained a fifth move: check every other agent's outputs for the same escape path before declaring the incident closed.
Revoke first, investigate with the clock stopped
The instinct to 'check whether it is really our key' before revoking spends the exact minutes the race is decided in. Revocation is reversible — a mistakenly revoked key is reissued in minutes — while a leaked key's misuse is not. So the playbook's first move is unconditional: on a credible report, revoke, then verify the refusal in the gateway log, then begin asking questions with the exposure window already closed. Redpath's six-minute window was the product of that ordering, not of fast typing.
Attribution defines the incident's real size
A leak is not automatically a breach. The decision log tells you what the credential actually did: which calls, from where, in the window between escape and revocation. Read-only rate lookups and a drained wallet are different incidents with different notifications, and you cannot know which you have until you query. Keep the query rehearsed — credential id, time window, action classes — because inventing it under pressure, against an unfamiliar log schema, is where first hours quietly go.
Rotation is a change; run it like one
The replacement credential is issued with scope reviewed against the agent's recent real usage — a compromise is a free audit of whether the old scope had drifted wide. Verify the new credential with a live authorised call in the log before considering the agent restored, and record the rotation in the registry with the incident reference. Shortcuts here create the second incident: the agent that silently stops working, discovered by its users a day later.
Close the path, then sweep for siblings
The key escaped somehow, and the somehow is still open. Trace it — the debug bundle, the ticket attachment, the transcript — close it with a mechanical control where one exists, and then sweep: does the same path exist for other agents, other key types, other teams? Redpath's fifth move exists because escape paths are almost never unique to one agent. An incident that closes one leak and leaves its siblings is a subscription, not a resolution.
Preparing the playbook before it is needed
Every step of the first hour depends on something prepared in peacetime: the provider's revocation path bookmarked and permissioned for the on-call, the attribution query written down, the registry current, the replacement-issuance flow rehearsed. Assemble these into a one-page playbook per provider, stored where the on-call rota lives, and walk it in a drill twice a year with a test key. The drill's usual findings — the revocation console needs a permission the on-call lacks, the registry's provider link is stale — are ten-minute fixes in a drill and ten-alarm fires in a real leak. Preparation is the whole game; the first hour merely collects on it.
The first hour after a key leak, in order
- Revoke the credential at the provider immediately on a credible report, and confirm refusals under it in the gateway log.
- Attribute: enumerate every call under the credential in the exposure window and classify reads, writes, sends and spend.
- Rotate with reviewed, narrower-or-equal scope; verify the replacement with a live authorised call before calling the agent restored.
- Find the escape path and close it with a mechanical control — redaction, filtering, access change — not an instruction.
- Sweep sibling agents and outputs for the same escape path, and record the whole incident in the registry.
Source note and related guides
Figures in the worked example are illustrative, drawn from a fictional company created for this guide; the controls, failure patterns and procedures described are the gateway's documented behaviour — see the Agent Auth Gateway documentation and the policy patterns in allowlists vs denylists, spend caps and the agent kill switch. Reviewed by the Ingenious AI team, 2026-11-14.
Sources
- RFC 6749, The OAuth 2.0 Authorization Framework, the IETF standard behind scoped, expiring access tokens: rfc-editor.org, 2012
- Model Context Protocol specification — Authorization, the MCP standard for OAuth-based authorization of MCP servers: modelcontextprotocol.io, 2025
- NIST AI Risk Management Framework (AI RMF 1.0), the voluntary framework for managing AI risk across design, development and use: nist.gov, 2023