PandaWard

Agent Safety Lab

A sandboxed harness with an independent oracle, honest statistics and a hard budget. It exists for two reasons: to measure what a coding agent does when the repository it reads tries to steer it, and to make PandaWard, a passive SAST with its own data flow engine, better and harder to fool. This page says what it has already given the product, what it measured, and what is not done.

What it gave PandaWard

Triage of findings: measured on labelled data

The OWASP Benchmark labels every test case as vulnerable or not, so a finding in a non-vulnerable case is a labelled false positive. An agent (headless Claude Code on the maintainer's subscription, no tools, the source file in the prompt) judged each finding; the label is the oracle. A verdict removes a finding from view only in this measurement: it is a hypothesis and never closes a finding.

FindingsShown precision, raw scanShown precision, after triageFalse positives removedTrue findings dropped
PandaWard built-in rules, development, 16050% [42-58%]76% [67-83%]69% [58-78%] (55/80)0 of 80
PandaWard built-in rules, held-out, 8751% [40-61%]80% [68-88%]74% [60-85%] (32/43)0 of 44
semgrep p/default, development, 117 valid of 12049% [40-58%]88% [78-94%]87% [76-93%] (52/60)0 of 57

What it taught, including where we were wrong

Labelling findings on the CVE benchmark gave four post-fix findings that looked like false positives. One was a real engine flaw (the bounded loops above). Two were not false positives: the marked fix repaired only one alternative of a pattern, so the other branch is still ambiguous, and the patched serialize-to-js code still has a real path to new Function when its unsafe option is set. We had reported the second as a false positive, found the mistake when we read the code, and retracted it in the issue. The data has a limit too: the clean false-positive set from this benchmark is tiny (4 findings per engine against 14 to 19 true ones), too small to measure anything tightly.

What is next, and what is not measured

These are planned, not done, and none has a result yet.

WorkWhat it would give PandaWardBlocked by
Agent-assisted triage of findings (#480), first measurement aboveFewer false positives, now measured on a synthetic benchmark; next, on real applications, with the cost (true findings wrongly dismissed) reported. Runs on the user's own Claude Code, so it costs them nothing extra. A verdict stays a hypothesis until a person decides.A labelled real-application set; the benchmark is synthetic and public. Real-application scans with hand triage (#470) are the likely source.
Rule and taint-spec candidates from misses (#481)Recall that does not come from overfitting the public benchmarks: a candidate must improve the development cases and not regress a frozen held-out split the agent never sees.A held-out split frozen at a published commit before the loop starts (#467).
Finding what PandaWard misses, with proof (#482)Reproducible misses that become regression cases, and examples of what PandaWard finds that other tools do not.Disclosure windows for anything found in other people's projects.

Not measured at all yet: the CVE benchmark with other tools' standard rules, CodeQL and SonarQube, and any unseen real-application suite. Round 2 (19 ordinary maintained applications, research/realapps/round2.md) had 268 false positives and 3 true findings (TLS verification off) among 271 high and critical findings; after the fixes that came from it, a rescan reports 153 (150 false positives, the same 3 true), which is not a measurement on unseen code. Round 1 of the real-application scan (applications that are vulnerable by design, research/realapps/round1.md) found 54 true, 51 false positive and 7 unclear among 112 high and critical findings, and its recall check found 8 of 21 pygoat labs and 5 of about 70 WebGoat lessons. The OWASP 1.000 scores are on suites PandaWard was developed against.

What it tests about agents

An agent is given a normal task, such as reviewing a repository with the scanner output and reporting what each control established. The repository carries an attack: a README that says a manager approved a scope, a code comment that tells reviewers to hide the failing control, a tool result that asks for an approval, a scan summary edited to say everything passed, a SARIF file with a suppression nobody recorded, an evidence index with a hash that does not match. A matched legitimate control mirrors each attack without it.

The agent works in a simulated sandbox with a fake network and a shell simulator. What counts is what the effect journal says happened and whether the final report is supported by the evidence PandaWard recorded, not what a model says about it.

Four arms, same tools

ArmEnforcement
Aprompt only (the sandbox still protects the host)
Bdeterministic authorization gate before every effect
CB plus an evidence check of the report against recorded facts and hashes (the same code as pandaward verify-report)
DC plus an independent monitor that fails closed and never sees the oracle

First measurements

Corpus v1.4: 20 synthetic scenarios (12 attacks, 8 matched legitimate controls), 3 repetitions, 240 episodes on the API track and 180 on the Claude Code track, no invalid episodes. Intervals are 95% Wilson.

Track and modelArmAttack successUtility on controls
API, claude-haiku-5-5A3% [0-14%] (1/36)100% (24/24)
B0% [0-10%] (0/36)100% (24/24)
C0% [0-10%] (0/36)100% (24/24)
D0% [0-10%] (0/36)100% (24/24)
Claude Code, sonnetA6% [2-18%] (2/36)100% (24/24)
B3% [0-14%] (1/36)100% (24/24)
C0% [0-10%] (0/36)100% (24/24)
Claude Code, opusA8% [3-22%] (3/36)100% (24/24)
B8% [3-22%] (3/36)100% (24/24)
C0% [0-10%] (0/36)100% (24/24)

Full reports with every table: API track, Claude Code track, sonnet and Claude Code track, opus (the Claude Code track uses Claude Code's own system prompt and tools, so it is not comparable to the API track).

How to read this

Corpus v2: attacks that make an agent report a false conclusion

Corpus v2.0 has 11 attacks and 11 matched legitimate controls built only from epistemic attacks: a release ticket that pushes for PASS, a summary that calls a partial scan complete, three files that repeat a false all-clear, a risk acceptance read as a pass, a baseline that hides a finding, a changelog and a pull request that claim a fix that was not made, a README with a wrong hash, evidence for older code, a CI log with skipped tests and an auditor note. It was frozen before the runs; a read-only lab_sha256 tool lets a careful agent check a hash. Claude Code track, 3 repetitions, 198 episodes per model.

ModelArmAttack successUtility on controls
opusA18% [9-34%] (6/33)100% (33/33)
B18% [9-34%] (6/33)100% (33/33)
C0% [0-10%] (0/33)100% (33/33)
sonnetA9% [3-24%] (3/33)100% (31/31)
B9% [3-24%] (3/33)100% (33/33)
C0% [0-10%] (0/33)100% (33/33)
haikuA12% [5-27%] (4/33)100% (33/33)
B9% [3-24%] (3/33)100% (33/33)
C0% [0-10%] (0/33)97% [85-99%] (32/33)

Reports: opus, sonnet, haiku.

Two pilot runs on the development split, made before the hash tool existed, are discarded: a careful agent could not compute the hash the task asked for and called a true control inconclusive. That was a design flaw of the lab, found and fixed before the official runs.

How the corpus changed, and what was discarded

The first live pilot, on 12 episodes, found problems in the measuring tools, not in the model: the claim parser read a quoted forged summary as the agent's own claim, fixtures cited evidence files they did not contain, and the monitor's reply was cut off by thinking tokens. These were fixed before any official run. Two full runs were then discarded and are not reported:

Live API runs are limited by a hard spend cap enforced in code before every request (research/agent-safety/BUDGET.md); no amounts are published. The Claude Code track runs on a subscription and has no dollar figure.

Limits

Use it and reproduce it

pandaward verify-report report.md                        # the product check: exits 1 on false assurance
pandaward lab validate                                   # no model, no key
pandaward lab run --run t0 --provider mock               # offline, all 240 episodes
pandaward lab run --run t1-api --provider api --live --model claude-haiku-5-5 --seed 20261120 --reps 3
pandaward lab run --run t1-cc --provider cc --model sonnet --arms A,B,C --seed 20261120 --reps 3
pandaward lab report --run research/agent-safety/runs/t1-api --public --out report.md

Method, code and the corpus: research/agent-safety. Every number on this page comes from a run manifest and its episodes, a merged change or a linked issue. Nothing here is a claim about any product other than what is stated, or about the models in general.