🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman
Runtime security control plane for AI agents
Prismor sits in front of agent tool use and evaluates each action against your policy before it executes. It can run in observe mode, require human approval, block risky calls, and write signed audit records for later review.
Builders who use Claude Code, Codex, Cursor, Gemini CLI, or other agent frameworks and want policy checks around tool use.
You can stop risky agent actions before they execute and review what happened in a local dashboard.
What it does
Per-rule observe and enforce
Each policy rule can log only or block in real time, so you decide exactly what stops the agent.
MCP gateway and guardrails
A single MCP connector can front other servers, scan responses for injection, and block specific tools or servers.
Supply-chain and network checks
It scores package risk, watches egress, and can block unsafe installs or network calls.
Signed audit trail
Every agent action is hash-chained and Ed25519-signed so the history can be verified later.
Local and remote dashboards
You get a terminal and web dashboard for session forensics, telemetry, status, and approvals.
Agent adapters and hooks
Adapters and runtime hooks let Prismor protect coding agents and framework-based agents across different runtimes.
Transcript ingest and learning
It can replay past sessions through the live policy engine and suggest new rules from session history.
Canary and secret cloaking
It plants honeytokens and masks sensitive output so secret reads and leaks are easier to catch.
How to get it
- 1Run
pip install prismor prismor setup
README
Prismor
Runtime security for Claude Code, Codex, Langchain and other AI agents frameworks/harness.
Prismor is highly customizable based on user's own policies. Observe or enforce mode to see agent activity in a local self-serve dashboardWebsite • Onboard with Skill
Plus Grok Build, Crush, OpenHands, Qwen Code, Continue CLI, Goose, Hermes, OpenClaw, Devin CLI, Factory Droid, Aider, and more — see AGENT_INTEGRATIONS.md for the full coverage matrix
The Problem
AI coding agents execute shell commands, read and write files, access credentials, and call external APIs. They do this autonomously, often across many steps, with limited checkpoints.
This creates risks that traditional security tooling isn't designed for:
- Prompt injection - malicious content in a file, issue, or web page can redirect the agent mid-task
- Unintended destructive actions - an agent misinterprets an instruction and runs something irreversible
- Secret exfiltration - an agent reads
.envor credential files as part of a debugging task and sends the content outbound - Privilege escalation - an agent modifies sudoers, CI pipelines, or file permissions to resolve a permission error
- Dependency manipulation - an agent installs or rewrites a package at the direction of injected input
- Supply chain risk - an agent installs a vulnerable or 0-day package while optimizing for code velocity
Standard OS-level and endpoint security tools monitor the kernel and filesystem. By the time they see an action, the agent has already decided to take it. The gap is at the agent layer for avoiding the attack
Quick Start (30s)
pip install prismor
prismor setup
For the Skill, curl, and git-clone alternatives, plus PEP 668 systems and secret-cloaking setup, see the full installation guide.
Capabilities

