This is the third pillar of the three pillars of agentic engineering: validating the result.
The objective of Behaviour Validation as a pillar of agentic engineering is to shift this responsibility left, into the specification process, before the automated agentic development loop starts.
The premise of agentic engineering is to prepare the conditions for autonomy upfront: once the agentic loop starts, the agent should be able to work without a human checking every step. Part of those conditions is the specification of what to build. The other part, often overlooked, is how we will know it was built correctly.
That definition of correctness is called The Oracle and has to be in place before the agentic loop starts. If the implementer writes the tests and the code from the same specification, we risk validating the consistency of the implementation rather than its correctness.
Using two independent processes, one for writing the tests and another for writing the implementation, both derived from the same spec, can help. The test writer does not see the code, so it cannot simply record what the code does. But it is not enough. An agent is still deciding what the expected outcome is, and it does not remove the need for a human reviewing every generated test. It just moves the human bottleneck to the verification process, which is what we are trying to avoid.
This is the test oracle problem: how do we determine whether the observed behaviour of a system is correct, independently of its implementation? And with agents, if we want to run long autonomous loops, we need that answer before the implementation starts.
As the cost of producing software approaches zero, the challenge is defining the oracle before the implementation starts, so its validation can run without a human in the loop.
The Verification Contract
The Verification Contract is a term coined by Sion and April in Who Verifies the Builder? (2026), as a contract “stating what must be demonstrated before release”.
As Sion and April define it, a Verification Contract is:
- a list of falsifiable guarantees per requirement
- written in natural language, and approved by a human
- stating which techniques and evidence are required to support each guarantee
It defines what must be demonstrated, the evidence required, and the techniques to gather that evidence and assemble an Assurance Report.
Sion and April separate an assurance plane from a build plane. In the assurance plane there are two agentic phases:
- In Phase A, a verifier agent receives the specification and the approved Verification Contract, but not the implementation, and produces what I named an Executable Verification Contract: acceptance tests for each guarantee, including property-based tests, invariants, forbidden scenarios and example-based acceptance tests. These are frozen before Phase B starts.
- In Phase B, with the implementation visible, techniques like mutation testing and fuzzing gather the rest of the evidence.
Source: Sion and April, Who Verifies the Builder? (2026), Fig. 1 (redrawn).
If we map this framework to the two loops:
- AI-assisted Human in the Loop: The Verification Contract and the Executable Verification Contract belong to the human in the loop, or to a small loop just before the agentic loop. Unlike the paper, I place Phase A in the human loop: an agent drafts the EVC and the human decides.
- Autonomous Agentic Loop: Phase B runs inside the away-from-keyboard loop, which ends with the Assurance Report. The Assurance Report includes the evidence that points to each guarantee in the Verification Contract, and the Verification Contract points to the requirements, the domain model and the ADRs.
Based on the Assurance Report and outside the AFK agentic loop, a human decides whether to release.
The chain is as follows:
- Stakeholder intent maps to use cases and requirements.
- Requirements are translated into a specification.
- The specification is composed of:
- Domain models
- APIs and schemas
- ADRs
- From the specification we compose a Verification Contract.
- From the Verification Contract, an agent without access to the implementation derives an Executable Verification Contract.
- A human approves these artifacts and creates a frozen baseline.
- An autonomous coding agent builds the implementation and the builder tests.
- The implementation is verified against the Executable Verification Contract.
- This produces an Assurance Report with evidence for each guarantee covered in the Verification Contract, which also points back to the specification and requirements.

