AI coding agents are becoming increasingly capable of writing, modifying, and testing software.
But there is a fundamental difference between completing a task and proving that its constraints were respected.
When an AI agent reports that it followed every instruction, what independently verifiable evidence supports that claim?
As a mathematician and software developer, I find this distinction particularly interesting. Instead of introducing another language model into the verification process, what if we could express development constraints as deterministic, machine-verifiable contracts?
This question led me to build RangeContract, an open-source verification tool for AI-assisted software development.
The problem: generation is not verification
Imagine assigning an AI coding agent a development task with four constraints:
- Modify only authorized source files and tests.
- Never modify authentication or security-sensitive files.
- Limit the number of changes.
- Successfully execute the required regression tests.
The agent completes the task and reports success.
But did it actually respect every constraint?
Traditional code reviews remain essential. However, many structural development constraints can be verified without subjective judgment or probabilistic inference.
The challenge is turning those constraints into independently testable conditions.
A deterministic approach
RangeContract separates code generation from constraint verification.
The workflow consists of four components:
- Baseline: A pinned Git commit representing the initial state.
- Implementation: Changes produced by a developer or an AI coding agent.
- Contract: Explicit, machine-readable development constraints.
- Verification: An independent evaluation of the observable changes.
Instead of trusting an agent's completion report, RangeContract evaluates the actual Git changes.
The result is one of three explicit outcomes:
- PASS — the evaluated contract requirements were satisfied.
- FAIL — one or more requirements were violated.
- ERROR — verification could not be completed reliably.
No language model is required for the verification process.
What does RangeContract verify?
RangeContract supports:
- Allowed and forbidden file paths.
- Limits on Git change records.
- Baseline and target commit ancestry.
- Optional execution of trusted validation commands.
- Checkout integrity checks around validation.
- Machine-readable JSON reports.
- Human-readable verification results.
The underlying implementation uses Git objects, deterministic rules, cryptographic content hashes, and actual command execution.
Forbidden path constraints take precedence over allowed path constraints, making it possible to define explicit exceptions within an otherwise authorized development scope.
Why not simply use another AI reviewer?
AI-based code review is valuable, particularly for evaluating architecture, readability, potential bugs, and implementation quality.
However, not every verification problem requires artificial intelligence.
Whether a prohibited file was modified is not a matter of interpretation.
Whether a commit descends from a specific baseline is not a matter of opinion.
Whether a validation command returned a successful exit code is an observable result.
For precisely defined constraints, deterministic verification provides a complementary layer of evidence.
I see this as a separation of responsibilities:
- AI agents generate candidate solutions.
- Deterministic verifiers evaluate explicit constraints.
- Human reviewers assess semantic correctness and engineering quality.
The objective is not to replace AI or human reviewers, but to give each component a more clearly defined responsibility.
Project engineering
The initial public release of RangeContract includes:
- 106 regression tests.
- 12 live acceptance scenarios.
- Cross-platform CI covering Windows, Linux, and macOS.
- Python 3.11+ support.
- Zero Python runtime dependencies.
- No API keys.
- No AI models required for verification.
- MIT open-source licensing.
The project was developed with the assistance of OpenAI Codex, making it an example of using AI-assisted development to build deterministic verification infrastructure for AI-assisted development itself.
Getting started
RangeContract is available through PyPI.
Install it in a trusted Python environment:
python -I -m pip install rangecontract
Explore the available commands:
python -I -m rangecontract --help
The repository contains documentation, contract examples, implementation details, and the regression test suite.
GitHub: https://github.com/Gamzo-dev/rangecontract
PyPI: https://pypi.org/project/rangecontract/
Understanding the limitations
Deterministic verification does not imply universal correctness.
A passing contract cannot prove that software is bug-free, secure, or semantically correct.
Comparing Git commits cannot reconstruct every intermediate action taken during development.
Validation commands must be trusted, and checkout integrity verification is not a security sandbox.
RangeContract has a deliberately narrower objective: establishing whether observable changes satisfy explicitly defined development constraints.
What's next?
I believe independent verification will become increasingly important as AI coding agents gain greater autonomy.
Generating more code is not the only engineering challenge. Building reliable mechanisms to verify that generated code respects its intended boundaries is equally important.
RangeContract is my contribution to exploring that problem.
I would genuinely appreciate technical feedback from developers working with Codex, Claude Code, Cursor, and other AI-assisted development environments.
How do you independently verify that your AI coding agents respect the constraints you give them?
Feedback, GitHub issues, and open-source contributions are welcome.
RangeContract is free and open source under the MIT license.
AI disclosure: This article was drafted and edited using ChatGPT. The project itself was developed with AI assistance.
Top comments (2)
This is the question I keep coming back to as someone who builds with AI assistance and cannot review every line the way a trained developer can. Right now my verification is mostly behavioral: I run the app, tap through the flows, and watch whether real users hit the bug — which catches broken behavior, but it cannot prove that an agent never touched a file it should not have touched. Your separation is the part I want: AI generates, a deterministic verifier checks the explicit constraints, and a human reviews meaning. The forbidden-path rule taking precedence over allowed paths is exactly the guardrail I would want around authentication and payment files, and PASS / FAIL / ERROR as the only three outcomes is honest — ERROR admitting the check could not be completed is better than a confident-looking pass. With 106 regression tests and zero runtime dependencies, it looks built to be trusted rather than just believed. For someone whose agent works mostly in one small Android codebase, what is the first contract check you would add — the forbidden paths, or the change limit?
Beyond checking allowed file paths in the diff, how do you verify that an agent extended the existing implementation in those files rather than writing a parallel helper alongside the working code?