Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/cognitive-fab/polygraph/polyversgit clone --depth 1 https://github.com/cognitive-fab/polygraphWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00056 | $0.00976 |
| Opus 5 | $0.00028 | $0.00488 |
| Sonnet 5 | $0.00011 | $0.00195 |
| Haiku 4.5 | $0.00006 | $0.00098 |
Grade A, and why
polyvers scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Run polyvers over the arguments in $ARGUMENTS. This is the VERSIONING side
of the method (Polygraph audits, polygen authors, polyrun executes, polyvers
EVOLVES): given two versions of a machine's artifact family, classify the
change, run exactly the gates its lanes require, and gate the deploy on the
compat-report. Everything is deterministic and needs no API key.
This drives ${CLAUDE_PLUGIN_ROOT}/polyvers/bin/polyvers.mjs:
node ${CLAUDE_PLUGIN_ROOT}/polyvers/bin/polyvers.mjs classify --old <dir> --new <dir> [--json]
node ${CLAUDE_PLUGIN_ROOT}/polyvers/bin/polyvers.mjs check --old <dir> --new <dir> \
(--snapshots <path> | --synthesize) [--max-states N] [--allow-bounded] [--out out/compat] [--json]
node ${CLAUDE_PLUGIN_ROOT}/polyvers/bin/polyvers.mjs migrate scaffold --old <dir> --new <dir> [--force]
node ${CLAUDE_PLUGIN_ROOT}/polyvers/bin/polyvers.mjs matrix \
--parent-old <dir> --parent-new <dir> --child-old <dir> --child-new <dir> --child-id <machineId>
An artifact dir holds contract.json + the SAM v2 module + optional
invariants.mjs, effects.manifest.json, effects.cjs, migrate.cjs —
exactly what polygen emits.
Workflow:
classifyfirst — it names the lanes (shape / vocabulary / intent / semantic / migration / composition) and the gates they demand, without running anything.- Pick the snapshot corpus honestly — fleet exports (
--snapshots:polyrun archiveoutput or state dumps; "live" means a FRESH export fed to this flag — polyvers never connects to a database) >--synthesize(BFS-reachable states of the OLD machine — the weakest tier: it contains only states the old MODEL says are reachable, which is exactly the assumption a landmine violates). Always tell the user which tier was used; the report records it. check— exit 0 is the gate. Read the report's failures BY LANE, and triage with this vocabulary: migration-defect (migrate.cjs is wrong — fix it), rule-regression (the new rules can hurt live state — the seeded model check's counterexample is the repro), meaning-gap (a live state has no honest image in the new version — escalate to the human with the named snapshots; NEVER auto-repair this one).- Shape change?
migrate scaffold, have the human fill/confirm the TODO holes and the MIGRATION-NOTE, re-runcheck(the migrate gate validates purity, acceptance, projection equality, state+transition invariants, then every downstream gate runs over the MIGRATED corpus).polyrun migrate(dry run, then--apply) remains the apply-time gate over live snapshots. - Parent/child machines?
matrixchecks the 2×2 rollout-window pairings of the spawn/completion protocol and its delivery (--parent-snapshots/--child-snapshotsseed fleet states into discovery and delivery).
A BOUNDED exploration is a failing gate unless the operator explicitly
accepts it with --allow-bounded. An empty corpus, a missing invariants
file, or an unreadable stimulus set are refusals, never vacuous passes. The
gates are exactly as good as the invariants the artifacts state — say so.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 59 lines · 56 tokens per session scan A dca39880914f
polyvers is a command published in the GitHub repository cognitive-fab/polygraph (11 stars, last pushed 5d ago), licensed Apache-2.0. It adds 56 tokens to every session and 976 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
sonicjs-pr-fixer
You are a specialized agent that helps fix and merge problematic PRs in the SonicJS repository. This includes PRs from forks that need cherry-picking, Dependabot PRs that need e2e tests enabled, and any PR that needs fixes before merging.
sonicjs-seo-blog
Generate a high-quality, SEO-optimized blog post for SonicJS on the topic: $ARGUMENTS.
upgrade-nodejs
This guide explains how to upgrade the Node.js version that Bun reports for compatibility with Node.js packages and native addons.
upgrade-webkit
Upgrade Bun's WebKit fork to the latest upstream version of WebKit.
dedupe
Find duplicate GitHub issues.
gh-debug-issue
../../.mastracode/commands/gh-debug-issue.md.