Changes to the Verification Contract or the Executable Verification Contract go back to the specification and to human review, never through the implementing agent, so we are effectively shifting behaviour validation left.
The Executable Verification Contract
The Executable Verification Contract contains four kinds of checks:
- Acceptance examples: given / when / then with concrete data and oracle values.
- Properties and invariants: rules that must hold for any input.
- Stateful sequence tests: generated sequences of operations, checking the invariants after each step.
- Forbidden scenarios: things that must never happen, like refunding a payment that was never captured.
All of them need a known initial state or test fixture (the given), a set of actions (the when), and the oracle (the then).
Building this Executable Verification Contract upfront against real environments is the hard part, and the open question that drove this research.
As Simon Willison put it, “all the easy stuff is done, all that remains are the hard parts.”
Building the Executable Verification Contract
Validating a business process requires four elements:
- An execution environment.
- A known initial state or test fixtures (given).
- A set of inputs or operations (when).
- A definition of the expected observable behaviour (then, the oracle).
Establishing the initial state is particularly challenging in distributed systems, where the state of a business process is spread across multiple services and databases.
Validating complex systems has always been challenging. At least when implementation took weeks, there was time to prepare environments and find suitable test data, and to find bugs just through exposure to the software. Now agents work in hours, in parallel and without human interaction.
There are two separate decisions about test fixtures: what kind of environment we run on, and where the initial state comes from.
The environment can be ephemeral, created for each run and thrown away afterwards, or shared, like a staging or production environment that lives on between runs.
The initial state can come from three places:
- Inserted. We load fixtures directly into the databases. It is fast and reproducible, but it bypasses the system’s own rules, so we can end up testing states the system could never reach. And keeping inserted data consistent across several services and mocked services is fragile.
- Built. We drive the system by executing the business operations needed to reach the state. Every state is reachable by construction, but it is slower, and every step in the chain is one more thing that can fail before the test even starts.
- Searched. In a shared environment, we look for entities already in the state we need. It is the most realistic, but it is hard to reproduce and depends on suitable data existing. The specification also has to say not only what we are looking for, but how to find it.
| Initial state | Ephemeral environment | Shared environment |
|---|---|---|
| Inserted | Common, risk of unreachable states | Fragile, runs collide with each other |
| Built | Reachable states, slower | Viable with unique IDs per run |
| Searched | Not applicable | Realistic, hard to reproduce |
Whichever combination we choose, every scenario has three parts to specify:
- The given: either inserted, built or searched.
- The when: inputs depend on the given and have to be parametrised, especially IDs and dates.
- The then: the oracle may depend on the particular inputs and initial state.
The given and the when are an engineering problem. Agents are good at generating fixtures, setup sequences and test infrastructure. The then is different: if the expected values are derived from the implementation rather than from an independent specification, the test provides little evidence of correctness.
That’s why it’s important to build the complete EVC, and in particular the then part, the oracle, without access to the implementation, so agents can run it without deciding what the correct result is.
Techniques
There are well-known techniques to build the Executable Verification Contract. This is the role each one plays:
- Specification by Example. Concrete scenarios for each guarantee in the VC. The examples should be structured data (HTTP requests, incoming messages, expected outgoing messages) for public APIs and events.
- Acceptance TDD. Black-box tests run through the public API surface. Similar to Specification by Example, but ATDD focuses on the ‘how’ and SbE on the ‘what’.
- Property-based testing. Invariants taken from the domain, like “the total refunded amount never exceeds the captured payment”. Stateful property-based testing generates sequences of business operations and checks the invariants along the way, reaching intermediate states through the system’s own operations instead of inserted fixtures. The same invariants can be checked against the model with Formal Verification.
Mutation testing needs code, so it cannot run before the implementation exists. What can be written upfront are the hypotheses: plausible defects the tests must catch, like charging twice, refunding a payment that was never captured, or cancelling after shipment.
Keeping the human review small
If a human has to review every generated test, we have just moved the bottleneck from the end of the loop to the beginning. The aim is to make the review smaller and of a different kind:
- Review data, not code. When examples are structured data run by a generic execution infrastructure, the human reviews tables of inputs and expected outcomes, not test code.
- Run scenarios mechanically. Scenarios are executed by a testing layer derived from the API and event contracts, not by glue code written for each scenario. Hand-written steps can check less than the scenario says.
- Let evidence replace reading. The human defines what need to be tested and how. Then Assurance Report will carry the results to validate.
Two open challenges
The objective is not to write all the tests by hand before implementation. It is to have an independent definition of correctness, and the mechanisms to check it, before delegating implementation to an autonomous loop.
Two challenges remain open:
- Deriving the Executable Verification Contract from the Verification Contract using only public APIs may require observing the oracle through the same APIs that are being implemented and tested.
- Validating that the EVC actually enforces the VC without reading the code, so human approval does not become a new bottleneck.