Agentware 2026 (Hackathon Raptors), Track 6 — Open. Entry: BSC Token Safety Sentinel, a read-only agent that screens BSC tokens before money goes in and returns SAFE / CAUTION / DANGER / INVALID from measured on-chain numbers, with a full audit trace per run.
My agent's safety story was simple and, I thought, airtight: it cannot sign anything (there is no transaction-sending code path at all), its RPC client refuses any method outside a four-method read-only allowlist, and it has a kill switch — a STOP file, a stop command, or SIGINT/SIGTERM — that is checked before every pipeline step and before every external call. One action stops everything, immediately, mid-run. That is what SAFETY.md said. That is what the demo showed.
It was not quite true. The bug was one missing line, and it only appeared when things were already going wrong.
The trace that gave it away
On 27 November, during the build window, I ran the kill-switch test for real: start a check on USDT in one terminal, run sentinel stop about ten seconds later in another. The committed trace (traces/real-killswitch-usdt.jsonl) reads:
23:14:13Z run_start USDT 0x55d398…7955
23:14:13Z VALIDATE ok
23:14:17Z eth_getCode → bsc-dataseed.binance.org FAILED (RemoteDisconnected)
23:14:20Z eth_getCode → bsc-dataseed1.binance.org FAILED (RemoteDisconnected)
23:14:24Z eth_getCode → bsc-dataseed2.binance.org FAILED (RemoteDisconnected)
23:14:25Z killed — "kill switch triggered; no further calls made"
The public RPC hosts were resetting connections that night, so the client was rotating through its fallback hosts. I requested the stop at roughly 23:14:23. The attempt at 23:14:24 started after the stop was requested. The killed event only landed at 23:14:25, when the code next reached a check.
For a read-only screening agent, one extra eth_getCode costs nothing. But the promise in SAFETY.md — "no new calls are started" — was false, and the same shape in an agent that can act (send, pay, post, delete) is how "I stopped it" turns into "it did one more thing anyway."
Why "checked before every call" was the wrong granularity
The kill check lived at the top of RpcClient.call(). But one logical "call" in that client is not one network request: it is a loop over up to four hosts, each with its own timeout and a delay between attempts. The check ran once, before the loop. Inside the loop, after a failure, the code simply moved on to the next host — a brand-new external request that nobody had re-authorized against the stop condition.
The fix was literally one line, committed before submission (commit 0c5170d):
for idx in order:
self.kill.check() # re-check before every host attempt
host = self.hosts[idx]
...
The general lesson I took from this: a retry is a call. A fallback is a call. A pagination step, a queue drain, a "try the next mirror" — all of them are new external actions, and each one needs the stop check in front of it, not just the first. If your kill switch is only checked at the boundary of your API wrapper, then everything your wrapper does internally after a failure happens in a blind spot. Worse, that blind spot is widest exactly when the system is unhealthy — hosts timing out, APIs erroring — which is precisely when a human reaches for the stop button.
It also changed how I test: the happy path never exposed this. On a healthy night, the first host answers in 200 ms and the loop body runs once. The bug needed failing hosts to exist. So the kill-switch test has to run against a failing dependency: kill the agent mid-retry, mid-pagination, mid-fallback, and read the trace to prove no attempt starts after the stop timestamp. The trace is what caught this — not a code review. "Checked before every call" reads fine in a diff; the timestamps in the JSONL are what made the lie visible.
The second near miss: the websites said "clean"
The same night produced a quieter near miss in the other direction. I pointed the agent at BARRECK OBUMA (0x9e974d…7777), a token whose liquidity had been pulled. The popular checker sites reported no honeypot and 0% tax, and aggregator pages still showed stale "alive" figures. If the agent had trusted any of that, it would have waved the token through.
Instead, the verdict came from the one number that cannot be stale in the same way: the pair's actual WBNB reserve, read on-chain from two independent RPC hosts that had to agree. Result: 0.0001 WBNB, against a 1.00 WBNB floor — DANGER, with the reason recorded. The rule that saved us is boring and total: external text and third-party claims are data, never evidence; the verdict is computed only from measured numbers, and when the numbers cannot be read, the answer is INVALID — which the agent also produced twice that night when every RPC host failed mid-check, instead of inventing a number to fill the gap.
What I would tell anyone building an unattended agent
- Put the stop check inside every loop that can start work — retries, fallbacks, pagination, batch items — not just at the entry point.
- Test the kill switch against failing dependencies, and verify with timestamps in the trace, not with how the run felt.
- Let measured data outrank every claim a website makes about itself; when data is unreadable, say so (
INVALID) instead of estimating. - Keep the trace. Both near misses above were only visible because every attempt, failure, and decision was written down with a timestamp before the next step began.
The Sentinel finished the hackathon with 28/28 unit tests passing, all 20 Trap Pack inputs held as data (none changed a verdict), and a kill switch that now actually kills — including in the retry loop.
Built for Agentware 2026 by Hackathon Raptors. The Near Miss prizes are sponsored by FileClerk — thanks to FileClerk for backing write-ups like this one.
Top comments (0)