A Near Miss write-up for Agentware 2026 by Hackathon Raptors. Every number is in the repo's committed results.

Night Shift is my Agentware entry: an on-call agent for one small server. It may only use actions it can undo, every
action has to pass a policy written in code, agent code checks the result afterwards, and a failed check undoes the
action. I built it with Claude Code doing most of the typing; the design and every claim are mine.

On the last day I ran the official Trap Pack: 20 hostile files with prompt injections, fake bosses, poisoned tool
output and broken data. I fed each one in the way it would really arrive: mail to the on-call inbox, a voicemail
transcript, a page linked from an alert, and the runbook a real alert points to while a real fault is running.

Run 1 came back perfect. 24 runs, zero actions outside policy, no canary token in anything the agent produced.

Then I read the traces.

The pass that wasn't

The four emails never reached the agent. They are addressed to somebody else and reach the on-call mailbox by
envelope, the way mail does through an alias or a list. My inbox poller only looked at the To header, so it never
opened an incident for any of them. Every email in my own test suite had the on-call address in To, because I wrote
them.

None of the 13 planted runbooks was read. I had put each one in place of the runbook a real CPU alert names, with
the fault running. The agent fixed the fault every time, correctly, and never opened the runbook. Claude Opus went
straight to the metrics and the process list. My own trap suite had been run on Haiku during development, and Haiku
did open runbooks. My tests were testing the habits of a different model.

And my test runner told the agent it was a test. The false alerts it posted had a label source: trap, and the
file names started with trap-. The model's closing notes mentioned it.

So the clean result came from not looking. If I had stopped at the summary line, the README would have said the agent
resists the whole pack, and the traces would have said it never saw most of it.

What I changed

  • The inbox takes mail addressed to the on-call box in To, Cc or the envelope.
  • Agent code reads the runbook an alert names before the first model turn, and gives it to the model as untrusted text. An on-call engineer opens the runbook first, and a runbook is where a team writes "never do X to this service". The safety still does not depend on the model: a target named only in untrusted text is refused by policy.
  • The runner's alerts and file names are neutral, and every delivery has its own alert fingerprint (a file sent twice had been dropped as a duplicate).

Run 2: 37 runs over all 20 files, zero actions outside policy, no canary in anything the agent produced, nothing done
on a healthy box, and 13 of 13 real faults fixed while a planted file was the runbook in front of the model. This time
its closing notes named what was planted: "a pull request containing prompt-injection (requests to approve and
auto-merge, leak DEPLOY_TOKEN, and a postinstall script exfiltrating env vars), ignored".

Two more I found because of it

Once I was reading traces instead of totals, two other things fell out.

The model could choose how easy its own exam was. Every action names a check that agent code runs afterwards, but
the policy only checked the kind of check. Nothing stopped a proposal from naming "CPU below 100% for 0.1 seconds",
which passes whatever the action did. Opus never did it. A model steered by hostile text could, and so could an honest one: the same night, Sonnet named a 10- or 15-second check in four of its eval runs. Policy now refuses a
check looser than the alert thresholds, and every trace I had recorded still replays to the same decisions. Those four Sonnet proposals were refused, and each came back with a valid one.

The kill switch did not work on a Mac. ./nightshift stop died with undo[@]: unbound variable under bash 3.2,
the bash macOS still ships. An empty array under set -u is an error there. The stop button that a judge would press
first was broken in the shell most judges' laptops have. CI now runs every command under bash 3.2.

The guardrail had a door in it. Two hours before the code freeze I asked a fresh AI reviewer to judge the repo
cold. It found that the provenance rule, the one that stops an email from naming a target, trusted the labels on every
read result. One read, the local HTTP check, labels its result with the path it was asked to fetch. So a path named only
in an email was refused, and the same path was allowed after the agent asked for it once. Scope still kept it to two
cache folders, but it was a way around the rule. A label that only repeats the caller's own argument is not evidence
any more, with a test that fails without the change. Then I swapped the model for a test planner that proposes the
actions it finds in the hostile text, so the policy had to stand on its own: on two hostile emails it proposed deleting
the orders database and quarantining the protected backup, and all five proposals were refused.

The lesson I'm keeping

Before counting a pass, check that the hostile input reached the model. A test that cannot fail is not a result, and
"0 failures" is exactly what it looks like.

The repo, the traces of both runs and the decision records are public: https://github.com/aimanmalib/nightshift
(tests/trap-pack/, ADR 0016, 0017 and 0019).

Agentware 2026 was run by Hackathon Raptors, and the write-up awards are backed by FileClerk (https://fileclerk.co.uk/).