Proof-Carrying Coding
Last updated: 2026-07-174 min read
Proof-carrying coding is an analogy for attaching task, boundaries, executed checks, results, skips, and provenance to a change. Evidence, receipts, test output, attestations, and formal proofs are not interchangeable. Without a formal property, proof object, assumptions, and checker, these are bounded review artifacts rather than proof or a correctness guarantee.
Contents
The 1997 idea: trust through checkable artifacts
In Proof-Carrying Code (POPL 1997, later awarded most influential paper of its year), George Necula solved an adversarial trust problem elegantly: a host must run a binary from an untrusted source. Instead of trusting the source or laboriously analyzing the binary, the source attaches a formal safety proof - and the host runs a small, fast proof checker. The deep insight is asymmetric effort: constructing the proof is expensive and falls on the producer; checking it is cheap and falls on the consumer. The host stays sovereign without doing the producer’s work.
The transfer to AI coding - honestly marked as analogy
AI coding recreates the trust setup almost exactly: a prolific, not-fully-trusted producer (the model) delivers work to a receiver (your team) that cannot afford to redo it. With 96% distrusting AI code and only 48% consistently verifying, most teams currently resolve the dilemma by trusting anyway. Proof-carrying coding resolves it the 1997 way - with one honest difference that must be stated, not hidden:
| Proof-carrying code (1997) | Proof-carrying coding (2026) | |
|---|---|---|
| Untrusted producer | Code supplier (possibly adversarial) | The generating model/agent |
| Attached artifact | Formal, machine-checkable safety proof | Evidence record: task, checks, results, skips |
| Receiver's job | Run a small proof checker | Verify the evidence, judge the trade-offs |
| Property covered | Narrow safety properties, with certainty | Task conformance and validation, with confidence |
| The economics | Checking ≪ proving | Checking evidence ≪ reconstructing the run |
The bottom row is why the analogy is load-bearing rather than decorative: in both systems, the entire design exists because verification is radically cheaper than reproduction. Evidence that costs more to check than redoing the work would be worthless - which is also the quality bar for what belongs in the record.
What the principle demands in practice
- Producers attach, always. Every AI run delivers its change plus its record - the written task, the validations that ran, their results, what was skipped. No record, no review request.
- Receivers verify, not reconstruct. The review starts from the evidence: scope against boundaries, criteria against results. Judgment time goes to architecture and trade-offs, not archaeology.
- Nothing merges on trust alone. “The agent said it passed” is a claim, not evidence - validation authored outside the generating session is what makes the record checkable.
- The record persists. Stored with the code, the records accumulate into the audit trail nobody had to write retroactively. The artifact’s structure, with a labeled sample, is on the evidence reports page.
The 2026 revival - and the honest limits
The formal end of the idea is being rebuilt for agents: 2026 research on proof-carrying agent actions has agent actions carry machine-checkable justifications that a gate verifies before execution - Necula’s architecture, re-aimed at runtime governance. The pragmatic end, described above, is deployable today. Its limits deserve the same clarity: evidence raises confidence, it does not prove correctness; a record can be complete and the architecture still wrong, which is why the human gate stays; and the quality of the whole scheme is bounded by the quality of the task - vague mandates produce unfalsifiable evidence.
Where Reality Graph fits
Proof-carrying coding is Reality Graph’s operating principle stated as a concept: every run is verified against its written task, and the change travels with its evidence report - produced as a byproduct, checked in minutes, stored with the code, local-first. What that record resolves into, a single outcome per run and the rule that keeps a run blocked even when every test is green, is described under how the outcome is decided. The principle stands without any specific tool; the tool exists because the principle is tedious to uphold by hand at AI volume.
This principle gives you
- Reviews that start from verified facts, not archaeology
- The verification asymmetry working for you, per change
- An audit trail accumulating as a byproduct
- A 30-year-old, award-winning architecture as foundation
It does not give you
- Formal proofs - the evidence raises confidence, not certainty
- A substitute for the human merge decision
- Value from vague tasks - checkable mandates are the precondition
- Necula's guarantees - the analogy is honest about being one
If these boundaries fit how your team wants to ship:
FAQ
- What is proof-carrying coding, and how does it work in practice?
- Proof-carrying coding is an analogy for attaching a change's task, boundaries, executed checks, results, skips, and provenance. A receipt records what ran; test output reports observations; an attestation states what an actor asserts. None is a formal proof unless a formal system, property, proof object, and checker are actually present. Review and approval remain separate decisions.
- Where does the term come from?
- George Necula's POPL 1997 paper describes programs accompanied by formal, machine-checkable evidence for specified safety properties. This article borrows only the producer-attaches / receiver-checks architecture. Ordinary development evidence does not inherit the theorem, property coverage, assumptions, or guarantees of that formal system.
- Are these actual proofs, like in Necula's work?
- Usually not. Tests, lint output, task comparisons, receipts, and attestations are evidence about stated checks and environments. They can be incomplete or wrong and do not establish business correctness. Call an artifact a formal proof only when its formal property, assumptions, proof object, and checker are identified.
- Why does the asymmetry matter so much?
- Attached evidence can reduce reconstruction work when it is current, reproducible, and relevant, but this page provides no universal time or cost result. Evidence production and checking both have costs; the reviewer still evaluates coverage, provenance, assumptions, residual risk, and the final decision.
- How does this differ from an evidence report?
- The evidence report is the artifact - what gets recorded per run, in which structure, with a labeled sample. Proof-carrying coding is the principle the artifact serves: producers attach, receivers verify, nothing is accepted on trust alone. You can read them in either order; the report page shows the how, this page argues the why.
- Is anyone applying this to AI agents formally?
- A 2026 arXiv preprint proposes proof-carrying agent actions with machine-checkable policy justifications. It is a research proposal, not evidence that ordinary evidence-attached changes are formally proven or that the approach is production-effective in every team.
Keep reading
Sources
- Necula - Proof-Carrying Code, POPL 1997 (formal origin; bounded properties and assumptions)
- arXiv preprint - Proof-Carrying Agent Actions: proposed runtime-governance approach (2026); not production proof
- Sonar vendor survey - self-reported trust and verification behavior (2026); not evidence that attached artifacts close a trust gap