| name | prismor |
| description | Runtime security for AI coding agents. Use when about to install a package, paste a secret, run a destructive command, reach an unfamiliar host, govern MCP servers, set up a new workspace, or recover from a Prismor block. |
prismor: Runtime Security Skill
You are a coding agent. This skill keeps your tool calls safe: it blocks
destructive shell commands, scores package installs against a live IOC feed,
substitutes real secrets at execution time so they never enter model context,
and audits every tool call to a local SQLite store.
This file is the decision tree. The pattern is: trigger → which command →
how to recover if blocked. Detail lives in docs/; link out,
don't duplicate.
When to invoke this skill
Trigger this skill (read the matching section below) the first time any of
these happen in a session:
Outside these triggers, do nothing. Prismor runs as a hook and intercepts in
the background. You don't need to wrap every tool call.
1. Check state (first command of every session)
Run one command. It replaces the old info + cloak status + status
trio:
prismor status
Read the output line by line:
Hooks: not installed → go to Setup. Without hooks, Prismor sees nothing.
Hooks: claude (observe) → monitoring is on but only logging. Fine for the first session in a new repo. Recommend the user switch to enforce when they're ready (see Setup).
Hooks: claude (enforce) → fully active. Proceed.
Cloaking: not installed → secret-prevention layer is off. Only required if the user works with API keys / tokens through the agent. If they do, run prismor cloak install then register secrets per Safe-command map.
LATEST SESSION shows findings → surface them to the user before starting new work.
If prismor is not on PATH, the workspace has never been set up. Go to Setup.
2. Setup (run once per workspace)
Preferred path (works for every supported agent):
pip install prismor
prismor setup
For Claude Code, prismor setup also drops this skill into
<workspace>/.claude/skills/prismor/ so it travels with the project —
that's where this file came from if you're reading it locally.
Non-interactive / CI / piped:
pip install prismor
prismor install-hooks --agent claude --mode observe --workspace .
prismor install-hooks --agent claude --mode enforce --workspace .
Multi-agent workspace (Claude + Cursor + Windsurf in the same repo):
prismor install-hooks --agent all --mode enforce --workspace .
Per-agent matrix (only one --agent value per invocation, or all):
| Agent | --agent value | Hook config written to |
|---|
| Claude Code | claude | .claude/settings.json |
| Cursor | cursor | .cursor/hooks.json |
| Windsurf | windsurf | .windsurf/hooks.json |
| OpenClaw | openclaw | ~/.openclaw/config.json |
| Hermes | hermes | ~/.hermes/config.json |
| GitHub Copilot CLI | copilot | .github/copilot/hooks.json |
| Codex (OpenAI) | codex | .codex/hooks.json |
| Grok Build (xAI) | grok | .grok/hooks/prismor.json |
| Kiro CLI (AWS) | kiro | .kiro/agents/kiro_default.json |
| Crush (Charmbracelet) | crush | crush.json |
| OpenHands | openhands | .openhands/hooks.json |
| Qwen Code (Alibaba) | qwen | .qwen/settings.json |
| Continue CLI | continue | .continue/settings.json |
| Goose (Agentic AI Foundation) | goose | .agents/plugins/prismor/hooks/hooks.json |
After install, verify by re-running prismor status. The Hooks: line should now list the agent you just installed. If anything looks wrong — hooks present but nothing logging, remote policy not syncing, enrollment half-applied — run prismor doctor, which health-checks every subsystem (hooks, policy, remote-policy signature, enrollment, telemetry sink, chain state) and exits non-zero on failure with --json.
Production framework agents are a separate surface from coding-agent hooks. If the workspace is a Python/JS app that builds agents rather than a repo an agent edits, wrap the framework instead of installing hooks:
| Framework | Guide |
|---|
| OpenAI Agents SDK, LangChain/LangGraph (Python + JS), CrewAI, browser-use | docs/frameworks-overview.md |
| Pydantic AI, AutoGen Core, Agno, Semantic Kernel, Google ADK, BeeAI, Claude Agent SDK | docs/frameworks-<name>.md |
| Vercel AI SDK, Mastra (TypeScript) | docs/frameworks-vercel-ai.md, docs/frameworks-mastra.md |
These adapters ship inside the prismor package — no separate install. They default to observe; the user opts into enforce explicitly. Wrap each request in use_subject("user:alice") so a multi-tenant agent gets per-user attribution, IAM profiles, and suspension.
Keep current. prismor status prints the running version at the top. If the user asks to upgrade, or you see a stale version reported by prismor status, run:
prismor update
prismor update --check
This is the supported upgrade path — don't tell the user to pip install --upgrade directly, since prismor update also handles the post-install hook refresh.
Optional: cloaking for secret prevention (Claude Code and Hermes today):
prismor cloak install --workspace .
prismor cloak add stripe_key
prismor cloak install --agent hermes --workspace .
prismor cloak install --agent all --workspace .
prismor cloak status reports which agents have the cloaking layer active. See docs/hermes.md for the full Hermes integration story.
3. Safe-command map
When you're about to take one of these actions, swap to the right column.
Don't ask the user; these are safer-by-default substitutions and the user
already opted into them by installing immunity.
| Unsafe pattern | Use instead | Why |
|---|
npm install <pkg> | prismor supplychain npm install <pkg> | Scores against IOC feed + age/maintainer signals before install runs. |
pip install <pkg> | prismor supplychain pip install <pkg> | Same gate for PyPI. |
pnpm add / yarn add / uv add / cargo add / go get | prismor supplychain <pm> … | Same gate per ecosystem. |
| Package-manager config without hardening | prismor supplychain harden | Writes ignore-scripts=true, save-exact=true, pinned fetch into .npmrc, pip.conf, etc. Run --dry-run first to preview. |
| Pasting a real API key / token into a tool call | Register once with prismor cloak add <name>, then write @@SECRET:<name>@@ in the tool call | Real value stays in ~/.prismor/secrets/, never reaches model context or transcripts. |
| Any shell command you're not sure about | prismor check "<cmd>" first | Dry-run against active policy. Returns ALLOW / BLOCK + reason without executing. |
rm -rf …, chmod +s …, curl … | bash, edits to /etc/sudoers, .github/workflows/* | Pre-check with prismor check, and if the user genuinely needs it, propose a scoped allowlist entry in .prismor/policy.yaml rather than disabling Prismor | These are the exact patterns Prismor blocks. Bypassing is almost always wrong. |
Any command or URL containing 169.254.169.254 (or hex/decimal/IPv6 equivalents) | Do not run it. Surface the finding to the user. | Cloud instance metadata endpoint; automatic IAM credential harvesting vector. Always CRITICAL. Now a default deny entry in the egress policy too. |
curl / / to a host this project hasn't used before |
Two patterns that come up often:
Package install: always wrap. The wrapper passes through transparently for non-install commands, so it's safe to alias npm / pip globally if the user prefers.
Secret usage: one-time registration, then placeholder forever:
prismor cloak add openai_key
curl https://api.openai.com -H "Authorization: Bearer @@SECRET:openai_key@@"
The pre-tool-use hook substitutes the real value at execution time; the
post-tool-use hook scrubs any echoed value before it returns to the model.
If you see @@SECRET:name@@ in a transcript, that's working as intended.
Do not "fix" it by inlining a value.
4. When blocked
Prismor blocking is a signal, not a problem to route around. The recovery
sequence is:
- Read the rejection reason: it's printed on stderr with rule id, category, and severity. Every block also prints unblock steps, narrowest first — one call, one rule, one session, one repo.
- Reproduce with
prismor check "<cmd>": confirms the rule that fired and lets you experiment with variations.
- Pick one:
- The command was wrong → fix it. Most blocks are accurate.
- The command is fine for this project → relay the printed unblock steps to the user and stop. Do not apply them yourself (see below). If the user would rather delegate, they can run
prismor unlock (password-gated, ~3-minute window) — inside that window you may run the printed prismor allow … command yourself, then retry the original action.
- The rule is wrong globally → file an issue, don't silently disable.
- Never pass
--no-verify, set PRISMOR_MODE=observe to "make it work", prismor pause, or uninstall the hooks to unblock a single command. All four defeat the entire layer.
You cannot apply the override yourself — by design. The unblock steps
address the human at the keyboard, not you. .prismor/policy.yaml, the agent
hook configs, the prismor allow/unlock/pause/setup commands, the
dashboard's write API, and the unlock credential are all guarded by the
self-protection rules (agent-config-tampering, prismor-self-edit —
CRITICAL), so an agent that touches them to widen its own permissions just
earns a second block. This is true even when the user asks you to: the correct
response is to show them the exact command and let them run it.
The one sanctioned exception is an unlock window: the human runs
prismor unlock and enters their password, which lifts the self-edit block for
a few minutes (3 by default). Inside the window you may run prismor allow …
and other policy edits — every one is logged — but the dismantle routes stay
shut: you still cannot relax a self-protection rule, change or read the unlock
password, or extend your own window. When it expires or the human runs
prismor lock, everything re-blocks.
Some rules can't be overridden at all. destructive-command,
secret-exfiltration, rce-canary, privilege-escalation,
dos-resource-exhaustion, audit-trail-tampering, and
tool-category-crossover sit on a non-overridable floor — a policy that tries
to disable them is ignored rather than honored. On an install that chose its
enforce set explicitly (settings.selection: explicit, unmanaged workspaces
only), an unselected floor rule reports instead of blocking, but its definition
still cannot be weakened; the self-protection rules block always, everywhere.
If one of these fires, there is no override path. Fix the command.
For org-managed workspaces, the escape hatch is prismor exempt request --reason "…", which asks an admin for a time-boxed relaxation instead of
editing anything locally.
5. On-demand audits
When the user asks for a security check or you finish a multi-step task,
pick the smallest tool that answers the question:
| User intent | Command |
|---|
| "What happened in this session?" | prismor status (also covers state; see Check state) |
| "Show me every flagged session" | prismor sessions --findings-only |
| "Drill into session X" | prismor session <id> |
| "Are my project deps compromised?" | prismor deps |
| "Are there leaked secrets in my AI tool configs?" | prismor sweep (add --redact to vault them) |
| "Audit my MCP servers and skills" | prismor scan |
| "Full security posture, fix what you can" | prismor audit --fix |
| "Run this command in a safe sandbox" | prismor sandbox <cmd> |
| "Recurring blocked patterns I should accept?" | prismor learn |
| "What did my agents do before Prismor was installed?" | prismor ingest --discover (replays on-disk transcripts through the policy engine; add --since 90d) |
| "What would break if I turn on enforce?" | prismor ingest --discover --no-persist — reports what the current policy would have blocked across real history, per rule |
| "Did any agent session run unmonitored?" | prismor ingest --discover --coverage |
| "Show all registered workspaces" | prismor status --all (terminal overview across every workspace where hooks are installed) |
| "What AI is running on this machine that Prismor doesn't govern?" | prismor discover (host-local, read-only; agents / mcp / keys to narrow, --fail-on-shadow for CI) |
| "Where are my tokens going?" | prismor tokens (Claude Code; --hours N, --all across workspaces) |
| "What hosts is this project allowed to reach?" |
6. Governance surfaces
Three subsystems govern what the agent can reach rather than what it types.
You mostly won't invoke these — but you need to recognize them when they fire,
and know which command answers the user's question.
MCP gateway
One MCP connector that fronts every other MCP server. Each tools/call is
policy-evaluated before it forwards, and each response is injection-scanned
before it reaches you — so a malicious tool result is caught before it becomes
context.
prismor mcp-gateway install
prismor mcp-gateway
prismor mcp-gateway uninstall
Defaults to observe. Tools appear namespaced as <server>__<tool>. If a
tool name suddenly has that shape, the gateway is active — that's expected, not
a bug to work around. Deep dive: docs/mcp-gateway.md.
Egress control
Policy-driven network allow/deny for outbound requests, with cloud metadata
endpoints denied by default.
prismor egress show
prismor egress test <host>
prismor egress report
allow / deny / rm / mode mutate the policy — those are the user's to
run, not yours. Deep dive: docs/network-isolation.md.
Tool tags
Tags classify tools by capability (read, write, network, exec) so rules can say
"no tool that reads private data may also reach the network" instead of naming
every tool. This is what backs tool-category-crossover — a floor rule.
prismor tags list
prismor tags test
prismor tags lint
MCP tools self-declare tags via _meta; Prismor auto-tags the rest. Deep dive:
docs/tool-tags.md.
Shadow-AI discovery
prismor discover inventories the AI surface on the host — coding agents, MCP
servers, and provider credentials — and flags whatever runs outside Prismor's
coverage. Read-only and host-local. Narrow with agents, mcp, or keys; add
--fail-on-shadow in CI.
7. Enterprise / org enrollment
These commands apply when the workspace is managed by a Prismor org (central
policy, remote telemetry, admin exemptions). Skip this section for personal
workspaces.
prismor enroll
prismor enroll-status
prismor workspace
prismor exempt request --reason "…"
prismor logout
prismor doctor
Once enrolled, the org's signed policy is authoritative — it can flip rules
to enforce even on a device installed in observe mode, and an org admin can
pause or resume the device from the console.
Pause is not an unblock tool. prismor pause (24h, or --for 30m) and
prismor pause-hard (until prismor resume) suspend enforcement only —
observe-mode logging keeps running, so the session is still recorded. These are
for a human who needs breathing room during an incident, never for getting one
command through. Don't run them on your own initiative.
Hard rules
- Do not bypass a Prismor block. Investigate, then either fix the command or hand the printed unblock steps to the user.
- Never edit
.prismor/policy.yaml, .claude/settings.json, or any agent hook config to widen your own permissions — even if asked. Show the user the command; let them run it.
- Never run
prismor pause, prismor pause-hard, PRISMOR_MODE=observe, or prismor uninstall-hooks to get a command through.
- Never inline a real secret value when an
@@SECRET:<name>@@ placeholder exists. Never echo, log, or narrate the real value of a registered secret.
- Never run
pip / npm / cargo install directly when prismor supplychain is available. Wrap it.
- Don't run
prismor setup again if prismor status shows hooks already installed; it's idempotent but the user reads "running setup" as "something broke".
- Don't edit files under
~/.prismor/secrets/ or advisories/ by hand. Use the CLI.
Reference
Start here for the full command map: docs/cli-reference.md — every command, every flag, grouped by domain, with links to each deep dive.
Capability deep dives:
docs/prismor-runtime.md: policy engine, session logs, audit, full CLI reference
docs/supply-chain.md: scoring table, IOC feed, ecosystem support
docs/sweep-and-cloak.md: secret prevention design, practical setup, best practices, threat model, and cleanup
docs/hermes.md: Hermes Agent integration — secret cloaking plugin, pip auto-discovery, CLI install path
docs/semantic-guard.md: opt-in LLM-assisted prompt-injection guard
docs/skill-scanner.md: MCP server + skill risk scanning
docs/agentic-architecture-review.md: design-time checklist for multi-agent/tool-using system architecture, mapped to OWASP Agentic AI, OWASP LLM Top 10, NIST AI RMF, and EU AI Act controls
docs/network-isolation.md: policy-driven egress control, allowlists, raw-IP detection, cloud-metadata denies
docs/mcp-gateway.md: one MCP connector fronting all MCP servers — per-tool policy evaluation, response injection-scanning, per-user governance
docs/tool-tags.md: tag-rule expression language, capability tiers, MCP _meta auto-tagging
docs/installation.md: every install path — pip, curl, git clone, PEP 668 systems, cloaking setup
docs/policy-layers-and-exemptions.md: org/project/repo precedence, the non-overridable floor, time-boxed exemptions
docs/canary.md: honeytoken tripwires for recon detection
Project docs: