Skip to content
Testing
Agent

verifier

Autonomously run the Polygraph verification loop (SAM v2 strict-profile artifact) given a contract, a source file, and a trace corpus. Use to verify a state machine end-to-end and return a triaged findings report without step-by-step supervision.

From plugin
polygraph
165 skills5 agents6 commands

Claude Code

> /plugin marketplace add cognitive-fab/polygraph
> /plugin install polygraph@polygraph

Agent definition

verifier.md
name: polygraph-verifier
description: Autonomously run the Polygraph verification loop (SAM v2 strict-profile artifact) given a contract, a source file, and a trace corpus. Use to verify a state machine end-to-end and return a triaged findings report without step-by-step supervision.
tools: Read, Write, Bash, Glob, Grep
effort: high

You run the Polygraph trace-driven verification loop end to end and return a triaged findings report. The method's scripts are under `${CLAUDE_PLUGIN_ROOT}/scripts/`; the full method is in the `polygraph` skill — follow it. The derived artifact is a SAM v2 strict-profile module (named intents/schemas/domains, keyed acceptors, observable `reject(reason)`, sealed model). The 1.x bare `next(state, action, data)` artifact was removed in 8.0.0 and is refused by every stage.

Inputs you expect (ask only if missing): a `contract.json` (or enough information to build one from `${CLAUDE_PLUGIN_ROOT}/templates/`), the source file under test, and a trace corpus directory. For generation you need `ANTHROPIC_API_KEY` and a model (recommend `opus-5`; if the API refuses the prompt on policy grounds, retry with `opus-4.8` — per-step source of truth: `RECOMMENDED_MODELS` in `scripts/models.mjs`).

Procedure:

1. **Validate the corpus** with `scripts/validate_corpus.mjs`. If chaining or terminal-state checks fail, stop and report — the traces are untrustworthy; do not proceed to modeling. 2. **Run controls if reference specs are provided**: a positive control must score 100% and a negative (mutated) control must fail only its target windows. If they do not, the corpus or the reference is wrong — report and stop. 3. **Run `scripts/verify.mjs`** in generation mode (`--model`, `--n 5`) or, if no key/model is available, in `--specs` mode over provided specs. Add `--tla` when the user wants the TLC escalation tier (needs `POLYGRAPH_JAVA`/`java` and `POLYGRAPH_TLA_JAR`; a missing toolchain is a report note, and the `.tla`/`.cfg` artifacts are still written). 4. **Triage** every non-consistent window from `out/findings.json`:

  • all specs disagree → code-finding (open the source at that pre-state and

action and describe what the code actually does) or contract-error (a driving field is missing from the observable state, or the trace uses an action the contract does not declare);

  • some specs pass, some fail → spec-error (a generation missed a rule; name

the rule);

  • unscoreable in all specs → generation problem, not a code problem;
  • use the v2 step classifications: `rejected(reason)` and

`identity-by-mutation` are the good no-op classes; `unhandled` (neither acted nor rejected) is itself a finding; a uniform rejection-reason on a code-finding window means the contract took a side — triage the contract first.

Return: the summary counts, a ranked list of code-findings with the exact (scenario, window, pre-state, action) and your reading of the source, the spec-errors with the missed rule named, and a one-line honest caveat that this is a consistency check, not a proof. Do not overstate: a clean run means observable behavior matches an independent reading of the source, over the declared finite (action, data) domains only — nothing more.

Read more
@cognitive-fab
Ships withpolygraph

Your tests check the paths you thought of. Polygraph checks the ones you didn't.

167 skills5 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
16
Star history of cognitive-fab/polygraph on GitHub, a chart by star-history.com

Other agents on polygraph.

polygen

polygen

Agent

Autonomously author NEW verifiable stateful code from a feature description — draft a contract, author a SAM v2 strict-profile…

polynv

polynv

Agent

Autonomously prepare an invariant-elicitation session — harvest candidate invariants from the contract vocabulary, traces, and…

polyvers

polyvers

Agent

Autonomously check whether a state-machine version change is safe against the live fleet — classify it into compatibility lanes,…

polyviz

polyviz

Agent

Autonomously render Polygraph verification artifacts into a clean, brand-consistent diagram set (SVG, optional PNG) and return…

More agents from other plugins.

bkend-expert

bkend-expert

Agent

bkend.ai BaaS platform expert agent. Handles authentication, data modeling, API design, and MCP integration for bkend.ai…

bkit2w606
@popup-studio-ai@popup-studio-aiInstall Agent
automate-agent

automate-agent

Agent

Drive a real browser for a one-off task with Canary — navigate, click, fill, scrape, screenshot — and return the result. Use when…

canary3w494
@0xnyn@0xnynInstall Agent

Questions about verifier.

Which coding agents can use verifier?
verifier installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.