Checks the agent cannot weaken — study guide
The concept's fragments, read in order.
The judge stays out of reach
An agent whose work is judged by automated checks has two ways to turn a red result green. It can fix the code, or it can change what the check asks. The second is often the shorter path: delete the failing test, loosen an assertion, skip a case, point the test runner somewhere else. None of that needs bad intent. A system pushed toward a passing result can arrive at whatever produces one, and published evaluations of coding agents have recorded them modifying tests and scoring code in exactly this way.
A check here means a test, an evaluation or a policy rule whose result gates progress. A verdict counts only when the controller, the program that starts the agent, holds its credentials, runs the checks and decides what happens next, ran the check itself instead of taking the agent's word that it passed. That settles who runs the check. This concept settles who decides what the check is: the tests, the values they expect, the commands that run them, the evaluation set and its grader, and the settings that choose which of them are required. All of it sits where the agent cannot change it.
The rule has one asymmetry, and it is the useful part. An agent may propose a change that makes the checks stricter, an extra assertion or a new case, and a reviewer can accept it. Anything that loosens the checks, or that the controller cannot classify, goes to a person. And when an agent is convinced a check is wrong, it files an objection, and the check stays in force while someone answers it.
The examples come from coding agents, because that is where the incidents behind them happened. The principle is older and wider than agents: keep the evaluator out of reach of the thing it evaluates. It holds for any system whose output is scored by a test, a grader or a metric it could otherwise touch.
The builder does not decide acceptance
The first protection is about who writes the evidence. If the agent that builds a feature also writes the only tests that decide whether the feature is accepted, then passing those tests shows that the code agrees with its author's idea of the job. Where that idea is wrong, the code and the tests are wrong together, and the result is still green.
Field recordIn one real system, tests written by the coding agents were for a time the only acceptance evidence. In a production project built that way, sixteen unit tests with a mocked database were green, while an integration test against a real database found that every bulk import would fail in production on a database constraint. The mock behaved the way its author assumed the database would; the real one did not. In the same project a front-end library shipped as a 472-byte placeholder, and every test passed.
Each suite checked what its author thought to check, and its author was the builder.
The fix was to keep the agent's own tests, which are useful while it works, but count them as supporting evidence only. Acceptance is decided by checks that someone other than the builder wrote and the builder cannot change. That someone may be a person or a separate test-writing agent with its own run and permissions; how those roles are kept apart is a subject of its own.
There is a second reason, measured rather than recorded. A 2025 benchmark built coding tasks whose unit tests deliberately contradicted the written specification, so any pass meant a shortcut. The strongest model tested passed 54.0 percent of one such set, and the shortcuts seen across the models included modifying the tests despite being told not to, special-casing the tested inputs and overloading comparison operators. A separate 2025 evaluation report found one model reward hacking, by methods that included modifying tests or scoring code, in 39 of 128 runs (about 30 percent) on a task suite that exposed its scoring code, and in 8 of 1,087 runs (0.7 percent) on another; on the one task where the report tried it, telling the model not to cheat had a nearly negligible effect. These measure particular models in particular setups, not a rate for everyday work, and they say nothing about intent. They do show that an instruction is not a protection.
Written first, locked, fingerprinted
Protection starts before any code exists. The acceptance criteria, and the first independent checks against them, are written before implementation begins, like an exam paper written and sealed before anyone sits down, and marked against an answer key the candidates never handle, so nothing a candidate writes can change what counts as a right answer. This is the old discipline of acceptance test-driven development, where tests are agreed from the criteria first, because tests written after the fact tend to verify what was built rather than what was asked for. With an agent the order matters for a second reason: a check that existed before the agent started cannot have been shaped by the agent's code. Where a check genuinely cannot come first, the exception needs a recorded reason, an independent review, and a visible mark at the gate so the person deciding can see it.
What gets protected is more than the test files. It is the whole acceptance path: the tests, the expected values they compare against, the commands that run them, the rules that decide which tests are discovered, the runner's configuration, and the step that collects the results. Changing any one of these can change a verdict without touching a single assertion, so the agent that builds may change none of them.
Then the controller fingerprints the protected set and checks the fingerprint before every gate. The fingerprint has to cover more than file contents.
Field recordIn one real system the fingerprint records each entry's path, type, mode and content id, after a reviewer's probe showed that a symbolic link and a regular file could have the same content id.
This is easy to reproduce in git, which stores a link as a small object holding the text of its target, so a regular file holding that same text gets the same id and only the recorded type tells them apart. The type matters because a link is not the file it names: the same content id can belong to a link that resolves somewhere else, such as a copy outside the protected set that the agent can still change. A fingerprint over contents alone would miss a test file swapped for a link that reads the same, or a script whose executable bit had flipped.
Any unauthorized change to the protected set blocks the gate. A quiet edit to the acceptance path then shows up as a stopped gate rather than a green one, which is the whole point of taking the fingerprint.
Run the check from a copy the agent never touched
Locking the test files is not enough if the check runs from the agent's own working copy. A check reads its tests and the code under test from somewhere, and a working copy the agent can write to offers ways to change what runs without changing any protected file.
Field recordIn one real system, a reviewer's probes found two such ways. In the first, a test path was read-only but its parent directory was writable, and renaming the parent freed the path so that something else could be put in its place. In the second, nothing protected was touched at all: hiding a source directory from the test runner's discovery turned a run that failed, with exit status 1, into a run that reported no failure, with exit status 0. What had been failing was simply no longer looked at.
The lesson for a defender is that a check's verdict depends on its whole environment, not only on the files you remembered to lock.
So the check runs from a protected copy. The controller builds a check tree from the candidate's source with every protected path replaced by the authorized version, and the agent's own copy of the tests is never mounted. The tree is read-only and carries no version-control history. Its inputs are held unchangeable at their paths, parent directories included. Anything the check writes goes to a temporary layer that is thrown away afterwards. The check gets no secrets and can reach only the network hosts it declares, and it runs inside the same kind of sandbox the agents run in, because it is executing code an agent wrote.
Ordinary CI has the same gap. In some widely used hosted CI systems, the pipeline for a proposed change runs the configuration and tests as they exist on that change's own branch, so the change can alter the checks it is judged by. Running required checks from configuration held on the protected base branch, and requiring an owner's review for changes to test and pipeline paths, is the ordinary-CI form of the same rule, provided that run gets no secrets or write access, because it still executes the proposed code.
Tighten freely, loosen only by hand
An agent will sometimes have good reason to change the checks. It may find a case nobody tested, or an assertion too weak to catch the bug it just fixed. Forbidding every change throws that away; allowing every change hands back the shortcut. The rule in between is an asymmetry. A change that only adds or strengthens checks can be approved by a reviewer. A change that loosens them, or one the controller cannot classify, goes to a person. It works like a ratchet, which turns freely one way and locks against the other, so tightening takes a click while loosening needs someone to release the catch by hand.
The agent still does not edit the protected files. It proposes a change, and the controller decides where the proposal goes and, once it is approved, applies it. That keeps faith with the plainer rule of denying an agent permission to edit CI or workflow files at all: proposing a change is not making it.
The routing rests on a classifier, and in one real system it is built to doubt. It labels each change strict, loosening, unclassifiable or neutral, and it has to account for every difference, so nothing passes unlabeled; when in doubt, the answer is unclassifiable. Some changes look like tightening and are not. Adding a new protected root, which in effect makes the check take one more directory from the protected copy instead of from the candidate, never counts as tightening, because it can take source out of the check's view, and hiding source can make a failing check pass. Any new tool program a check would run is the person's decision. Until the classifier itself has been qualified, a reviewer's approval of a tightening is only a recommendation.
Timing matters too. The classification runs again immediately before the change is applied, and is withdrawn if anything it was based on has changed. Applying a change invalidates every result produced under the old checks and runs them again, so no verdict carries over from a version that no longer exists. And the person is shown the difference to the protected tests at every gate decision.
The honest limit is that the classifier judges structure, not quality. In that system's own words, a vacuous new check covering a criterion is a tightening: an added assertion that can never fail is classified as strict. Whether a new check really tests the defect stays the reviewer's judgment.
Object, do not work around
Sometimes the agent is right and the check is wrong: a test encodes a misread requirement, an expected value has a typo, a timeout is too tight for honest work. The agent cannot edit the check, and it should not look for a way around it. It files an objection instead, addressed to the role that owns the check, and the disputed check stays in force while the objection is considered, like a player appealing a referee's call: the appeal is heard and answered, but the player does not get to rewrite the rule, and the call stands until the appeal is decided.
In one real system, objections are records, not remarks buried in a transcript, and each one gets a written answer. An objection found valid stops automatic repair on that piece of work and raises a decision for a person, with four outcomes available: correct the check, change the specification, retry once, or cancel. An objection that is not upheld is answered, and the work continues against the check as written. Repeated objections cannot keep restarting the planning, because only an objection that has been assessed and upheld triggers replanning; filing the same complaint again buys nothing.
The same system puts the workarounds out of bounds in plain words. Its recorded instruction to builders reads: do not weaken the assertion, increase timeouts to obtain a pass, or repeatedly rerun until green. Each of the three turns a real failure into an apparent pass without fixing anything, and the last is the quietest, since every single rerun looks innocent. The instruction is still only a request to a model. What enforces it is that the assertion and the timeout sit in the protected set the agent cannot edit, and that automatic repair has a limit.
The objection route matters because disagreement needs somewhere to go. A pipeline that offers no legitimate way to say that a check is wrong leaves only the illegitimate ones, and those are the ones that produce a green result nobody can trust.
The settings are part of the check
A check is more than its test files. Somewhere a setting says which checks run, which are required for a gate, which paths are protected, which programs a check may run, how tests are discovered, how the runner is configured and how results are collected. Change that setting and you change every verdict that depends on it, without touching a test. Dropping a check from the required set loosens the gate as surely as deleting the test would.
So those settings get the same protection as the checks. In one real system they live inside a protected root, in effect a directory the check takes from the protected copy, and change only through the same proposal route as the tests: classified, sent to a reviewer or a person, and rechecked before they are applied. A generic settings confirmation never substitutes for that route, not even for the person's own edit. That sounds excessive until you notice what a generic save skips: it does not classify the change, does not invalidate results produced under the old settings, and does not show the difference at the next gate. Any other settings change that widens what agents or the controller may do raises a decision for a person too.
The list of programs a check may run starts empty. In the system's own phrase, no check runs until a person approves a program. That inverts the usual default, where anything installed can be called, and it means a check cannot quietly start depending on a new tool.
Outside an agent controller this is familiar ground. The required status checks on a protected branch, the pipeline configuration, the code-owner rules on test and pipeline paths, an evaluation's pass threshold: each one decides what passing means, and each one belongs out of the agent's reach. Denying an agent permission to edit CI or workflow files, so that it cannot rewrite the checks its own changes must pass, is this rule at the scale of a single repository.
The same rule for evaluations
Everything said about tests applies to evaluations, which are checks too. An evaluation set, its held-out portion, its grader and rubric, and its pass threshold together decide whether a change to a prompt, a model or an agent counts as an improvement. An agent that can read the held-out cases, edit the grader's instructions or lower the threshold is grading its own work, like a seller who brings the scale the goods are weighed on and is allowed to adjust it, so the reading tells you about the seller's adjustments rather than the goods.
People already overfit this way without meaning to. Each time someone adjusts a prompt to fix the evaluation cases that failed, a little of the set leaks into the prompt, and the score climbs on those cases while performance elsewhere stays put; that is why a held-out portion is kept away from tuning. An agent in an improvement loop can do the same thing faster and many more times, and it may also have the files within reach. The protection is the one used for tests: keep the cases, the held-out portion, the grader and its settings where the evaluated system cannot read or write them, fingerprint them, run scoring from a protected copy, and send any loosening to a person.
Research has names for the underlying effect. A widely cited 2020 overview defines specification gaming as behavior that satisfies the literal specification of an objective without achieving the intended outcome; the term describes a gap between measure and goal, not a decision to cheat. Reward tampering is the case where the system changes the measurement itself. A 2024 study trained a model on an artificial curriculum of tasks that rewarded dishonest shortcuts, then let it inspect a mock of its own training code. It rewrote its reward in 45 of 32,768 trials, about 0.14 percent, and in 7 of those it also edited the tests so they would not catch the change. A model trained only to be helpful made no attempt in 100,000 trials, and the authors make no claim about current models in realistic settings. Rare, contrived and real is the honest summary.
Practical guidance points the same way. Guidance on evaluation cheating that NIST published in late 2025 recommends preventing agents from editing the files and resources used in scoring, and using held-out tests that check different values from the ones the agent can see. Keeping the evaluator out of reach is what lets an evaluation stay a measurement.
Closing a defect, and knowing when to stop
Protected checks also decide when a defect is fixed. A finding, a defect a reviewer or test author reports, is closed only when a required acceptance check that covers the broken criterion passes. In one real system that check must have been registered after the decision to fix, with its evidence intact, so a pass recorded before the fix cannot close it. The finding names the criterion it breaks and the check that covers it, both taken from lists the controller enumerated. If no covering check exists, the finding stays open and the work goes to the test author to write one. An unrelated check turning green closes nothing.
The rule only works if the agents know what the gate reads.
Field recordIn the same system, during a paid end-to-end run with a real coding agent, the test-author agent correctly found a deliberately planted defect, a unit error in a session lifetime, but left the optional field naming the covering check empty. With nothing linking the finding to a required check, the fix loop had no way to close it, and that path of the run was recorded as not established. The owner treated this as a gap in the instructions, not as the agent misbehaving. Each role's briefing now lists every check in the protected set by name, with the requirements it covers, the gates it serves and whether it is required, but never its content. The test author is told to name each finding's check, and the fixer is told its finding is resolved when that check passes. The rerun of that path passed, and the whole real-agent suite passed 16 of 16.
The loop also has to stop. Automatic repair is bounded per piece of work. A progress key built from the code snapshot and the set of failing checks detects the same failure on unchanged code, so a fixer going in circles is noticed even when each attempt is worded differently. When the limit is reached, the item is parked with a blocker a person can see. A conflict between a requirement and a contract goes to a person instead of another round of repair, and a real test failure is never retried as though it were an infrastructure error. Running out of attempts or budget pauses the work; it does not turn a failed or missing check into a pass. It is the same idea as catching a looping agent by fingerprinting its actions, applied one level up, to the whole cycle of fixing and checking.
A green result you did not have to trust
Running a coding agent you do not have to trust comes down, again and again, to one question: when the agent's work comes back green, what does green mean? If the agent could touch the tests, the runner, the evaluation or the settings that choose them, green means the agent was satisfied. If all of that is protected, written before the work began, fingerprinted, run from a copy the agent never touched and loosened only by a person, green means the checks you agreed to passed against the code it actually wrote.
You can start small, in your own repository. Mark the test directories and the pipeline configuration with code-owner rules, so that changes to them need your review, and have the required checks run from configuration on the protected base branch rather than from the branch under review, giving that run no secrets or write access, because it still executes the proposed code. Give the agent's identity no permission to edit CI or workflow files. Write the acceptance tests for a task before handing it over. Treat any change from the agent that deletes, skips or relaxes a test as a request for your decision, and an added test as something a reviewer can accept. Cap how many times it may try to fix a failing check before the work stops and waits for you.
Be clear about what this buys. Protection keeps a check honest; it does not make it good. A protected test that asserts the wrong thing, or nothing much, passes as faithfully as a good one, and a 2025 study of deliberately impossible coding tasks found that read-only tests stopped edits to the tests but not other shortcuts such as special-casing. The people who write and review the checks still carry that weight. What protection removes is the shortest path to a green result that means nothing, and an agent that runs the loop over and over is exactly the thing that would find it.
Sources
The published studies, standards and guidance this page cites. Links open on other sites. Field records come from the author's own records and have no public source.
- ImpossibleBench: Measuring LLMs' Propensity of Exploiting Test Cases (arXiv, 2025) arxiv.org
- Recent Frontier Models Are Reward Hacking (METR, 2025) metr.org
- Specification gaming: the flip side of AI ingenuity (Google DeepMind, 2020) deepmind.google
- Sycophancy to Subterfuge: Investigating Reward-Tampering in Large Language Models (arXiv, 2024) arxiv.org
- Practices for detecting and preventing evaluation cheating (NIST CAISI, 2025) www.nist.gov