Why the agent cannot be its own witness
An agent's own screenshots, videos and "done" messages are a report, not proof. So the agent may propose, but something it cannot touch decides what runs, records what happened and signs the record. In every agent product the research reviewed, from Cursor to Grok Bot, the agent records its own media and posts it to the vendor's interface or the pull request (PR) (inference from product documentation).7 Even vendors call this best-effort: a Cursor staff member wrote in March 2026 that it "relies on the agent doing the right thing".8
Self-reported proof fails in six recurring ways, from filming a stale build to the agent re-recording its own visual baseline so the difference disappears.7
The six failure modes, with the evidence for each 6 rows
| Failure mode | What happens | Evidence |
|---|---|---|
| Artifact missing | The recording is never made, or never reaches the PR. | Cursor forum thread on cloud agents not posting screenshots or videos, Feb–Mar 20268 |
| Stale build | The agent films an old bundle, so the video shows yesterday's code. | pstack's example verify skill: "A video against a stale bundle is not evidence"9 |
| Bypassing the user path | The model triggers screen states with JavaScript instead of clicking through the interface. Cognition calls this "cheating". | Cognition, May 202610 |
| Missing transient states | Screenshots taken too early or too late miss short-lived messages such as toasts. | Cognition10 |
| Weakening the gate | Tests are skipped, assertions deleted or thresholds lowered until the run goes green. | Playwright's healer agent may mark a test skipped if it "believes that functionality is broken";36 GitHub's review guidance: "Any change that weakens CI is a blocker. Full stop"11 |
| Accepting its own baseline | The agent re-records the visual baseline, so the difference disappears. | Playwright's --update-snapshots rewrites baselines;12 Chromatic's agent tools (beta, Nov 2026) let an agent accept baseline changes, on its own if allowed37 |
Three design rules follow (inference): the agent writes its claims down before anything runs; it never produces or accepts the evidence of record; and every artifact is bound to the exact build by commit hash (SHA) and file digest.7
The mistake is easy to make: three of the five architecture proposals written for this study let agent-written code run in the same CI job that signed its proof.13 The trust model sets out the evidence classes behind the fix.
Deep dive: how this study's own designs made the same mistake 1 min
Five architecture proposals were written for this study and scored by four judges. Three of them re-ran the agent's claims and signed the result with a cloud key in the same CI job that executed agent-written code, so their proof of record could have been forged by the code it certified. The judges called it the biggest verification difference between the proposals.13
When the winning design was then red-teamed, reviewers found a subtler version and rated it critical: even with the key moved out, agent-written test reporters, setup files and suite choices could still shape what got signed (issue #33). Taking the harness layer from main (06.3) is the fix.3
Two duties, two controls
DORA's change rules contain two separate duties, so the platform meets each with a different control: machines carry the code review, and a person makes the approval. The risk-management standard under the Digital Operational Resilience Act, Commission Delegated Regulation (EU) 2024/1774 (the "RTS"), requires source-code reviews "covering both static and dynamic testing" (Art. 16(3)) and, separately, independence between "the functions that approve changes and the functions responsible for requesting and implementing those changes" (Art. 17(1)(b)).1
Deterministic checks on every change
Static application security testing (sast), software composition analysis (sca, for licences and vulnerabilities), secrets scanning, a software bill of materials (sbom) and executed tests run on every PR and merge group, whoever wrote the code.
A human decision on evidence
An approver who is neither requester nor implementer reads the proof page and records what they examined. SLSA v1.2's top level (Source L4) likewise requires two or more trusted persons, defined as humans, to agree each change.14
- T1
- One area code owner
- T2
- Two humans; one reads the source
- Enforced by
sod/independencecheck
BaFin's guidance on ICT risks in AI use (version of 23 January 2026), the most specific supervisory statement so far, backs the split: "the same rules apply to all types of source code creation, whether by humans or machines", and static code analysis under Art. 16(3) is one way to find unexpected behaviour in generated code.2 Risk tiers set how much proof and approval a change needs; the highest, T2, covers money, identity, keys, CI/CD, and test and agent configuration (09.2).
No supervisor has ruled on this design. A search of Finanstilsynet, BaFin, the European Central Bank (ECB), the European supervisory authorities, the Danish, Swedish and Irish supervisors, the UK's FCA and Singapore's MAS found no statement for or against approval on artifacts by an independent human, or for AI review as the Art. 16(3) review.15 Expect scrutiny anyway: the ECB, which does not supervise the bank but sets the bar auditors bring to Nordic banks (inference), plans "an extension of the 2026 targeted review of ICT change management" in its 2027-29 priorities.16 Two fall-backs are ready: a human already reads the source of every T2 change, and if internal audit rejects the bank's segregation check, requesters can open PRs themselves from a pre-filled compare link ("option E").3
Write into the software development life-cycle (SDLC) policy that sast, sca, secrets, sbom and executed tests on every PR and merge group are the Art. 16(3)/16(4) control, owned by the verification-and-evidence role. Record AI review as supplementary until the bake-off has measured its recall.3,15
The proof chain: many hands, one key
The chain splits proof into steps that no single party controls, and only one of them can sign. The agent proposes claims, policy on main chooses the tests, verify-run executes them with nothing worth stealing, verify-seal records the results without running PR code, and a notary, the only key holder, signs the record into write-once storage.3
Three properties carry the design. verify-run takes the harness layer, the files that decide how checks run, from main, so a PR cannot change how its own tests run. Black-box suites reach the code only over the network, from a second VM. And the notary re-checks every hash before signing a DSSE statement (Dead Simple Signing Envelope, a standard format for signed claims) that S3 Object Lock keeps write-once.3,17
Deep dive: the eight steps of the chain, one by one 3 min
What each step checks, refuses and records, from the agent's plan to the human merge.
- The agent states its claims first. Before coding, it writes
proof/plan.yaml: each claim, the evidence type it needs and, optionally, a script to check it. It may add claims; it cannot choose the suites or the change type. A Stop hook refuses to end the session without a plan and green fast checks. Its own media, summary and.audit/decision trail are labelledtrusted: false. - A broker publishes the work. A git broker with no language model checks path, mode, size, symlink and URL rules, recreates the commits as
impl[bot], confirms the tree hash matches the bundle and opens a draft PR. It refuses changes to the harness, policy and CI paths (see Repo, builds & context). - Policy chooses the tests. Required suites, change type and evidence types come from
review-tiers.ymlandservices.yamlon the base branch, keyed on the changed paths. verify-runexecutes, with nothing worth stealing. It checks out the head commit but takes the harness layer (./x,.moon/, task definitions, runner configs, reporters, setup files such asconftest.py, and verify skills) frommain. It runs the required suites, records media and traces, and runs the scanners. Black-box suites (Playwright for UI, Hurl for HTTP, Pact contracts, scenarios) run in a second VM that reaches the code under test only over the network. Reports go where PR code cannot write. A PR that changes the harness layer is T2, and its own harness runs for information only.verify-sealrecords but never executes. On a runner pool that runs onlymain's workflows, it parses reports as data, with strict parsers and size limits, and builds the manifest: a verdict per claim with its provenance (human-owned suite or agent script), plus the fall-back plan and security-impact note that RTS Art. 17 asks for. It posts the GitHub checks.- The notary signs. About 500 lines of bank code in the evidence account re-check the artifact hashes, the machine image (AMI), the workflow, the harness tree hash and the head of the model gateway's hash chain, which witnesses every model exchange. Only then does it sign a DSSE statement (Dead Simple Signing Envelope, a standard format for signed claims) over the manifest, the requester binding, the harness tree hash and the chain head.
- The record is locked. S3 Object Lock keeps it write-once. In compliance mode nobody, root included, can delete a locked version or shorten its retention; governance mode allows a tightly held bypass.17 A replica sits in a separately administered account in Frankfurt (eu-central-1).
- People decide. The coordinator posts per-claim verdicts and a link to the proof page back to the Slack thread (Chat coordinator & agents). The requester marks the PR Ready, approvers attest,
sod/independenceconfirms they are independent of requester and implementer, a human enqueues the merge, and the merge group re-runs the scanners.3
Who produces each artifact in a proof bundle 7 rows
| Artifact | Producer | Status |
|---|---|---|
proof/plan.yaml: claims and scripts | Agent | May add claims; cannot choose suites or change type |
| Required suites, change type, evidence types | Base-branch review-tiers.yml and services.yaml, from the changed paths | Input |
Agent media, summary, .audit/ trail | Agent | trusted: false |
| Suites, media, traces, scanner results, SBOM | verify-run with main's harness | Candidate evidence |
| Manifest: verdicts with provenance; fall-back plan; security-impact note | verify-seal | A gap never passes; on T2 a claim verified only by an agent script is a gap |
| DSSE signature over manifest, requester binding, harness tree hash, gateway chain head | Notary | Proof of record |
| Visual baselines, attestations, approval | Humans | Approval |
Every claim ends in one of four verdicts, a deliberately closed vocabulary; as pstack's swarm skill puts it, "A gap does not count as a pass".18
| Verdict | Meaning | Effect |
|---|---|---|
| verified | The required evidence ran under main's harness and supports the claim | Counts as a pass |
| failed | The evidence ran and contradicts the claim | Check fails; the agent gets at most two red-CI rounds |
| not-run | The evidence was expected but not produced in this run | Shown as untested, in red |
| gap | No qualifying evidence exists: the surface is not built yet, or on T2 only an agent-written script backs the claim | Never counts as a pass; shown in red for the approver |
Deep dive: the agent's plan and the sealed manifest for the running example 2 min
PR #214, a card spending-limit screen behind a flag, as the agent plans it before coding and as verify-seal records one of its claims.
# Agents may add claims. Required suites come from policy/review-tiers.yml
# and services.yaml on the base branch, keyed on the changed paths.
# Changed paths: apps/web only, so the tier is T1.
task: ISSUE-12
claims:
- id: c1
statement: "Limit saves through the existing card-controls API"
evidence: api-sync
script: apps/web/proof/card-limit-api.hurl
- id: c2
statement: "Card screen shows the limit and the remaining amount"
evidence: ui-web
script: apps/web/proof/card-limit.spec.ts
- id: c3
statement: "Empty or non-positive amounts show an inline error"
evidence: ui-web
script: apps/web/proof/limit-input.property.test.ts
- id: c4
statement: "Works on Android"
evidence: ui-mobile # no surface until month 4: verdict gap
{
"claim": "c1",
"verdict": "verified",
"provenance": "human-owned-suite",
"suite": "api/card-limits.hurl",
"producer": "verify-run",
"head_sha": "9c1e4a7…",
"harness_tree": "main:3f0b2d1…",
"artifacts": [
{ "path": "api/card-limits.transcript.html", "sha256": "5be1…" }
]
}
gap. A complete bundle, real but built on synthetic data, is in Proof bundle demo.What the chain proves, and what it cannot
The chain proves where and how the tests ran, not that the tests are good, and that limit decides where human effort goes (inference).3
What it proves
- Suites chosen by
main's rules ran undermain's harness, at this commit, on an allowlisted image. - Reports were written where PR code could not write.
- Nothing changed afterwards: hashes, harness tree and the model-exchange chain all match at signing.
What it cannot prove
- That code under test behaves the same when it is not being tested.
- That agent-written unit tests mean anything: they share a process with the code they test.
- That the claims were the right claims for the request.
So claims of record rest on evidence the agent did not write: human-owned suites, invariants and black-box scenarios. Red/green runs make a new test fail on the base commit before it counts; mutation sampling on T2 diffs breaks the changed code to see whether the tests notice; and a banned-API pack rejects test-environment detection (navigator.webdriver, process.env.CI, Playwright and Maestro markers) in non-test code (05.4).3
Nor can agents weaken the checks. The harness layer, specifications, invariants, golden files and thresholds sit behind four locks (02.5), and every new check must be seen failing first: "A check that you have never seen fail proves nothing".3,20
Proof by change type
Each of ten change types has a proof standard in three layers: a proof of record from verify-run, a deterministic gate that decides pass or fail, and a human aid for the reviewer. A web UI change, for example, is proved by a Playwright screencast and trace, stamped screenshots, an aria diff and an axe accessibility report; money code by property tests against invariants (06.6). Every type also runs sast, sca, secrets, sbom and the provenance licence-snippet scan.3
Proof of record, gate and human aid for all ten change types 10 rows
| Change type | Proof of record (verify-run) | Deterministic gate | Human aid |
|---|---|---|---|
| UI web | Playwright screencast; trace; base and head screenshots stamped with SHA and "TEST DATA"; aria diff; axe accessibility report; no console errors | Assertions and aria snapshots; visual baselines accepted by a code owner | Agent video, marked untrusted |
| Mobile | Maestro flows plus a native UI test; MP4; screenshots; Paparazzi or Roborazzi snapshots. Android from month 4 | Flow assertions | Real device before release |
| API | oasdiff or buf breaking; Hurl transcript; Pact can-i-deploy; AsyncAPI diff | No unapproved breaking change | hurl --curl replay |
| Multi-service | ./x stack up slice: image digests, scenario, OpenTelemetry (OTLP) trace, fake journals, UI video | Scenario assertions, with twin fidelity labels | Trace viewer |
| Ledger and money | Property and stateful tests against the reference model and invariants; journal replay diff. T2 adds red/green, diff-scoped mutation and a formal check where a spec exists | Invariants hold; every diff line explained. Fraud, credit and screening model or rule changes also need the model owner or second line | Decision-table diff |
| Regulatory reporting | Output diff on synthetic data; schema validation; golden xBRL-CSV files | The diff matches the claims | Reporting owner |
| Database migration | Squawk lint; dry run; lock estimate; rollback or fall-back plan | No destructive operation without an approved exception | Migration plan |
| Infrastructure as code (T2) | Plan; Conftest/OPA policy; IAM Access Analyzer; egress-probe delta | No widening without approval | Plan diff |
| Agent configuration (T2) | claude plugin eval three times; golden-task delta; prompt-injection suite | pass^3 not worse; zero canary egress; cost at most +10% | Changelog |
| Docs and research | Link and citation check; dated sources | None | Rendered document |
Two tools close specific holes. Allure 3's --expect-tests catches suites that silently did not run.19 Video comes from Playwright's page.screencast (v1.59, 1 April 2026), which adds chapters and action overlays and which Playwright markets as "agentic video receipts".21
Gate on text, show pixels to humans
Text decides; pixels explain. Playwright warns that screenshot comparisons only hold "in the same environment where the baseline screenshots were generated",12 while aria snapshots, YAML descriptions of the page's accessibility tree, hold across browsers.4 So assertions and aria snapshots gate the merge, video and screenshots help a person see what changed, and only a human code owner, never an agent, may accept a new visual baseline.
verify-run, sealed and signed. Synthetic demo with invented data; full bundle in Proof bundle demo.Surfaces arrive in phases
Each surface is a ./x verify <surface> command that agents and CI call the same way. Until a surface exists, its change types use the base gates (scanners, tests, plan or schema checks), and any claim it would prove is a gap, never a silent pass (inference).3
- Web UI
ui-web: Playwright journeys, video, trace, aria snapshots.Weeks 0-4 - API and money logic
api-syncand the platform's referencemoney-logicmodule.Weeks 5-8 - Android, migrations, multi-service
ui-mobile(Android),db-migrationandservice-behaviourwith./x stack up.Month 4 - iOSThe iOS lane, on Mac capacity in Frankfurt.When iOS work starts
Multi-service scenarios run against squad-owned fakes; where no real sandbox exists, as for NICS/straks instant payments, they are labelled "twin-only, fidelity unproven" (04.5).3 Roadmap has the dates.
Money code: invariants first
For ledger and payment code the proof is not a video but a set of invariants that humans write and agents may use but never edit. As Datadog, which built a streaming engine mostly with agents, put it: "What the reviewer reads is not the diff but the harness output."22
Ten invariants, from balanced entries to a daily three-way reconciliation, each become a property test now, a simulation assertion later and a reconciliation query in production. The catalogue is the research team's synthesis (inference), grounded in TigerBeetle's and Stripe's published ledger designs.23,24,25
The ten ledger invariants and what each must guarantee 10 rows
| # | Invariant | What must always hold |
|---|---|---|
| 1 | Balanced entries | Every journal entry's debits equal its credits, per currency and ledger |
| 2 | Conservation | The signed sum of all accounts in a ledger is zero in every committed state |
| 3 | Immutability | Posted entries never change; corrections are reversing entries |
| 4 | Projection equals replay | A stored balance equals the sum of its entries at any as-of time, by value date and booking date |
| 5 | Balance constraints | A customer account cannot go negative unless a credit facility exists |
| 6 | Integer minor units | Amounts are whole øre or cents at a fixed scale; no floating point |
| 7 | Hold lifecycle | Capture ≤ authorised (plus scheme tolerance), refund ≤ captured, and each hold is released exactly once |
| 8 | Clearing accounts drain | Intermediate clearing accounts return to zero at steady state |
| 9 | Completeness | Every upstream event (vendor core, card processor, payment rail) has a ledger event |
| 10 | Three-way reconciliation | Ledger, vendor core balances and settlement files agree every day, and every difference is classified |
A money change runs property-based and stateful tests against the reference model, plus a journal replay diff of base and head on the same golden scenarios; T2 adds red/green runs, diff-scoped mutation testing and a formal check where a specification exists. Fraud, credit and sanctions-screening model or rule changes also need the model owner or second line to approve.3
Formal methods only when tied to the code
A specification counts only after it has failed on a broken variant and passed validation against real execution traces, and CI rejects the proof escape hatches sorry, admit, axiom and assume (inference).25 Trace-validated specs found 62 bugs on five systems where Claude Code baselines found 2-3; top models' raw TLA+ specs averaged only about 46% conformance with the real systems.26,27
Deep dive: what the research shows about agents and formal methods 1 min
Model-written specs tend to describe the textbook protocol rather than the implementation.26 Specula's gains came from validating specs against real execution traces.27 Machine-checked proofs remain expensive, at "two orders of magnitude" more than the implementation by Tweag's estimate, and agents cheat at them by changing the specification or assuming lemmas as axioms.28
Who writes the model
Domain leads write the real ledger reference model, the ten invariants and golden xBRL-CSV regulatory report files with the ledger; until then, a platform-owned reference money-logic module stands in at gate W-tech (weeks 12-13).3 So money squads put 25-35% of their capacity into verification for six months (Operating model & team). One gap is open: Arelle, the open-source XBRL validator, has a European Banking Authority (EBA) plugin whose configuration describes "EBA Filing Rules, COREP and FINREP v2", while the current rules are v5.7; whether it enforces them on xBRL-CSV is unverified.29,30
A test library that talks to agents. Since version 1.10 (May 2026), jqwik, a Java property-testing library in "pure maintenance mode" since July 2025, prints on every run a message telling AI agents not to use it and to ignore its results.31 Tool output that instructs agents is shaped like prompt injection, so jqwik is banned; the JVM uses kotest-property instead.25
How reviewers see it
The proof page shows the riskiest things first, never lets anything the PR produced run in the reviewer's session, and makes the approver record what they actually looked at.3
"our code review process has now really shrunk into looking at verification artifacts instead. So things like videos, screenshots, diagrams, formal verification."
The bank stops short of Tan's endpoint, where "you can just let agents merge most of their own pull requests":32 an independent human approves every change.
Nothing from the PR runs in the reviewer's session
A trusted renderer draws verdicts from the signed manifest only. Everything derived from the PR (the agent's summary, Allure reports, traces, SVG files and media) comes from a separate, cookieless sandbox origin under a strict Content Security Policy (CSP), closing a rendering hole the red team had rated critical (#35).3
Deep dive: how the sandbox origin is locked down 1 min
The sandbox origin's CSP is default-src 'none', media and connections are limited to that origin, and scripts come only from hash-pinned viewer bundles built from main. Trace viewers need scripts, so that last allowance is an inference still to be tested. The agent's HTML summary is converted to sanitised markdown, PR bodies are built from structured fields, and Slack does not unfurl agent links.3
A fixed reading order
The page is read in a fixed order, shown in the mockup below: instruction-file and harness diffs first, because they change how every later agent behaves; then the verbatim request beside the bot's restatement, to check that the agent solved the problem asked; the agent's summary and the diff last.3
Read first
- Instruction-file diffsnone
- Harness-layer diffsnone
Request and restatement
"@agent implement: card spending limit screen per ISSUE-12"
Restated: behind a flag, the cardholder sets a monthly limit in card settings and the screen shows what remains. The limit is saved through the existing card-controls API, which this change does not modify.
Claims and verdicts
- Limit saves through the existing card-controls APIverified · human-owned suite api/card-limits.hurl
- Card screen shows the limit and the remaining amountverified · aria snapshot
- Empty or non-positive amounts show an inline errorverified · property test, 1,000 cases
- Works on Androidgap · Android surface from month 4
Open risks
- Limit currency assumed NOKraised by the agent
Scanners
- sast0 new
- sca0 high
- secrets0
- SBOMattached
Artifacts
Side effects
- Networkcard-controls API only
- Database writescard_limits table, via the API
- Filesnone outside the run
Blast radius
- 2 of 5web card screen, behind a flag; card-controls unchanged
AI review findings
- 2 findings, both resolvedsupplementary · none reproduced
The full reading order, all twelve items 12 items
- Instruction-file and harness diffs, because they change how every later agent behaves.
- The verbatim request beside the bot's restatement: did the agent solve the problem that was asked?
- Claims and verdicts, each with its provenance.
- Untested claims, in red.
- Open risks.
- Scanner findings.
- Media from CI (
verify-run), not from the agent. - Side effects: network calls, files, database writes.
- Blast radius.
- AI review findings.
- The agent's summary.
- The diff.
Each approval records which artifacts the approver opened, which findings they resolved and which diff sections they read, and sod/independence will not pass without it (Review, merge & change, 09.7).3
Keeping the evidence honest
Proof that nobody tests turns into theatre, so the platform tests its own proof every month and keeps the record outside GitHub.3
- "Proof sufficient" rating, 1 to 5, on approvalsShows where evidence is too thin to approve on
- Monthly seeded-defect exercise, including a forged green reportDo the chain and the reviewers catch planted faults?
- Results at team level only, never to line managersNo individual scoring; minimum cell of five people
- Artifact opens per teamShows which evidence reviewers really use
- At least two recent approvers per T2 domainLedger and AML have three non-requester approvers by month 6
- Frozen-build red team before W-tech (spike S2)Weeks 10-12: a forged green report, a planted cache entry and rendering exfiltration must all fail
A circuit breaker backs this up: a domain whose 30-day revert and fix-forward rate passes twice its baseline, or whose severe incident carries an agent change ID, moves up a tier for two weeks (09.9).3
The record lives outside GitHub
GitHub is not the archive: since 1 October 2026 its Actions retention setting also deletes check runs, workflow runs and commit statuses, third-party ones included, after 90 days by default and at most 400 for private repositories.5,6 So the record is exported at merge to the evidence store, and a daily reconciliation flags any commit on main or production deployment without a notarised record.3
Proof media hold only synthetic data, so a governance-mode lock suffices.3 Only ledger, posting and closing changes have a statutory floor (bokføringsloven § 13, five years) and get the stricter compliance mode; every other period is the bank's own choice under RTS Art. 12(2).33,1 Security, compliance & governance, 10.8 has the full schedule.
Budget for verification: it is most of the work
Verification is not overhead on agent work; it is most of it. Cindy Sridharan reports that "70% of my daily token spend goes into verifying patches, and only ~20-30% into creating them",34 Lauren Tan says "most of my token usage goes to verification",32 and the bank's cost model, a planning estimate until a pilot measures real sessions, assumes the same.35
Verification also gets its own people: a 1.5 full-time-equivalent (FTE) verification-and-evidence role in the platform team, and squad time for the money domains.3 Observability, evals & cost, 13.4 has the full model.