Skip to content

Grading coding agents without trusting them.

SecureBench applies privilege separation to coding-agent benchmarks. Its design, split verification, separates running a task’s tests from judging their results, so the expected answers and the verdict stay outside everything the agent’s work can control. It is the first framework in the scientific literature for evaluating coding agents to make this separation.

Today, the agent can reach everything its grade depends on.

In most benchmarks the tests run where the agent worked. Once its code runs, it can read the expected answers, edit the tests or forge the report. BenchJack reached near-perfect scores on nine of ten popular agent benchmarks without solving their tasks, and ImpossibleBench finds that frontier models modify tests that contradict the task. Agents already do this unprompted, as OpenAI’s July 2026 Hugging Face incident showed.

See the attacks the paper cites

Grading in most existing benchmarks: task, agent, solution, tests, report, score. The agent controls the environment that holds the tests, the answers and the report, so it can read the answers, edit the tests and forge the report.TaskAgentSolutionTestsReportScoreAnswersforges the reportedits the testsreads the answershow grading is meant to flowwhat the agent can do instead
Grading in most existing benchmarks. The shaded area is the environment the agent controls.

SecureBench moves the answers and the verdict out of the agent’s reach.

Asset
Common practicegraded where the agent worked
SecureBenchtrusted grader, untrusted tests
varies by task

Disclosure of evaluation informationA model inspected the Python call stack to retrieve the answer the scorer had already computed (METR).

with the Oracle

Stopped by G1 Mutual isolation

from the tests

Forged observationsIn SWE-bench, a conftest.py hook can overwrite each test’s reported outcome (BenchJack).

by the Oracle

Stopped by G2 Verdict integrity

shared state

Cross-case interferenceFound in our study: in Terminal-Bench’s polyglot-c-py, the Python side can replace the compiled binary with one that prints the expected answer.

isolated

Stopped by G3 Test case isolation

varies by task

Access-policy misuseIn evaluations that CAISI reviewed, agents searched the internet for walkthroughs and answers (CAISI).

allowlist only

Stopped by G4 Access control

How tasks are graded: common practice today and SecureBench. Each row opens to show a real attack and the security goal that stops it.

Four security goals, each met by one part of the design.

Each goal answers a class of known attack. Together they hold even when the agent’s code takes over the environment that runs the tests.

  1. G1Mutual isolation

    The agent’s work reaches the grader through one defined channel, and nothing else passes between them.

  2. G2Verdict integrity

    Only the grader decides whether an attempt passes. A forged success report cannot produce a pass.

  3. G3Test case isolation

    Each test case runs on its own, so one case cannot affect another.

  4. G4Access control

    The agent reaches only the resources the task’s policy allows.

Each part of grading runs with only the access it needs.

The agent works in its own environment. SecureBench then captures the files it changed, the candidate, and runs each test case in a fresh Evaluation environment. There an adapter runs the candidate and reports what came out. Only the Oracle, on the trusted host, holds the expected answers and issues the verdict.

Read the architecture

Scroll sideways to see the whole figure.

UntrustedTrustedOutside
Agent environment
Harness
Claude Code, Codex
Workspace
the agent’s files
Evaluation environment
a fresh sandbox for each case
Capture
changed files
Replay
baseline + candidate
Collect
output files
Provider relay
adds credentials
Egress proxy
filters web traffic
Candidate store
the captured files
Oracle
Hidden data
only the Oracle reads it
Validate
parse, check, label
Result store
verdicts, logs
Model provider
Allowed domains
model APIweb trafficcandidatechallengeobservation12345567

Most tasks convert, and a few properties block the rest.

180 of the 202 tasks of Terminal-Bench 2.0 and DeepSWE v1.1 convert: 68 of 89 and 112 of 113. Of the 22 exclusions, 14 need what SecureBench leaves out by design, such as a running service, privileges or a speed target. Agents did the conversion at a median cost of about $10 per task. Of the 429 attacks run against the conversions, the native graders accepted 230 and SecureBench none.

See the conversion results

What happened to each task

Outcome of conversion, by benchmark
OutcomeTerminal-BenchDeepSWE
Converted68112
Privileges or system paths50
Running process as deliverable30
Deliverable outside any scope20
Speed target40
Pack size40
Machine resources10
Reference fails natively11
Model safeguards10
Triaged89113

Converted tasks grade like the originals.

Two agents attempted every converted task natively and under SecureBench, and both graders judged the files each attempt left. On the same files the graders agree on 98.7% of comparisons, and none of the disagreements is a conversion error. The agents pass almost as many tasks under SecureBench as natively.

See the fidelity results

Fidelity on the converted tasks, both runs
Sonnet 5.5GPT 6.1 Sol
Graders agree on the same files99.4%97.9%
Tasks passed natively, first run121142
Tasks passed under SecureBench, first run118140
Tasks passed natively, second run120142
Tasks passed under SecureBench, second run125134

No adversarial attempt passed through a flaw in SecureBench.

An adversarial agent attacked every converted task, once with a description of the design and once with all the grading code, but never the expected answers. With full knowledge, SecureBench rejected 75% of the completed attempts. Most passes exploit weak tests in the original tasks, and the native grader passes most of those as well. In a smaller campaign on the original tasks, SecureBench rejected 55 of the 71 attacks that pass the native graders.

See the adversarial results

Attacks on the 180 converted tasks
Limited knowledgeFull knowledge
Completed attempts139168
Rejected by SecureBench117126
Passed through a flaw in SecureBench00
Passed through weak upstream tests1433
Other passes89

Every verdict can be re-judged offline.

Each attempt stores the evidence the Oracle judged. With the task pack, a reviewer recomputes every verdict without running anything.

  1. 1

    Re-judge offline

    Every case’s evidence is stored next to the Oracle’s judgment of it, and the judge is deterministic and free of side effects.

  2. 2

    Failures stay failures

    Errors inside an Evaluation environment count against the candidate. A candidate that crashes its adapter fails the case like a wrong answer, so it cannot turn a wrong answer into a missing result.

  3. 3

    Full provenance

    Task, image and Oracle digests, the framework commit, the harness and model, and the worker’s qualification.

  4. 4

    Append-only

    Retries and invalid attempts are recorded, never overwritten. A run index hashes every record, and a root digest closes the run.

Attempt record, abridged

{
"status": "failed",
"failure_class": "case_error",2
"judged": [1
{ "case": 0, "evidence": {…}, "judgment": {…} },
…
],
"candidate": "sha256:…",
"provenance": {3
"task": {…}, "framework": {…},
"agent": {…}, "run": {…}, "worker": "…"
},
"logs": {…}
}

Run index: the sha256 of this record, then a root digest4