protect-mcp-setup
Was er macht
Dieses Tool sorgt dafür, dass die Aktionen eines KI-Agenten sicher und nachprüfbar sind. Es prüft bei jedem Befehl, den der Agent ausführen will, ob er den festgelegten Regeln entspricht, und erstellt einen signierten Nachweis über alles, was passiert ist.
Wann du ihn nutzt
- ✓Wenn du ein Projekt einrichtest, das zusätzliche Sicherheit braucht.
- ✓Wenn es wichtig ist, nachweisen zu können, dass die Aktionen des Agenten genehmigt waren.
- ✓Damit der Agent keine gefährlichen Befehle ausführt.
Link zum Skill
https://github.com/wshobson/agents/blob/main/plugins/protect-mcp/skills/protect-mcp-setup/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Richte Sicherheit und Protokollierung für die Tools von Claude Code ein.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Vor jedem Befehl prüft ein System, ob er durch die Regeln erlaubt ist. Nachdem der Befehl ausgeführt wurde, wird ein signierter Nachweis mit den Informationen zum Befehl erstellt.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
protect-mcp — Policy Enforcement + Signed Receipts
Cryptographic governance for every Claude Code tool call. Each invocation is evaluated against a Cedar policy and produces an Ed25519-signed receipt that anyone can verify offline.
Overview
Claude Code runs powerful tools: Bash, Edit, Write, WebFetch. By default
there is no audit trail, no policy enforcement, and no way to prove what was
decided after the fact. protect-mcp closes all three gaps:
- Cedar policies (AWS's open authorization engine) evaluate every tool call before execution. Cedar deny is authoritative.
- Ed25519 receipts record the name of each tool that ran, signed with your key.
- Offline verification via
npx @veritasacta/verify. No server, no account, no trust in the operator.
Problem
AI agents make decisions that affect money, safety, and rights. The Claude Code session log records what happened, but the log is:
- Mutable — anyone with access can edit it
- Unsigned — there is no way to prove integrity
- Operator-bound — verification requires trusting whoever holds the log
For compliance contexts (finance, healthcare, regulated research), this is not sufficient. You need tamper-evident evidence that can be verified by third parties without trusting you.
Solution
Add protect-mcp to your Claude Code project:
# 1. Install the plugin (adds hooks + skill to your project)
claude plugin install wshobson/agents/protect-mcp
# 2. Create ./protect.cedar (see below). The plugin installs the hooks.
# 3. Create the signing key once (protect-mcp 0.7.4 sign does not create it).
# An existing key is never replaced. See references/receipt-format.md to rotate.
if [ ! -e ./protect-mcp.key ]; then
d=$(mktemp -d) && npx protect-mcp@0.7.4 init --dir "$d" && mv "$d/keys/gateway.json" ./protect-mcp.key
fi
echo "/protect-mcp.key" >> .gitignore
# 4. Use Claude Code normally. Every tool call is now policy-evaluated
# and produces a signed receipt in ./receipts/
Hook Configuration
Installing the plugin adds both hooks from hooks/hooks.json. Each hook runs a
script bundled with the plugin:
{
"hooks": {
"PreToolUse": [
{
"matcher": ".*",
"hooks": [
{ "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}\"/hooks/evaluate.sh" }
]
}
],
"PostToolUse": [
{
"matcher": ".*",
"hooks": [
{ "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}\"/hooks/sign.sh" }
]
}
]
}
}
Claude Code passes the hook event to the command as JSON on stdin and does not
set TOOL_NAME or TOOL_INPUT variables. evaluate.sh reads tool_name and
tool_input from that payload and passes them to protect-mcp as flags; sign.sh reads
tool_name only, because the 0.7.4 signer records nothing else. Set
PROTECT_MCP_POLICY, PROTECT_MCP_RECEIPTS, and PROTECT_MCP_KEY to change the
default paths. When the policy file is missing, the PreToolUse hook prints a
warning to stderr and allows the call.
What each hook does
PreToolUse — Runs BEFORE the tool executes. Evaluates the tool call against
your Cedar policy file. If Cedar returns deny, the hook exits with code 2 and
Claude Code blocks the tool call entirely.
PostToolUse runs AFTER the tool completes. It signs a receipt that names
the tool and appends it to ./receipts/receipts.jsonl. protect-mcp 0.7.4 does
not record the tool input or output.
Cedar Policy File
Create ./protect.cedar at the project root:
// Read-only tools: one rule can name several tools in `when`. Add WebFetch
// with your own URL rule.
permit (principal, action == Action::"MCP::Tool::call", resource) when {
resource == Tool::"Read" || resource == Tool::"Glob" || resource == Tool::"Grep"
};
// Safe commands only; git limited to read subcommands
permit (principal, action == Action::"MCP::Tool::call", resource == Tool::"Bash") when {
context has input && context.input has command &&
(context.input.command like "git status*" || context.input.command like "git diff*" ||
context.input.command like "git log*" || context.input.command like "git show*" ||
context.input.command like "npm*" || context.input.command like "ls*" ||
context.input.command like "cat*" || context.input.command like "echo*" ||
context.input.command like "pwd*" || context.input.command like "test*")
};
…
Häufige Fragen
Was sind 'Cedar Policies'?
Das sind Regelsätze, die festlegen, was der KI-Agent mit den Tools tun darf und was nicht.
Was sind 'Ed25519-Receipts'?
Das sind signierte digitale Quittungen, die belegen, welche Befehle ausgeführt wurden und dass sie genehmigt waren. Niemand kann sie später unbemerkt verändern.
Wie überprüfe ich diese Nachweise?
Du kannst das Tool `npx @veritasacta/verify` verwenden. Damit prüfst du die Nachweise offline, ohne Internetverbindung und ohne einem Server vertrauen zu müssen.
Details
Originalbeschreibung des Autors
Configure Cedar policy enforcement and Ed25519 signed receipts for Claude Code tool calls. Use when setting up projects that need cryptographic audit trails, policy-gated tool execution, or compliance-ready evidence of agent actions.
repo: wshobson/agents
Beliebtheit
- GitHub-Sterne
- 41k
- Platz im Ranking
- #6754
- Lizenz
- MIT
- Aktualisiert
- 15.10.2026
Kommentare
- …
Weitere Skills aus diesem Repository
screen-reader-testing
41kLässt deinen Agenten Webseiten mit Screenreadern testen, um sicherzustellen, dass sie barrierefrei sind.
wcag-audit-patterns
41kHilft deinem Agenten, Webseiten auf Barrierefreiheit zu prüfen und Probleme gemäß den WCAG-Richtlinien zu beheben.
multi-reviewer-patterns
41kErmöglicht deinem Agenten, parallele Code-Reviews zu koordinieren, doppelte Ergebnisse zu entfernen und Berichte zusammenzuführen.
parallel-debugging
41kErmöglicht dem Agenten, komplexe Fehler mit parallelen Untersuchungen und Ursachenanalyse zu debuggen.
Ähnliche Skills
reverse-engineer-anything
422kHilft deinem Agenten, fertige Apps und Pakete zu untersuchen, um Funktionen zu erklären, Versionen zu vergleichen oder einen Nachbau zu leiten, mit dem REA-Tool.
1password
394kHilft deinem Agenten, die 1Password-Kommandozeile einzurichten, sich anzumelden und Geheimnisse zu lesen oder einzufügen, ohne deren Werte im Chat auszugeben.
healthcheck
394kHilft deinem Agenten, den Computer oder Server, auf dem OpenClaw läuft, auf Sicherheitsrisiken wie SSH, Firewall, Updates und Backups zu prüfen und sichere Korrekturen vorzuschlagen.