polyviz

A renderer that turns verification results into diagrams, such as state-machine graphs, invariant summaries, counterexamples, compatibility gates, and model cards. It uses stored artifact data and produces SVG files, with optional PNG output.

In plain words
What is it for?
Use it to render selected diagrams, render all supported diagram types, choose a light or dark theme, export PNGs, or hash SVG output to check that rendering is deterministic.
Why use it?
It makes verification results easier to inspect while keeping the picture tied to the data that was actually checked. Repeated renders produce identical files and do not call a model or the network.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/cognitive-fab/polygraph/polyviz
Any agent
npx skills add cognitive-fab/polygraph --skill polyviz
Clone the repo
git clone --depth 1 https://github.com/cognitive-fab/polygraph

Made for: Claude Code, Codex.

Per session 206 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,312 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00206 $0.01312
Opus 5 $0.00103 $0.00656
Sonnet 5 $0.00041 $0.00262
Haiku 4.5 $0.00021 $0.00131

Measured 2d ago against content hash cf4d60f34b32, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

polyviz 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 2d ago.

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.

polyviz/skills/polyviz/SKILL.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

polyviz — visualize the verification, don't redraw it

polyviz is the VISUALIZATION side of the Polygraph method (Polygraph audits, polygen authors, polyrun executes, polyvers evolves, polynv elicits — polyviz draws). Every mark it emits traces to a field in a Polygraph artifact, so the picture cannot drift from the model that was actually checked. Rendering is a pure function artifacts → SVG: no Date.now(), no randomness, sorted keys — byte-identical on every run. An LLM may invoke polyviz; it never draws.

The CLI is ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs:

polyviz render --in <dir|polyviz.json> --diagram <all|state-machine|invariants|counterexample|compat-gate|model-card> \
               --out <dir> [--format svg[,png]] [--theme dark|light] [--tokens tokens.json] [--scale 2]
polyviz hash   --in <dir|polyviz.json> --diagram <...>     # sha256 per SVG, no files (determinism/CI check)
polyviz schema                                             # print the viz-model JSON Schema

Two ways to feed it

  1. A viz-model JSON (*.polyviz.json) — the stable contract (polyviz schema prints it). Pure viz-model → SVG: no user code executed, no optional deps needed for the SVG path. Best when you're authoring figures by hand or a tool already emitted a viz-model.

  2. A Polygraph/polyvers artifacts directory (--in <dir>) — adapters map the native artifacts to a viz-model:

    • contract.json + its SAM/next module → the machine graph. The contract has no edge list, so transitions are derived by a bounded, deterministic BFS that executes the module over its declared (action,data) domain. This runs the target module — only do it on a run you trust.
    • the invariants module (invariants.mjs) → the invariants panel.
    • a findings.json reporting a failure, resolved to its trace → the counterexample.
    • polyvers compat-report.json → the compat-gate. Drop a polyviz.annotations.json in the dir to supply the narrative the raw artifacts don't carry (titles, nicer invariant text, version-card labels, a highlighted state).

Read the full file on GitHub · 82 lines

Changes

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.

  1. 2d ago First seen · 82 lines · 0 tokens per session scan A cf4d60f34b32

Subscribe to this mod's changes

polyviz is a skill published in the GitHub repository cognitive-fab/polygraph (11 stars, last pushed 6d ago), licensed Apache-2.0. It adds 206 tokens to every session and 1,312 once invoked, about $0.0010 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.