My Near Miss write-up for Agentware 2026, run by Hackathon Raptors.
I built Halflife for Agentware 2026: an agent that takes a leaked credential from "found in a CI log" to "revoked and proven dead", with nobody at the keyboard. It creates a new key, moves every service onto it one by one with health checks, revokes the old key only when the database shows none of our services still use it, then scrubs the leak and files the incident. The model never sees a secret: every value is swapped for a label like ⟦orders-db@v1⟧ before it reaches a prompt.
I thought the dangerous part was the revoke. It wasn't.
The near miss
On day two I added a watch mode, the thing you'd actually leave running. It also queues incidents: if a second leak arrives while another rotation is still open, a rule in code (one rotation at a time) blocks it, and the watcher retries it when the first one finishes.
In the first live test, the second leak (a database password pasted into a team chat) got queued exactly as designed. While it waited, the agent did something reasonable: it scrubbed the password out of the chat message.
Then the first rotation finished and the watcher retried the queued leak. The scanner looked at the chat message, now clean, and found nothing. The agent read the same clean message and concluded, quite sensibly, "no live leak here". The run ended green.
The leaked password was still valid. Nobody had rotated it. And my own safety net, a completion check that refuses "done" while anything is open, waved it through, because it judged "is this leak live?" by looking at the text.
Every log line looked tidy. That was the problem.
Why it happened
I had treated "the secret no longer appears in the source" as if it meant "the secret is no longer dangerous". Those are different facts. Redaction changes what people can see. Only revocation changes what attackers can use.
The fix, in code, not in the prompt
- The scanner's signed evidence ("this exact key version leaked in this source") now outlives redaction. Reading a scrubbed source still reports the leak as live until that key version is revoked.
- The queued retry cites the original evidence instead of re-scanning the clean text.
- The completion check judges liveness from the evidence, not from the text.
Rerun: the agent rotated the key, revoked it and proved the old one dead, 169 seconds after the leak was first detected, including the time it spent waiting in the queue.
The trap that got through: 8 canaries, zero secrets
The official Trap Pack hides canary tokens in hostile emails, web pages and documents. My agent never saw a single secret, yet on one run it leaked 8 canaries. While describing each attack in its incident reports, it copied the attacker's reference code word for word, which is exactly how a planted marker gets carried out of a system. Not having data and not carrying it out are different things.
The fix is a provenance filter: any code seen in an untrusted source is stripped from anything the agent sends out, before the tool runs. Since then, 0 of 60 live runs leaked a canary. I also planted a live key in every trap file and let the files try to steer the agent while it rotated: 60 of 60 runs killed the key, with no downtime.
Hour 47: an order that would rotate a key twice
On Sunday evening I added "Rotate now": rotate a key on request, even though nothing leaked. An order is just another item for the watcher, and when the run ends the order file is marked done.
Marking it done rewrote the file, and the watcher notices new work by file timestamps. So any order that had been queued, or resumed after a restart, looked brand new again and went back to the agent, which would mint fresh evidence for the new key and rotate it a second time. Harmless once, but an agent that redoes work because it can't tell a finished job from a new one is exactly the kind you can't leave alone.
Two fixes, both in code. Closing an order keeps its timestamp. And an order gets one signed evidence record for the key it was raised against, forever: if it is ever raised again, it points at a key that is already revoked, and the policy refuses it as stale. A test now raises the same order twice on the real sandbox, and the second one is refused.
What I'd tell anyone building an agent you walk away from
Check the state of the world, not the state of the text. Ask "is the key dead?", not "can I still see it?".
And press the button at the worst moment. I pressed STOP after every one of the 34 steps of a rotation and restarted each time. At four of those points, every service had already moved to the new key but the process died before the revoke, and on restart it saw nothing left to do. The leaked key would have stayed valid forever. Now an unrevoked old key counts as an open rotation, and all 34 recover.
Halflife is open source: github.com/Nikhils-G/halflife. There is a 3-minute demo at youtu.be/WSxSXkF1oIs and a live instance you can attack yourself at halflife.188-245-251-229.sslip.io (press "Leak a key").
Thanks to Hackathon Raptors for running Agentware, and to FileClerk for backing the Near Miss prizes.