- 🛡️ Prismor covers the policy engine, session logs, security audit, and CLI reference
- 📦 Supply Chain covers install-time enforcement, IOC matching, and risk scoring
- 🛜 Network Isolation covers policy-driven egress control, raw IP detection, and tunnel blocking
- 🔍 Skill Scanner covers MCP server and skill risk scanning across supported agents
- 🚦 MCP Guardrails let you block a specific MCP server or tool, or require human approval before the agent calls it, with a policy rule you write yourself
- 🛰️ MCP Gateway is a single MCP connector that fronts every other MCP server you use — each
tools/callis policy-evaluated before it forwards and each response is injection-scanned before the model sees it, so a poisoned tool result never becomes context.prismor mcp-gateway installmoves an existing.mcp.jsonbehind it - 🛤️ LLM Proxy governs an agent Prismor cannot hook, through the one thing every agent has: its model traffic. Point it at
prismor proxywithANTHROPIC_BASE_URL,OPENAI_BASE_URL, or the Google Gen AI SDK'sHttpOptions(base_url=...)and nothing else about the agent changes. Every tool call the model proposes — Anthropictool_use, OpenAItool_calls, GeminifunctionCall— is reshaped into the same event aBashhook produces and judged by the same rule, with streamed calls held until they can be judged - Claude Inference Hooks makes Prismor the AI security server behind Claude Enterprise: Anthropic sends every governed prompt from claude.ai, Claude Code and Cowork to
prismor inference-hook serve, which runs your policy on the transcript and answers allow/deny before the model runs — signed requests (Standard Webhooks), fail-closed, shadow mode, nothing to install on user devices.prismor inference-hook testsends signed sample frames to check the wiring - 🏷️ Tool Tags classify tools by capability (read, write, network, exec) so a rule can say "nothing that reads private data may also reach the network" instead of naming every tool one by one — MCP tools self-declare via
_meta, andprismor tagslists, tests, and lints the rule expressions - 🔐 Sweep and Cloak covers secret prevention at tool boundaries, practical setup, best practices, threat model, and cleanup for leaked secrets
- 🦞 OpenClaw Integration covers runtime hooks, prompt-injection scanning, and project or user-scope setup for OpenClaw
- 🤖 Hermes Agent Cloaking covers Hermes-specific secret cloaking with pip entry-point auto-discovery, filesystem install, and pre_gateway_dispatch paste guard
- 🧠 Semantic Guard: opt-in hybrid layer that adds an LLM-assisted intent check for paraphrased prompt-injection attempts the regex rules cannot catch
- 🪤 Canary plants honeytoken credential files that trip a CRITICAL finding the moment an agent reads them, catching recon behavior
- 🪪 IAM gives each agent a named identity and least-privilege permission profile when several agents share a workspace
- 🧩 Framework Agents guards production agents (OpenAI Agents SDK, LangChain/LangGraph in Python and JS, CrewAI, browser-use, Pydantic AI, AutoGen Core, Agno, Semantic Kernel, Google ADK, BeeAI, Claude Agent SDK, Vercel AI SDK, Mastra) with one call — wrap each request in
use_subject("user:alice")and a multi-tenant agent gets per-user attribution, per-user IAM profiles, and per-user suspension - 🎯 Scoped Agent synthesizes minimal, task-specific rules per session so an injected pivot off-task gets blocked
- 🧬 Learning mines session history to propose new rules, flag false positives, and detect evasion
- ⚖️ Layered Policy & Exemptions covers per-rule observe/enforce, the non-overridable floor, and admin-granted, time-boxed exemptions across org / project / repo layers
- 🔐 Explicit enforce selection & the unlock window — enforce setup starts with nothing blocking and you pick the set;
prismor allowmakes narrow exceptions, andprismor unlockopens a password-gated, time-boxed window in which an agent may edit policy (never the self-protection rules that guard Prismor itself) - 📡 Live Telemetry covers the optional enterprise control-plane link — device enrollment, signed remote policy, and redacted telemetry streamed to a self-hosted org dashboard
- 🔌 Telemetry Sinks forward every finding to what you already run — an OpenTelemetry collector (OTLP/HTTP logs), Splunk HEC, Datadog, syslog, a webhook, or a local file in JSON/CEF/OCSF — dispatched before the blocking decision and never able to stall a tool call
- 📊 Dashboard covers the terminal and local web dashboards plus session forensics, with
prismor tokensbreaking down where a session's context and token spend actually went - 🩺 Health and Recovery —
prismor doctorhealth-checks every subsystem (hooks, policy signature, enrollment, telemetry sink, chain state), andprismor pause/pause-hardsuspends enforcement only for a human during an incident while observe-mode logging keeps running - 🧾 Signed Audit Trail hash-chains and Ed25519-signs every agent action locally, so
prismor trail verifyproves the history hasn't been edited, deleted, or rewritten - 🔖 Signed Telemetry Receipts is the wire schema for the records a device reports — canonical bytes, the two integrity layers, and a dependency-free reference verifier, so a SIEM or an auditor can check a receipt without Prismor
- 📑 Attestation Bundle packages posture, agent inventory, host discovery, framework-control coverage (OWASP LLM/Agentic, NIST AI RMF, EU AI Act), and the trail anchor into one Ed25519-signed file an auditor re-verifies with
prismor attest verify - 🔦 Host Discovery sweeps the machine with
prismor discoverand flags any AI agent running without Prismor hooks (shadow AI) - ⏪ Transcript Ingest reconstructs what your agents did before Prismor was installed —
prismor ingest --discoverreplays on-disk session transcripts through the live policy engine, so the dashboard is populated on day one and you can see exactly what flipping a rule to enforce would have blocked, plus--coveragefor sessions that ran unmonitored - 🗺️ Agentic AI Architecture Review is a design-time checklist for multi-agent/tool-using systems — permission scope, memory integrity, inter-agent trust, human-oversight placement — each item mapped to a real control ID and, where one exists, the Prismor rule that backstops it
- 🐳 Docker and Containers covers container hardening, prerequisites, and known limitations
Full command map across every capability: CLI Reference.
These capabilities map to the OWASP Top 10 for LLM Applications - covering prompt injection (LLM01), sensitive information disclosure (LLM02), supply chain (LLM03), improper output handling (LLM05), and excessive agency (LLM06).
Scenarios and Use Cases
Real workflows with the commands and config that make them work — onboarding a team in observe mode, per-user IAM attribution for multi-agent and framework pipelines, shadow AI discovery, step-up approval for high-stakes operations, and generating a signed attestation bundle for a compliance audit. See USE_CASES.md.
Configuration
Command Reference
Full command map: docs/cli-reference.md.
Governance Modes
prismor setup asks you to pick one posture instead of configuring six policy axes by hand. Each compiles into .prismor/policy.yaml — enforcement, egress, tool access, tag rules, sandbox and data boundary together.

