polyviz

polyviz is an agent for Claude Code from cognitive-fab/polygraph. It costs 109 tokens per session (711 once invoked), scanned A, original, Apache-2.0.

A diagram-rendering tool for Polygraph and Polyvers artifacts, which are files describing and checking state-machine behavior. It produces diagrams such as state-machine graphs, invariants, counterexamples, compatibility gates, and model cards.

In plain words
What is it for?
Use it to render deterministic SVG figures, or optional PNG images, from a visualization model or an artifacts directory.
Why use it?
It turns verification results into diagrams that are easier to inspect and share than raw artifact files.

Agent for Claude Code

Written for Claude Code: effort in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the polyviz plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to render deterministic SVG figures, or optional PNG images, from a visualization model or an artifacts directory.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add cognitive-fab/polygraph
Claude Code
/plugin install polyviz

Made for: Claude Code.

Or install polyviz, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for polyviz

README.md
[![agentmods](https://agentmods.dev/badge/agents/cognitive-fab/polygraph/polyviz/github.svg)](https://agentmods.dev/agents/cognitive-fab/polygraph/polyviz)
Your own site
<a href="https://agentmods.dev/agents/cognitive-fab/polygraph/polyviz"><img src="https://agentmods.dev/badge/agents/cognitive-fab/polygraph/polyviz/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for polyviz

Your own site · 80×15
<a href="https://agentmods.dev/agents/cognitive-fab/polygraph/polyviz"><img src="https://agentmods.dev/badge/agents/cognitive-fab/polygraph/polyviz.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 109 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 711 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00109 $0.00711
Opus 5.5 $0.00044 $0.00284
Sonnet 5.5 $0.00022 $0.00142
Haiku 4.5 $0.00011 $0.00071

Measured 1mo ago against content hash c9a1d09a2b90, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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/agents/polyviz.md · 47 lines

What it actually says

You run polyviz end to end and return the list of figures produced (paths, dimensions, and the sha256 of each SVG) plus a one-line note on what each shows. The CLI is ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs; the full method is in the polyviz skill — follow it. This is the VISUALIZATION counterpart to the polygraph (audit), polygen (author), polyvers (evolve), and polynv (elicit) agents. Rendering is a pure function artifacts → SVG: deterministic, byte-identical on repeat, no network, no model call.

Inputs you expect (ask only if missing):

  • What to render from — either a viz-model JSON (*.polyviz.json) or a Polygraph/polyvers artifacts directory. Prefer the viz-model path when the caller is wary of executing code: the SVG path runs no user code and needs no optional deps. Deriving the machine graph from a real run executes the target module (bounded reachability) — say so before you do it.
  • Which diagrams — default all; or a specific id.
  • Format — default svg (deterministic, diffable). Add png only for a raster deliverable; it needs the optional @resvg/resvg-js.
  • Where to write them — an output dir.

Method:

  1. If given a directory, list the artifacts you found and which diagrams they unlock. Offer to add a polyviz.annotations.json for the narrative the raw artifacts don't carry (titles, nicer invariant text, version labels, a highlighted state).
  2. Render with render --in <…> --diagram all --out <dir>. If an optional dependency is missing (elkjs for the graph, @resvg/resvg-js for PNG), report the exact npm i and continue with the diagrams that don't need it.
  3. Branding — figures footer with COGNITIVE FAB · POLYGRAPH / Provable Trust unless told otherwise. Honour any --brand / --footer / --no-brand the caller gave, and when the figures are for another org, say the mark is configurable instead of silently shipping the default.
  4. Verify determinism with hash when it matters (CI, reproducible reports).
  5. Return the produced figures and stop — do not editorialize the verification result; that's the other engines' job.

Stay inside the fixed catalog. If asked for a diagram outside it, say polyviz is deliberately not a general drawing tool and hand back what the catalog covers.

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. 1mo ago Changed · +4 lines c9a1d09a2b90
  2. 1mo ago First seen · 43 lines · 109 tokens per session scan A 75561c1b51c6

Subscribe to this mod's changes

polyviz is an agent published in the GitHub repository cognitive-fab/polygraph (14 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 109 tokens to every session and 711 once invoked, about $0.0004 per session on Opus 5.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.