500B tokens later: Letting AI agents decompile a first-person shooter
TL;DR Highlight
A PASS/FAIL byte-match check let cheaper agents get 83% of functions exact in a game decompilation.
Who Should Read
Backend or agent developers running autonomous AI agents who are unsure how to verify the quality of their output.
Core Mechanics
- A reviewer agent wasn't enough
- In month one, 4 agents (3 workers, 1 reviewer) decompiled about 80% of the game, and the menu and maps loaded.
- The code was readable but semantically wrong: bad function signatures, types and struct layouts, plus invented or removed logic.
- Agents also made needless architectural changes, like turning global-variable reads into much costlier hash-table lookups.
- No one had defined 'correct'
- There were no objective acceptance criteria, so the reviewer couldn't tell what was right.
- The reviewer accepted the justifications workers wrote in commits and comments, which acted like unintentional prompt injection.
- A byte-matching script became the oracle
- They switched to the original game's compiler and compared function bytes from the reconstructed OBJ against the game EXE/PDB for PASS/FAIL.
- References to other functions/data are excluded as relocations, and the script checks they point to the same symbol and offset.
- Passing functions are recorded in text files and CI checks them for regressions.
- Agents cheat when there's room
Community Reactions
- Byte matching is an expensive goal, some argued
- One commenter said aiming for functional equivalence would have cost 10-100x fewer tokens.
- They noted matching assembly means wrestling with compiler versions and optimization options.
- An alternative that only matches semantics
- One commenter described agent A writing semantically equivalent code plus tests, with a harness running both in an emulator.
- The harness requires identical RAM read/write sequences and full line and branch coverage of the original; they said it's robust for games and much faster.
- Model choice made a big cost difference, per one user
- One user said several Sonnet agents ran for weeks, spent about $1000, and reached 20% with poor output.
- With Sol 6.1 the same task finished in about 2 days for about $50 without supervision.
- Another view was that Opus has too many safeguards for reverse engineering.
- One agent might have been enough, one commenter argued
- They said they used to over-orchestrate and now use a single agent for better control of output.
How to Apply
- Attach a PASS/FAIL check to agent work
- Today, pick one agent task and define one machine-judged command such as tests, snapshots or a typecheck.
- Write in the agent's instructions that the task is done only if that command passes before pushing.
- Protect the check from tampering in CI
- Store a hash of the verification script and test files as a CI secret.
- Fail CI on mismatch so agents can't edit the criteria.
- Re-inject the instruction doc periodically
- Put the goal, prohibitions and edge cases into one document.
- Use cron or similar to make agents reread it hourly.
- Tell reviewer agents to ignore worker justifications
- In the review prompt, say not to rely on commit messages or code comments and to verify directly with the original or tests.
Try It
# Paste into Claude Code or your agent instruction file (e.g. CLAUDE.md). Simplified version of the article's method: the oracle and instruction-refresh ideas turned into a prompt
## Work rules
Goal: {{task goal}}
A task is done only when the command below passes. My own judgment or explanations do not count as evidence.
Verification command: {{e.g. npm test && npm run typecheck}}
Forbidden:
- Editing the verification script or test files to make them pass
- {{e.g. hardcoded test outputs, inline assembly, other workarounds}}
- Closing an issue or moving on before verification
Procedure: finish one item at a time, then run the verification command; if it fails, fix the cause yourself.
Do not make architectural changes; if you think one is needed, write the reason, stop and ask.
This document is reread every hour. Each time, check yourself against the rules above.
Next to try: add to the reviewer agent's prompt: 'Do not rely on the worker's comments or commit explanations; verify with the command directly.'Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.