Set up verifying code written with AI
For teams that merge code written by assistants and agents: every change passes an evidence gate. Does it do what was asked, do the tests really check it, would they fail without it, are its new dependencies real?
State today. The checks of a change and the evidence gate on pull and merge requests work today; stricter rules for AI-written changes are set by your policy. Broader validation continues.
See it

The review of a synthetic pull request (the demo’s document). The same in the dark theme and on a phone. Taken from Fistron’s GUI at its release, never drawn.
| You do | Fistron does | You get |
|---|---|---|
| Let Fistron review your pull and merge requests. | Fistron checks each change with evidence: tests, coverage of the changed lines, scanners, the AI review, each finding with its file and line. | A review that says what is not proven, before a person approves the change. |
The setup’s checklist
The same checklist, with each step’s state for your project and the page that does it, is on the project’s page Solutions.
- Connect an agent. The agent reads your CI, repositories and environments inside your network. See Use the hosted control plane with your own agent.
- Let the agent read your repositories. A change’s review and the change policy read the repository. See Connect GitHub and GitLab.
- Choose the reviewer’s model. The review of a change reads its diff with the model your policy allows. See Configure models (LLM endpoints).
- Merge the change policy. The evidence each change must bring, on your default branch.
- Add Fistron to your CI. Each pull or merge request reviewed and each failed build analysed in your own pipeline, automatically; one pull request sets it up. See Fistron in your CI.
What you need
- The change assessment in CI (Set up quality improvement, step 5): Fistron’s CI files and a read token.
- Protection of your CI files where the gate blocks: code owners or a required workflow on the default branch.
- Optionally a model endpoint for the intent review and the confirmation of checks; choose one other than the model that writes your code.
Steps
-
Set the change policy: the repository’s setting
change-policyon Repository settings in Fistron, never a file the change itself can edit. Let Fistron propose it first: on the project’s Pull and merge requests page, tab Review a request, under Propose a change policy, enter the Repository and click Propose a change policy (or startpropose-change-policyon Work, orfistron propose change-policy). The agent reads the repository with its platform access. The proposal says, by rules and with the reason of each value:- the gate in report mode;
- the signals the repository’s newest commits and labels use;
- coverage when a CI history has per-test coverage;
- dependencies when the repository has a lock file;
- the review rubric files it has.
A policy set already is kept, and only the sections it lacks are added. A manager confirms it under Proposed changes of Repository settings, then edits it there as needed. By hand, name how an AI-written change is recognised (only explicit signals: commit trailers, bot accounts, labels) and what it requires:
version = 1 [ai] trailers = ["co-authored-by: example agent *"] authors = ["example-agent*"] labels = ["ai-*"] [ai.requires] coverage = true # every changed line executed confirmation = true # supported checks confirmed by a second model intent_review = true # every part of the diff explained by the stated intent reproduction = true # a fix's test fails on the base and passes on the head dependencies = true # new packages exist, are not confused, are approved [gate] mode = "block" # "report" first, to see what it would block checks = true unknown = "fail"Every option: change-assessment.md.
-
Make the gate a required check. Run the change assessment with
--gatein the request’s own pipeline and require the job (GitLab: “Pipelines must succeed”; GitHub: a required status check). Run the blocking job with plain rules and no model key, because the change’s code can read the job’s secrets (ci-job.md). -
Give the change’s own evidence. In the request’s test job, produce
fistron verify-fix,fistron dependencies checkand your security scanners’ SARIF reports, and upload them as an artifact thatchange_artifactnames. -
Choose a different verifier. In the agent’s or job’s configuration, set the roles
reasoner,judgeandreviewerto an endpoint other than the model that writes your code, or keep plain rules (Configure models (LLM endpoints)). -
Publish the result on the request. Have the agent review requests and publish the review with its findings on the diff’s lines (Review pull and merge requests).
Start with mode = "report" for a few weeks, read what it would have
blocked, then switch to block.
Check
- A request whose commits carry your trailer shows authorship as AI-written and the section requirements with each requirement met, unmet or unknown.
- With
mode = "block", a request that fails a requirement cannot be merged until it is met.
Next
The assessment of a change and its risk: Assess a change and read its risk.