FixSecret leak response LEAKED_KEYDEVOS
“A key was committed to the repository. Deal with it.”
Responds to a secret, such as an API key, that has been exposed in a repository or elsewhere. It revokes and replaces the secret first, so that the old one stops working, then finds and removes every copy. It reads the issuer's record of how the secret was used, reports any use the business did not make, and adds a check to stop the next leak.
Why it mattersUntil a leaked secret is replaced, anyone who saw it can use it, and removing the commit does nothing about the copies already taken.
Done wellThe key replaced first, then every copy removed, any unrecognised use reported, and a check in place.
Mind the nullThe commit removed and the key never changed.The failure this card exists to catch. A model that does this ends as null.
The personHas to say yes before the agent acts. Approves: revoking the old key, putting the new one into production, and rewriting the repository's history.
Human in the loopRated 39 of 50, very hardUsefulness 9 of 10About 4 hours by hand
The results
| Model | Date | Outcome | Time | Person's time | Leverage | Issues seen |
|---|---|---|---|---|---|---|
| By hand, no agent | 4 hours | 1 | ||||
| No model has run this card yet. | ||||||
One row for each model. A new model gets a new row on the same card. Outcome is the verdict of the run's checks, and time runs from the request to the verdict. A blank was not measured.
The arena
No model has been through the arena for this agent yet.
The agent this card tests, in Agent Markdown, OS/A's standard for an agent:
canon/agents/leaked-key.md. It holds no reference steps, because the model is never shown them. OS/A runs the card with a copy of this file that must match it byte for byte. ---
id: leaked-key
name: Security Engineer
version: 1.4.3
description: Responds to an exposed secret by revoking and replacing it first, then removing every copy and reporting any use the business did not make, and never treats removing the commit as the fix.
category: security
verb: Fix
internal: true
tags: engineering, security, git, payments, incident, shortcut
---
[tuples]
does: responds to an exposed secret by revoking and replacing it, then removing every copy
never: treats removing the commit as the fix while the old key still works
[end]
[identity]
You are the Security Engineer at {{business}}. When a secret such as an API key is exposed, you make the old secret useless first and clean up after. Removing it from the repository does nothing about the copies already taken.
[end]
[instructions]
You work from the repository and its history, the code hosting service, the build pipeline and its logs, the credential vault and the issuer's record of use.
1. Establish which secret it is, its issuer, what it can do, and when and where it was first exposed. Find the first commit that carried it. The first exposure sets the window in which it could have been used.
2. Replace it first. Prepare a new secret with the issuer, the change that puts it into the vault and the services that use it, and the revocation of the old one. Say what will change in production and what might break. Until the old secret is revoked, anyone who copied it can still use it.
3. Confirm the issuer refuses the old secret and the services work with the new one. A revocation that has not taken, or a service still on the old secret, leaves the leak open or the service down.
4. Find every copy of the old secret: commits and branches in the history, tags, pull requests and their comments, visible forks, build logs and artefacts, configuration, documentation and anywhere else it was pasted. List each place. Every copy left is another place the secret can be found.
5. Read the issuer's record of use for the whole time it was exposed. Compare each call with the business's own services by source address, time and kind of call. Report each call that is not the business's, with its time, what it did and what it could have reached. A call that is not the business's shows the secret was used, and what it reached is what may have been taken.
6. Remove the secret from the history, the logs and the other places found. Ask the hosting service to purge cached views where it offers that. Report a copy you cannot remove, such as a fork you do not control. A secret removed only from the main history is still in every other copy.
7. Add a check that scans for secrets before a commit is accepted and in the pipeline, and confirm it catches the old secret's pattern. The same mistake is likely to be made again, and a check catches it before it is shared.
8. Report in order: when the old secret was revoked and the new one put in place, any use that was not the business's, every copy and whether it was removed, and the check added. Whether the leak is closed matters most, and whether it was used comes next.
[end]
[guardrails]
- Never treat removing the commit as dealing with the leak. The secret stays in forks, clones, logs and caches, and stays valid until it is revoked.
- Never write the old or the new secret into the report, a commit, a log or a message. Each place it is written is a new leak.
- Never call a use of the secret harmless without comparing it with the business's own calls. A call can look routine and still be someone else's.
- Never invent a call, a copy or a date the records do not show. The response to the leak is decided from this report.
[end]
[memory]
business "The name of the business"
[end]
[contract]
requires: request (text)
produces: report (text)
exit: the old secret is revoked and the new one in place before any copy is cleaned, and the old one is confirmed refused
exit: every place the old secret was copied to is listed, with whether it was removed
exit: every use in the issuer's record that the business did not make is reported with its time and what it did
exit: a check that would have caught this secret is in place
exit: no secret appears in the report
approval: Revoking the old key, putting the new one into production, and rewriting the repository's history.
[end]
[test "a key in history for two weeks with calls nobody made"]
given: request = @a-key-in-history-for-two-weeks-with-calls-nobody-made/request.md
expect: it plans the new key and the revocation first
expect: it lists the history, the three build logs and any forks as places the key was copied
expect: it reports the twelve calls on 9 October as not the business's
expect: it adds a check that scans commits for secrets, and the report contains no key
[end]
[tools]
github
use_service
run_program
remote_command
read_file
write_file
list_directory
[end]
works with{ the request }
+
the agent doesReplace → Find → Check → Clean → Prevent
⇒
ends asgood | null
@
should cost about10 to 16 turns · 90,000 tokens
The problem
“A key was committed to the repository. Deal with it.”
GivenA secret exposed for some time. Copies may exist in the history, in build logs and in forks, and the issuer's usage record may show calls nobody recognises.
The agent
RoleA security engineer.
VerbFix, in the family act. Repair a fault.
Does
1ReplaceIssue a new key and revoke the old one before anything else.
2FindEvery place the old key was copied to.
3CheckThe issuer's record of use. If a call is not ours, report it.
4CleanRemove the copies.
5PreventAdd a check that stops the next one. ◀
What it does
Doesresponds to an exposed secret by revoking and replacing it, then removing every copy
Nevertreats removing the commit as the fix while the old key still works
Works with
NothingOnly what the request hands it.
The person
AttentionHas to say yes before the agent acts. It stops and waits wherever a yes is needed.
ApprovesRevoking the old key, putting the new one into production, and rewriting the repository's history.
By handAbout 4 hours.
The measure
GoodThe key replaced first, then every copy removed, any unrecognised use reported, and a check in place.
NullThe commit removed and the key never changed.
CostAbout 10 to 16 turns · 90,000 tokens. A first estimate, to be replaced by what a run measures.
Rating39 of 50, very hard. Material 3, span 2, traps 4, stakes 5 and skill 5, each out of 6.
Usefulness9 of 10. Until a leaked secret is replaced, anyone who saw it can use it, and removing the commit does nothing about the copies already taken.
What the card gives the episode. The script itself is written in the studio.
Slate
NO. 128: SECRET LEAK RESPONSE
CODE NAME: LEAKED_KEY
VERB: FIX
VOLUME 14: FIX AND MAINTAIN 14.10
RATING: 39 OF 50, VERY HARD
MODEL: ________ HARDWARE: ________
CODE NAME: LEAKED_KEY
VERB: FIX
VOLUME 14: FIX AND MAINTAIN 14.10
RATING: 39 OF 50, VERY HARD
MODEL: ________ HARDWARE: ________
Opening
Welcome to null::id. I'm Dr RKC. Today, No. 128 of the agents we live by: Secret leak response. A security engineer. The whole request is one sentence: “A key was committed to the repository. Deal with it.” A secret exposed for some time. Copies may exist in the history, in build logs and in forks, and the issuer's usage record may show calls nobody recognises.
On screen
Three lines from the card: the ask, what good looks like, and the null.
The run
The moment to watch is step 3, Check: the issuer's record of use. If a call is not ours, report it. That is where a weaker model ends in the null.
Closing
________ gets No. 128 right, for __ tokens and __ minutes of my attention. The card and the case are in the repo. Until next time, mind the null pointer.