aperion-shield is a free, open-source local MCP (Model Context Protocol) guardrail that sits between AI coding agents (such as Cursor, Claude Code, etc.) and real MCP servers (postgres, github, shell, filesystem, etc.). It is described as a reference implementation of "consequence-level control," designed to stop a destructive tools/call before it lands, rather than reading logs after the fact.
Purpose: To provide a local guardrail for AI coding agents to prevent destructive tool calls from executing; it also monitors the tool catalog and tool results to defend against rug pulls, tool poisoning, and prompt injection.
Main capabilities:
- Evaluates 65+ adaptive safety rules (plus an optional 40-rule community ruleset) on every tools/call, covering SQL, git, filesystem, secret exfiltration, supply chain RCE, reverse shells, sudo/privilege escalation, cloud (AWS/GCP/Azure), Kubernetes, Docker, IAM/cloud privilege escalation, anti-forensics (audit and log tampering), NoSQL/cache/search (Mongo, Redis, Elasticsearch, Cassandra), disabling host security controls, Windows/PowerShell, and other destructive surfaces.
- Blocks, requests approval for, or allows calls with a warning banner.
- Since v0.9, reverse monitoring: the tool catalog uses TOFU pinning to prevent rug pulls, scans descriptions for tool poisoning, and scans tool results for prompt injection.
- v1.0 adds --scan to audit before connecting to MCP servers, and --sandbox to restrict server processes at the OS level.
- v1.4 adds reversible secret masking: agents can reference real credentials as {{cloak:NAME}} placeholders, Shield replaces the real values only in frames forwarded upstream and erases them back to placeholders from results, so secrets do not enter the model context, transcripts, or prompt cache.
- v1.5 adds native Cursor/Claude Code PreToolUse hooks (fail-closed), --scan-ide for TrustFall project MCP + Skills, and curl -fsSL https://shield-get.aperion.ai | sh installation.
- v1.6 adds the Linux Landlock sandbox, Windows PATH shims, and Codex/Gemini CLI/Copilot CLI hooks.
- v1.7 adds the I/O offload gate (policy.io_offload.min_lines or APERION_SHIELD_OFFLOAD_MIN_LINES) and --summarize: refuses to load large files and hands them off to a cheap model for summarization.
- v1.8 adds post-tool hooks and post-read send checks: egress.after_secret_read asks about network sends after the session has read credentials; egress.after_injection asks when the session has seen injected tool output; egress.unlisted_host warns about other sends. Expands credential read coverage (browser cookies/login stores, macOS keychain, op read, gh auth token, dev configs, etc.). shield.self_tamper prevents agents from tampering with hook configuration.
- v1.9/v1.20 adds the --guard monitor (polls hook configuration, MCP configuration, and agent rule files, re-scans and restores Shield hook entries on change), --install-guard/--uninstall-guard (macOS launchd or Linux systemd --user), and --scan-ide coverage of rule files and extensions. Unifies permissionDecision: ask on Claude Code and Gemini, and permission: ask on Cursor, Codex, and Copilot.
- v1.3 adds cross-tool secret taint tracking: when credential-shaped values appear, appends SHA-256 hashes to the project-shared ledger .aperion-shield/taint.jsonl (original secrets are not stored); before outbound calls, looks up the ledger and, on a hit, escalates to at least Approval.
- v1.2.1 hardens the drift check probe: request IDs use bare random UUIDs, and polling intervals are jittered by ±20%.
- Optional biometric identity verification (ID.me or a pluggable OIDC provider) gates selected rules; can be registered with the Smartflow control plane via a singlecommand.
Usage:
- Install: curl -fsSL https://shield-get.aperion.ai | sh, then run --install-agent-hooks.
- Runs as a local stdio proxy, and since v0.9 also supports remote Streamable HTTP servers.
- Common flags: --scan, --sandbox, --cloak-add NAME, --cloak-list, --cloak-remove NAME, --no-cloak, --taint-ttl-secs N, --no-taint-tracking, --taint-list, --taint-flush, --summarize, --install-guard, --uninstall-guard, --guard-once, --check-hook, --check-hook-post, --check-staged, --check-cmd, --install-shims, etc.
- Policy configuration: shieldset files or environment variables (such as APERION_SHIELD_EGRESS_ALLOW, APERION_SHIELD_OFFLOAD_URL/_KEY).
- Bypass: SHIELD_HOOKS_DISABLE=1, SHIELD_SHIMS_DISABLE=1.
Applicable scenarios: engineers using AI coding agents in regulated and high-risk environments; teams that need to prevent agents from executing destructive commands (DROP TABLE, rm -rf, force-push, unscoped UPDATE/DELETE); organizations that need to audit and prove who approved destructive calls; scenarios in multi-MCP server sessions that need protection against "confused agent" attacks.
Limitations: taint tracking is heuristic (hash equality) correlation, not cryptographic taint propagation; the drift check probe does not claim to be undeceivable by a sufficiently determined targeted adversary (see SECURITY.md for details). Some features (such as biometrics and the Smartflow control plane) require additional configuration or depend on external providers. Specific charges, prices, and platform support details are not yet provided.