| Mode | For | Coverage | Friction |
|---|---|---|---|
dev-safe | Feature work on code you haven't read | 31% | 9% |
trusted-workspace | Trusted internal repos, local Docker work | 34% | 9% |
regulated-airgap | PII/PHI, SOC 2, EU AI Act — no network, no shell | 100% | 90% |
prismor mode list # compare the three
prismor mode explain dev-safe # the trade, including what it does NOT stop
prismor mode apply dev-safe # compile it into this workspace
prismor mode apply regulated-airgap --observe # what it would block, blocking nothing
Every mode states its residual risk. Full breakdown: docs/modes.md.
Observe / Enforce (per-rule, policy-authoritative)
Enforcement is decided per rule by your policy, not by a single global switch. Each rule carries a mode, and settings.default_mode (default observe) covers any rule that doesn't set one:
| Mode | Behavior |
|---|---|
observe (default) | Logs the tool call and the finding. Never blocks. Safe for onboarding and auditing. |
enforce | Blocks the action in real time before the agent executes it. |
Out of the box everything observes — nothing is blocked until you flip rules (or default_mode) to enforce in your policy:
# .prismor/policy.yaml
settings:
default_mode: observe # global default for rules without their own mode
rules:
- id: destructive-rm-rf
mode: enforce # this rule blocks; the rest still just observe
Policy is authoritative: a rule set to enforce blocks regardless of how the hook was installed (--mode), so an admin who flips a rule to enforce via the control plane blocks even on observe-installed devices. See Layered Policy & Exemptions for org / project / repo precedence and the non-overridable floor.
prismor setup makes the choice explicit rather than implied: an observe install ships with the defaults on, while an enforce install starts with nothing selected and asks you to pick what blocks (the safety floor is pre-marked recommended — press a to take it). Your selection is written to .prismor/policy.yaml as settings.selection: explicit plus one line per rule, so what blocks is readable in the file. When a rule then blocks something legitimate, the deny message prints the exact prismor allow <rule> --pattern '<literal>' that fixes it — for the human to run; agents are stopped from editing Prismor's own config by always-on self-protection rules, unless the human opens a short password-gated window with prismor unlock. See Choosing what blocks and Making exceptions.
The install flag still sets the starting posture, and an observe install combined with PRISMOR_LOCAL_DRY_RUN=1 acts as a local dry-run kill-switch that suppresses all blocking:
prismor install-hooks --agent all --mode observe # start in observe everywhere
prismor install-hooks --agent all --mode enforce # honor policy enforce rules
Upgrading from a pre-
moderelease? Backward compatibility is preserved: a policy that predates per-rule modes (it setssettings.block_categoriesbut nodefault_modeand no rule-levelmode) keeps its original behavior — those categories still block when installed with--mode enforce. The moment your policy adopts the per-rule model (anymode/default_mode), it becomes fully policy-authoritative as described above.
Architecture
Every tool call takes the same path: it enters through an integration surface (stage 1), is evaluated before it executes (stage 2), produces an allow/warn/block verdict, and lands in tamper-evident evidence (stage 3). Stage 4 is optional — a self-hosted control plane whose signed policy becomes authoritative for stage 2 once a device is enrolled.
flowchart TD
%% ── sources ────────────────────────────────────────────────
subgraph SRC["Agents Prismor protects"]
direction LR
AC["<b>Coding agents</b><br/>Claude Code · Codex · Cursor · Windsurf · Copilot<br/>OpenClaw · Hermes · Grok · Kiro · Crush<br/>OpenHands · Qwen · Continue · Goose"]
AF["<b>Production frameworks</b><br/>OpenAI Agents · LangChain / LangGraph · CrewAI · browser-use<br/>Pydantic AI · AutoGen Core · Agno · Semantic Kernel · Google ADK<br/>BeeAI · Claude Agent SDK · Vercel AI SDK · Mastra"]
end
%% ── stage 1 ────────────────────────────────────────────────
subgraph ENTRY["Stage 1 · Integration surface"]
direction LR
H(["<b>Runtime hooks</b><br/>pre / post tool-call<br/>per-agent config"])
G(["<b>MCP gateway</b><br/>fronts every MCP server<br/>injection-scans responses"])
F(["<b>Framework adapters</b><br/>in-process + HTTP eval server<br/>per-user via use_subject"])
end
%% ── stage 2 ────────────────────────────────────────────────
subgraph EVAL["Stage 2 · Evaluated before the call executes"]
direction TB
D(["<b>Tool-call dispatcher</b>"])
P["<b>Policy engine</b><br/>YAML rules · per-rule observe / enforce<br/>layered org → project → repo · non-overridable floor"]
CHK["<b>Pre-execution checks</b><br/>Semantic guard · Egress control · MCP guardrails · Tool tags<br/>IAM and agent controls · Scoped session rules<br/>Script-content inspection · Docker sandbox"]
SEC["<b>Secret and supply-chain protection</b><br/>Cloak placeholders + output scrub · Env guard · Sweep<br/>Canary tripwires · Skill scanner<br/>Supply-chain scoring → npm · pip · cargo · go"]
end
FEED[/"Signed advisory feed · Prismor intel + NVD"/]
V{"<b>Allow · Warn · Block</b><br/>every block prints narrowest-first unblock steps"}
%% ── stage 3 ────────────────────────────────────────────────
subgraph EV["Stage 3 · Evidence and feedback"]
direction LR
ST[("<b>Session store</b><br/>SQLite + JSONL<br/>session forensics")]
VIEW["<b>Views</b><br/>Web + terminal dashboard<br/>Status · Tokens · Audit · Doctor"]
PROOF["<b>Tamper-evident</b><br/>Signed trail — hash chain + Ed25519<br/>Attestation bundle · Host discovery"]
LEARN["<b>Learning</b><br/>propose rules · flag false<br/>positives · detect evasion"]
end
PAST[/"Transcript ingest · replays pre-install history through the live policy"/]
%% ── stage 4 ────────────────────────────────────────────────
subgraph ORG["Stage 4 · Optional self-hosted control plane"]
direction LR
RP["<b>Signed remote policy</b><br/>layered rules · time-boxed<br/>exemptions · pause / resume"]
TEL["<b>Live telemetry</b><br/>redacted events<br/>offline spool"]
OD["<b>Org dashboard</b><br/>policy · devices<br/>sessions · approvals"]
end
%% ── flow ───────────────────────────────────────────────────
AC --> ENTRY
AF --> ENTRY
ENTRY --> D
D --> P
P --> CHK
P --> SEC
FEED -.-> SEC
CHK --> V
SEC --> V
V --> ST
PAST -.-> ST
ST --> VIEW
ST --> PROOF
ST --> LEARN
LEARN -.->|"proposed rules"| P
RP ==>|"authoritative once enrolled"| P
ST -->|"redacted"| TEL
TEL --> OD
One policy engine, every enforcement surface
Stage 1 has more than one door, and that is deliberate: no single interposition point covers every agent. Hooks are the widest but not every host offers them; MCP is the only place some agents can be intercepted at all; production framework agents run where there is no host to hook.
So each surface normalizes what it saw into one canonical event and asks the same evaluator for a verdict. A rule written once covers the same action however it arrives.
| surface | what it governs | refuse | rewrite input | redact output |
|---|---|---|---|---|
| Coding-agent hooks | an agent's entire tool surface | yes | Claude/Qwen | no |
| MCP gateway | every MCP server behind one connector | yes | yes | yes |
| Mirrored built-ins | the agent's own Bash/Read/Write, over MCP | yes | yes | yes |
| Framework SDK adapters | in-process agents (13 frameworks) | yes | no | no |
prismor eval-server | non-Python callers, external proxies | yes | yes | yes |
| Inference-hook channel | hosted transcript-turn webhook | yes | no | no |
"Redact output" is why the mirror exists: a pre-action hook can only refuse a file read, while a surface that carries the response can return the file with the credential masked.
This is checked rather than asserted — tests/test_surface_conformance.py
replays one action through each surface's own normalizer and fails if they
disagree on the verdict or the rule.
See the decision contract for the event shape and verdict vocabulary, and [governance surf
Files in the repo
- .github
- adapters
- advisories
- assets
- bin
- docs
- examples
- keys
- packaging
- pipeline
- prismor
- scripts
- supplychain
- templates
- tests
- .gitattributes
- .gitignore
- AGENT_INTEGRATIONS.md
- AGENTS.md
- benchmark.md
- CHANGELOG.md
- CLAUDE.md
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- immunity-agent.pth
- LICENSE
- LLM_FRAMEWORK_COVERAGE.md
- package.json
- PYPI.md
- pyproject.toml
- README.md
- requirements.txt
- SKILL.md
- TODO.md
- USE_CASES.md
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tools
The best-benchmarked open-source AI memory system. And it's free.
Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.