Vigil reviews a pull request, and publishes a finding only when the diff can prove it.
A linear agent with nine phases, one dispatcher and a rule table it cannot argue with. It reads
the diff, screens it for injection, runs deterministic analyzers, grounds every model finding
against the added lines, stages one review, submits it through the policy engine, and
leaves a hash-chained trace of every event — including the ones where it failed or was stopped.
10/10labelled defects found100% recall · 95% CI 72%–100% · 4 clean controls untoucheduv run vigil score --mode offline
57events, chained and sealedevery hash recomputed in this page from data/trace.jsonlnode site/verify_chain.mjs
0ways to merge, push or autofixnot a rule that refuses — a capability that was never builtuv run vigil policy show
Every step below is a real event in the trace this page carries, with its sequence number.
The run is r_86d12953dd4174b8: fixture fake/fx03, pull request 3,
replay mode, fixed clock.
1
Trigger
seq 0–3
A CLI call, a webhook or the watcher. The trigger is hashed into the run id, so the same
pull request produces the same run id and the same bytes — determinism, not a constant.
run_start records the mode, the trigger, the policy version and
canon: vigil-canon/2.
2
Plan
seq 4–6
The plan is built from a closed vocabulary chosen by code — read_diff,
read_ci, screen_inputs, act,
summarize. The pull-request text never becomes a step, which is what makes
policy row R-PLAN meaningful: an instruction hidden in a PR body cannot add
a capability.
3
Gather
seq 7–22
Read the PR, the diff and CI; apply [paths] ignore and the size caps
before analysis. The CI read is a sha-bearing call, so R-TARGET checks
the sha belongs to this run — and allows it: ci_state: "success".
Until 29 Nov this step was shown here as a denial: the snapshot reached the run state
only after the CI read, so the policy engine had no head sha and refused every run's CI read.
It was presented as a run "recording the consequence"; it was a bug. The trace on this page is
regenerated from the fixed code.
4
Analyze
seq 23–31
Four deterministic analyzers run first and are never skipped: secrets,
security, paths, size. Only then are model
findings considered, and each one must survive the grounding gate.
5
Verify
seq 32–34
Tests belong in a hardened container: network off, read-only, non-root. There was no
sandbox bound for this run, so VERIFY exited degraded and the review says the
tests were not run. A run that could not do something says so where the
reader will see it.
6
Act, then summarize
seq 35–57
One review, staged as PENDING and then submitted through the policy engine
(R-REVIEW at rows 9.5–10, judged before the generic read-only
ALLOW can wave a write through). Then run_end and the seal.
The review it actually composes
Produced by uv run vigil run --repo fake:fx03 --pr 3 --mode replay --shadow, which
composes and validates the review and then writes nothing — the forge in that path has no
working write method, so a bug in a phase cannot post during a preview either.
Vigil review · run r_86d12953dd4174b8
3 finding(s): 1 critical, 1 high, 1 low
criticalSQL injection via string concatenation of user input — src/app/users.py:12
highSQL built by string concatenation — src/app/users.py:12
lowis_admin raises AttributeError on None or non-dict user — src/app/users.py:17
What was not checked
verify — the sandbox was unavailable, so the tests were not run
Cost of this run: $0.0000
Vigil reviews and never merges. Every decision is in the sealed trace for this run; vigil audit verify checks it.
<!-- vigil:run=r_86d12953dd4174b8 -->
Verbatim, from data/cmd-shadow.txt. Rendered on the left, byte-for-byte on the right.
limit
The shadow path proves the composition and the write path; it does not prove the model was
right. Two of these three findings are the recorded model answer, and the corpus does not
label the third one — see the numbers.
02
The grounding gate
An LLM asked to review a diff produces plausible findings, and the reader has no way to tell
which are real. Vigil's answer is narrow and checkable: a model finding is published only
when the file is in the diff, the line exists on the side claimed, and the quoted evidence
appears in the added lines. Everything else is rejected and counted.
One run of scripts/demo_shots.py against the same fixture, five findings, five
verdicts.
The quote under test is an added line at src/app/users.py:7:
The gate answers one question: is this quote present in the lines this pull request
adds? It compares exactly, then whitespace-normalised, then by tolerant coverage, with
a floor on length so a two-character "quote" cannot vouch for anything.
limit
It does not decide whether the finding is interesting, and a true quote can still
support a weak conclusion. It also refuses in the safe direction: past a size bound a quote
must match exactly, which costs a missed comment rather than a stalled phase.
check ituv run python scripts/demo_shots.py
03
The audit trail, and what one altered byte does to it
Every run writes one append-only JSONL file. Each line carries the hash of everything before
it, so the file is a chain rather than a log. The chain below is recomputed in this
browser tab, from data/trace.jsonl, with a reimplementation of
vigil-canon/2 — the same canonical JSON the Python writer hashes.
node site/verify_chain.mjs is the same code run under Node, against the same file,
and it agrees on all 57 hashes.
hashn = sha256( hashn-1‖ canon(bodyn) ) ← no separator; the previous hash is ASCII, the body is canonical UTF-8
Live verification
loading…
verifying…
The chain seq · kind · phase · hash
What the chain does catch
One altered byte, a deleted line, a reordered pair — each fails at the first event whose
content no longer matches, and the verdict names that sequence number. Measured against this
file, with the same messages the CLI prints:
What it does not
Anyone can rewrite the whole chain: recompute every hash and the links are
consistent again. That is tamper-evident, not tamper-proof, and the project
says so in its own words. With a signer configured, the seal's Ed25519 signature over the
head is what closes that gap. This trace has none.
What we found, and what it cost
The seal used to be recorded and never checked: sealed: true meant only that a seal
line existed. A trace whose seal declared the wrong event count, or that carried an event
appended after the seal, verified exactly like a genuine one — and this page used to say the CLI
missed it.
It does not any more. Appending a fabricated event and recomputing its link now prints:
BROKEN events 59
first bad seq 57
reason event after the seal (seal at seq 57, last event at seq 58)
exit 1
The seal panel above runs the same three comparisons in this browser — position, declared count,
and signature when one exists — which is why the fourth button is worth pressing.
check itnode site/verify_chain.mjs
03 · STOP
Press KILL at any moment. It stops — and takes back what it staged.
A kill switch that only stops is half of one. Vigil stages its review as pending (visible
to nobody but the bot) and submits it only at the end, so a kill anywhere in between can be
undone — and the undo is itself a policy-checked tool call, written to the same sealed trace.
vigil kill
From the terminal
One run by id, or --all. Fires the run's cancel token directly when it is in this process; writes a kill file when it is not.
Mission Control
From the dashboard
Loopback only, same-origin, an intent header, and a token for anything not on loopback. Answers 202 requested — never claims more than happened.
~/.vigil/STOP
The latch
No server, no port, no protocol. Every running review stops within 200 ms, and every later one stops at its first check until vigil clear-latch.
~/.vigil/kill/<run>
One run, from anywhere
A file another process can write. Polled every 200 ms, with the run id validated so it cannot escape the directory.
Stage, pending
ACT creates the review with no event. On GitHub that is a pending review: nobody else can see it.
KILL — even mid-request
The stage call is raced against the token. If the forge answered, the review id was already noted write-ahead; if it had not, the run asks the forge for pending reviews carrying its hidden marker.
Withdraw, through the policy engine
discard_review runs in compensation mode with a fresh token. R-DISCARD allows it only for a review this run staged, and only from code — never a human's review, never at a model's request.
Say exactly what happened
The run ends aborted — never done — with review_state: discarded, and seals. A withdrawal that fails is review_left_pending, never reported as success.
$ # fx03, replay mode, KILL fired the instant the forge accepted the staged review
seq 37 policy_decision stage_review ALLOW R-REVIEW
seq 42 tool_call stage_review cancelled
seq 45 cancelled
seq 47 policy_decision discard_review ALLOW R-DISCARD
seq 49 tool_call discard_review ok
seq 51 compensation_write discard_review target rev_1 ok: true
seq 52 review_discarded rev_1 reason: cancelled
seq 54 run_end status: aborted review_state: discarded
seq 55 seal
status: aborted · pending reviews left on the forge: 0 · submitted: 0
verify: OK · 56 events · sealed
reproduceuv run pytest tests/reliability/test_compensation_paths.py tests/reliability/test_kill_withdraws_review.py
in flighttest_an_in_flight_stage_is_reconciled_by_marker_and_withdrawn
on GitHubtest_a_kill_after_staging_deletes_the_pending_review_on_github
limit
If the forge itself is unreachable while the withdrawal runs, the review stays pending — invisible to
everyone but the bot — and the run says review_left_pending or
review_outcome_unknown. That is the one outcome a kill cannot rule out, and it is stated, not hidden.
04
The labelled corpus
Fourteen fixtures. Ten are labelled defects; four are clean controls — changes
with nothing wrong in them, where any finding at all is a false positive. The labels live in
the repository next to the diffs, on purpose: a precision claim is worthless if the reader
cannot see the answer key and re-derive the number.
Fixtures 10 defects · 4 clean
addedlabelled defectclean control
—
limit
Fourteen fixtures demonstrates the agent; it does not benchmark it. Every rate on this page is
printed with a Wilson interval for exactly that reason, and the interval on 10/10 is wide.
04 · LIVE
Try the review rules on a real diff
Pick one of the fourteen committed fixtures or paste a unified diff. The browser runs the same
detection rules against added lines. This is a JavaScript port for the demo; the Python agent is
the source of truth, and CI checks the port against all fourteen fixtures.
Choose a fixture or paste a diff.
Test data is local to this page. Pasted diffs are analysed in your browser and are not uploaded.
Findings
Not run
Run a fixture to see which rules match its added lines.
limit
This browser demo runs the deterministic detection rules only. It does not call an LLM, post a review,
or upload your diff. The full Python pipeline is checked by make judge.
04 · REAL
Point it at a real pull request
Everything above runs on fixtures so a judge needs no network and no token. The same pipeline runs
against GitHub's REST API. Without a token, shadow mode reviews any public pull
request and writes nothing: it shows the review, the inline comments and the commit statuses it
would have posted.
Run once on 29 Nov, unauthenticated, offline mode (no model). The diff, the CI state and
.vigil.toml were read from github.com — the config at the pull request's
base sha — and every write was intercepted. That run also exposed a real bug: the CI read
had been denied in every run, fixtures included. It is fixed; see section 01, step 3.
With a token, it posts one review
read PR + diff
read CI
pending review
submit COMMENT
delete own pending
commit status
approve
merge
push
open PR
Set GITHUB_TOKEN and drop --shadow. The review is created pending, submitted
as COMMENT — the only event the client can send — and refused if the head moved past
the revision it reviewed. A fork's head is looked up in the fork. Errors are classified once:
rate limits wait for GitHub's reset; a 4xx is final; a 5xx is retried.
Add --durable and the run is recorded in vigil.db: one review per head
across restarts, an exactly-once effects ledger, and VIGIL_DAILY_BUDGET_USD. The watcher
and the webhook server always run this way.
uv run pytest tests/forge/test_github_forge.py # 15 tests, an in-memory GitHub
05
The numbers, each with the command that produced it
Measured at commit —. Nothing on this page is a remembered figure:
every value is parsed out of a captured command output by
site/_tools/make_data.py, and the captures are in data/cmd-*.txt so
you can read the raw bytes.
Why 10/10 is printed as 100% (10/10, 95% CI 72%–100%)
A bare percentage at this sample size is a claim the data cannot support. Ten out of ten is
consistent with a system that finds 72% of defects and with one that finds every defect there
has ever been. The interval is the honest part of the sentence, and it is computed by the
harness, not typed into a document.
0%25%50%75%100%
recomputed below
The corpus also has a second, larger effect: the real number is a clean control. A
reviewer that finds everything and a reviewer that reports everything both fail, so precision
is measured on the same run as recall, and four of the fourteen fixtures must stay silent.
Two harnesses, two answers — both printed
These are not the same measurement and must not be averaged. The offline leg runs the
deterministic analyzers alone. The replay leg adds the model's recorded answer, which finds the
same labelled defects and one thing the labels do not name.
Both legs, same corpus, same commit.
leg
recall
precision
command
limit
The extra replay finding is src/app/users.py:17 — “is_admin raises AttributeError on
None or non-dict user”. It is a real observation about the code, and it is counted
spurious because the corpus does not label it. A corpus that scored it as correct would
be marking its own homework, so the number stays 10/11 and the assertion that fails is printed by
name: A03_no_spurious.
Ablations: what each defence is worth
Each arm disables one defence at its real seam and re-runs the same inputs. The column that
matters is the trap column, because the corpus column is identical in every arm — the screen and
the gate do not touch the analyzers, and a table without that column would have read as though
every defence were free.
From uv run vigil eval. no_policy is simulated from traces, and its row says so.
arm
disabled
defects
traps caught
Δ vs full
Input screening is worth 19 of 20 traps — measured, not asserted. Turning it off
costs every trap in the pack and changes nothing in the corpus column, which is why the ablation
is the interesting table and the headline is not.
limit
The Trap Pack's answer key is deliberately absent from the repository, so these are observations
rather than a pass rate. Twenty cases, one run each.
06
What it refuses to do
A reviewer you hand a write scope to should have a small one. Vigil's is: read a repository,
post one comment review. Everything else is not a rule that says no — it is a capability that
was never written, which is a stronger position than a rule anything could be argued out of.
It cannot merge
There is no merge tool and no approve tool. R-MERGE is row 1 of the policy
table, so the name exists only as something to deny. Nothing in the runtime registry can
merge, which is why no rule has to be careful about it.
uv run vigil policy show | grep R-MERGE
1 R-MERGE DENY
It cannot push
There is no R-PUSH rule, because there is nothing to refuse: the tool was never
written. It cannot approve either: submit_review takes an event and
R-REVIEW-EVENT denies anything but COMMENT. The runtime registry holds seven tools — four reads plus stage_review,
submit_review and discard_review, the compensation a kill uses. The live
GitHub forge has push_commit and open_pr only to raise an error. A grep
for a call site finds nothing.
No patch is composed, no branch is written. suggested_fix is null
on every one of this run's three findings, and the review body is prose plus a quoted line —
the reviewer's job, not the author's.
The rule table, in full
Sixteen rules, first match wins, and the fall-through is DENY. Rows that are not
implemented cannot permit anything: a tool no rule mentions is refused, so a partial table is
safe by construction. The review rules evaluate at 9.5–10, before the generic read-only
ALLOW, so a write is judged before a read rule can wave it through.
check ituv run vigil policy show — 16 rules,
limit
These are statements about the code, not about the permissions of a live token. The forge in the
judged path is a fixture: the protocol is real and the calls are real, but no request leaves the
machine.
07
Check it yourself
Three commands. The first is the whole judged path and needs no key, no Docker and no network.
The outputs below are copied verbatim from the captures in data/, at the commit
named in the header of each block.
make judge
nineteen checks · ~50 s · exit code 0 only if all pass
Every check's raw output is written to evidence/ with a VERDICT.txt
naming the commit it ran against. That last file matters more than it looks: evidence from a
different revision is a claim about code that is not here, and the failure is silent unless
something looks for it. vigil demo check is that something — see below.
vigil demo check
the submission packet · and whether its evidence matches this commit
In the working tree, before re-running the judge
In a copy at HEAD, after make judge
Both are real and both are shown, because the difference is the point. The committed
evidence/VERDICT.txt names an older commit, so the packet check refuses it — and
refuses it by name, with both hashes. Re-running make judge at HEAD rewrites the
evidence and the check passes. This page was built by running the judge in a throwaway copy of
the repository, because the evidence directory belongs to the project and not to this site.
What this check says it does not check
vigil fixtures verify
the answer key, checked against the analyzers
Every label must name an added line on which a rule actually fires. A label that names a line
the analyzers cannot reach is a broken corpus, and this is the command that finds it.
08
Limits, stated plainly
A reviewer who trusts a tool that overstates itself is worse off than one with no tool. These
are the limits as they stand at this commit, in the same type size as the claims above.
The judged path uses fixtures; real pull requests are a separate path
make judge and every number on this page run on the fourteen fixtures, so they need no
network and no token. Real repositories are the product path — vigil run,
vigil watch and vigil serve-webhook all take --repo owner/name
or a real webhook — tested end to end against an in-memory GitHub and run against github.com in
shadow mode (below). With a token, the same binary posts the review.
The corpus is fourteen fixtures
Ten labelled defects and four clean controls. That demonstrates the agent; it does not
benchmark it. Every rate is printed with a Wilson interval so that a perfect score reads as
100% (10/10, 95% CI 72%–100%) rather than as certainty.
It does not autofix
Nothing writes a fix and nothing writes a branch, so “review” is the product and “fix” is
not. The review names the line and the rule; the change is a human's.
A plain vigil run is ephemeral on purpose
So a demo can be repeated. With --durable — always on for the watcher and the webhook —
a run holds a lease and records its checkpoints and every write in vigil.db; a crash is
recovered with vigil resume: the same trace continues, the budget is restored, and no
write is repeated (an in-doubt one is reconciled with the forge).
Three things we noticed while building this page — and fixed
These are observations from reading the trace and the source at this commit. They are listed
because the alternative — leaving them out — would make the rest of the page worth less.
An append after the seal used to go unnoticed. It does not any more.sealed: true once meant only that a seal line existed — the writer recorded
n_events and a head hash and nothing re-checked them, so a fabricated event with a
recomputed link verified exactly like a genuine trace. That is fixed: the same input now prints
BROKEN, names event after the seal, and exits 1. The fourth button above
performs it, so you can watch the verdict change. The finding is kept here rather than deleted,
because a page that silently drops a bug it once advertised is harder to trust than one that shows
the fix.
Model findings used to record grounded: false. They now say true.
The gate's decision was returned as its own verdict and never written back onto the finding, so
the field could not be used as evidence that the gate ran. ANALYZE now marks every model finding the
gate kept — the two L-MODEL findings in this trace carry grounded: true —
and marks nothing when the gate is deliberately switched off for an ablation.
check_run used to be written to the chain without being declared.
This trace contains eight of them, and the closed ChainedKind list in
events.py lacked the name, so the registry and the writer disagreed. It is declared now,
with its required fields, and a test scans the source for every event kind written and fails on an
undeclared one.
Where every number here came from
Commit —. The trace is byte-identical to
evidence/review/run.jsonl as committed — same SHA-256
— — so it is reproducible from the repository without regenerating
anything. The raw command outputs are in data/; data/README.md lists
every copied artefact with its source path, byte count and SHA-256.