Philosophy & Epistemology · Philosophical Inquiry

The Proof Boundary: What Autonomous Code Cannot Know

AI agents can test and inspect their own code, but undecidability makes external contracts and human judgment essential.

Key Thesis

An AI agent can generate useful evidence about its code, but no general procedure can certify every meaningful property of every program. Define properties in advance, use bounded checks to reduce risk, and assign accountable humans to the assumptions and decisions those checks cannot settle.

A program can inspect itself without knowing itself

A coding agent writes a function, runs its tests, reads the failure, and tries again. The loop resembles reflection: the system turns attention toward its own work and reports what it finds. But inspection is not the same as knowledge. A green test suite is evidence about selected executions, not a certificate of all behavior the program could produce.

The distinction has old roots. Gödel showed that sufficiently expressive, consistent formal systems contain statements they cannot prove within their own rules. Turing showed that no general algorithm can decide whether every arbitrary program will halt. These results concern different limits, and neither says that software is unprovable. They do rule out the comforting idea that one universal procedure can settle every question about every program.

Rice's Theorem sharpens the practical point: any nontrivial property of what a program computes is undecidable in the general case. “Does this arbitrary program ever expose a secret?” is not decidable by a universal checker for all programs and inputs. A useful test, proof, or review can still answer a carefully bounded instance. The limit is on universal guarantees, not on engineering progress.

This matters because coding agents produce fluent explanations alongside code. Fluency can feel like introspection, as if the system has privileged access to why its program is correct. In practice, the explanation is another output to evaluate. An agent can describe a proof obligation, but its confidence does not establish that the obligation is complete, that the model matches production, or that its reasoning procedure is sound.

Verification needs an object outside the model

The remedy is not to stop agents from checking their work. It is to make the target of checking explicit and independently inspectable. A specification contract states what must hold: preconditions, postconditions, invariants, resource bounds, or prohibited effects. Without that external reference, “correct” collapses into agreement between a model and its own interpretation of the task.

A contract is also a decision about whose interests the software serves. Consider a payment service: a test may confirm that a transfer updates two balances, while the contract must say whether transfers are atomic, whether overdrafts are allowed, and what happens when a downstream system times out. Those choices are not discovered by running more generated tests. They require product judgment, risk ownership, and a shared account of acceptable behavior.

The agent can help translate requirements into assertions and identify missing cases. Yet humans must review the contract because natural-language requests are incomplete, conflicting, and shaped by institutional incentives. A investment committee may care about reconciliation and loss exposure. An engineer about invariants and failure modes. A customer about recourse. Verification becomes meaningful when those perspectives converge on a testable boundary.

Bounded checks buy evidence, not omniscience

Bounded model checking makes the boundary concrete. It explores system states up to a chosen limit, searching for a counterexample to a property. If no counterexample appears within the bound, that is useful evidence about the explored space, not proof about all possible states. Increasing the bound can uncover more failures, while state explosion makes exhaustive exploration expensive.

MethodScope or boundWhat it can establishWhat remains open
Unit and integration testsSelected inputs and scenariosExpected behavior on exercised casesUntested inputs and paths
Bounded model checkingStates or traces up to bound kNo counterexample within the encoded boundBehavior beyond k and model omissions
Formal proofAll cases under stated assumptionsThe property follows from the specification and proof rulesWhether assumptions and specification fit reality
Runtime monitoringExecutions observed in deploymentWhether monitored events violate stated rulesUnobserved paths and uninstrumented properties

The table is not a ranking from weak to strong. Each method answers a different question, and each inherits the assumptions of its representation. A proof can be mathematically valid while proving the wrong contract. A runtime monitor can catch a real violation without explaining every path that could cause it.

A useful architecture makes these limits visible rather than hiding them in an agent transcript:

Human-owned contract Agent proposes code and checks Independent verification Human release owner Evidence travels forward; accountability remains assigned

The independent verifier matters. If the same agent writes the implementation, invents the tests, and declares the result safe, correlated errors can survive every step. Separation need not mean separate organizations: it can mean a trusted proof checker, a policy engine with fixed rules, a distinct test harness, or review by someone responsible for the risk.

Accountability is part of the system

For an enterprise, the question is not whether an agent can be made to sound certain. It is which failures matter, what evidence is proportionate, and who accepts residual risk. Those decisions connect technical verification to capital allocation. A narrowly scoped agent with auditable contracts may yield more durable value than a broadly autonomous one whose apparent productivity depends on unpriced review, incidents, and compliance exposure.

This is why evaluation should measure more than code accepted per hour. Teams need to track escaped defects, test coverage tied to requirements, verifier independence, review effort, rollback rates, and the cost of maintaining generated systems. The exact measures differ by product, but the governing principle is stable: speed counts only when the quality and risk of the resulting software remain legible.

There is a philosophical lesson in the engineering practice. Knowledge is

References

Discussion (1)

Liam Ramirez Physics & CS Undergrad · UT Austin, TX

Rice's Theorem bites hardest in production when prompt injection alters the state space dynamically. If the specification contract itself is mutable text generated by the agent, you lose the external reference frame. How do you bound invariant verification when the specification drifts at runtime?