一键导入
protect-mcp-governance
Agent governance skill for MCP tool calls — Cedar policy authoring, shadow-to-enforce rollout, and Ed25519 receipt verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Agent governance skill for MCP tool calls — Cedar policy authoring, shadow-to-enforce rollout, and Ed25519 receipt verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Delivers a verified corporate handoff through ADR-scoped implementation and independent site verification.
SME for data flows, modular architectural designs, API specs, and ADR design modeling.
SME for backend routes, database optimization, indexing, and Prisma schema designs.
Enforce end-to-end DevOps best practices, environment standardization, security audits, and state-gated pipeline verification for Antigravity projects.
SRE for container configurations, Kubernetes, CI/CD pipeline automation, and context drift check-ins.
SME for screen rendering, visual premium palettes, responsiveness, and accessibility ARIA rules.
| name | protect-mcp-governance |
| description | Agent governance skill for MCP tool calls — Cedar policy authoring, shadow-to-enforce rollout, and Ed25519 receipt verification. |
| risk | safe |
| source | community |
| source_repo | scopeblind/scopeblind-gateway |
| source_type | official |
| date_added | 2026-04-05 |
Guidance for governing AI agent tool calls using Cedar policies and Ed25519 signed receipts. This skill teaches how to write access-control policies for MCP servers, run them in shadow mode for observation, and verify the cryptographic audit trail.
@security-auditor)@security-audit)protect-mcp intercepts MCP tool calls, evaluates them against Cedar policies (the same policy engine used by AWS Verified Permissions), and signs every decision as an Ed25519 receipt. The receipt is a cryptographic proof that a specific policy was evaluated against a specific tool call at a specific time.
2026-07-28)FidusGate’s gateway is dual-era:
initialize handshake retained for Cursor/local clients (2025-11-25 preferred; 2024-11-05 accepted).POST /mcp — stateless Streamable HTTP: require MCP-Protocol-Version, Mcp-Method, and (for named methods) Mcp-Name. Header/body disagreement is rejected before Cedar runs.server/discover instead of relying on session init.GET /.well-known/oauth-protected-resource (RFC 9728); map residual risks via OWASP MCP Top 10 ADR.Agent → protect-mcp → Cedar policy evaluation → MCP Server
↓
Ed25519 signed receipt
Three modes of operation:
Cedar is a policy language designed for authorization. Policies are evaluated locally via WASM — no network calls required.
// Allow read-only file operations
permit(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name in ["read_file", "list_directory", "search_files"]
};
// Deny destructive operations
forbid(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name in ["execute_command", "delete_file", "write_file"]
&& resource has args
&& resource.args.contains("rm -rf")
};
To mitigate the four main latent development risks (Runaway Concurrency, Self-Authoring Rot, Yak-Shaving loops, and Micro-Auditing lockups), we map agentic tools to four explicit risk tiers:
| Tier | Name | Development Tools Affected | Cedar Governance Mode |
|---|---|---|---|
| Tier 1 | Low Risk | read_file, list_directory, grep_search | Auto-Approve (No restrictions) |
| Tier 2 | Medium Risk | write_file, replace_file_content outside src/ | Shadow-to-Enforce (Alerts on directory drift) |
| Tier 3 | High Risk | execute_command (Parallel Worker spawns, skill-creator) | Interactive Authorization (Requires --yes flags) |
| Tier 4 | Critical Risk | Unsandboxed network downloads, global policy deletes | Strict Interdiction (Pre-authorized receipt required) |
// 1. TIER 3: Prevent runaway token burn from parallel workers unless explicitly approved
forbid(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name == "execute_command"
&& resource.args.contains("orchestrate-batch-refactor")
&& !resource.args.contains("--yes")
};
// 2. TIER 3: Block dynamic, unverified skill creation to prevent Prompt Pollution
forbid(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name == "execute_command"
&& resource.args.contains("skill-creator")
&& !resource.args.contains("--manual-auth")
};
// 3. TIER 2: Enforce a timeout block on loop-prone environment/Docker setups
permit(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name in ["execute_command", "write_file"]
&& resource.args.contains("devcontainer-setup")
} when {
// Shadow-observe execution state to abort loops after 3 failures
context.session.failure_count < 3
};
Every policy decision produces a signed receipt:
{
"payload": {
"type": "protectmcp:decision",
"tool_name": "read_file",
"decision": "allow",
"policy_digest": "sha256:9d0fd4c9e72c1d5d",
"issued_at": "2026-04-05T14:32:04.102Z",
"issuer_id": "sb:issuer:de073ae64e43"
},
"signature": {
"alg": "EdDSA",
"kid": "sb:issuer:de073ae64e43",
"sig": "2a3b5022..."
}
}
The receipt format follows IETF Internet-Draft draft-farley-acta-signed-receipts.
# Install and initialize hooks (Claude Code integration)
npx protect-mcp init-hooks
# Or run as a standalone MCP gateway
npx protect-mcp serve
This creates a protect-mcp.config.json and a starter Cedar policy in your project root.
Create policy.cedar in your project:
// Start permissive — allow everything in shadow mode
permit(
principal,
action == Action::"call_tool",
resource
);
# Shadow mode is the default — logs decisions without blocking
npx protect-mcp --policy policy.cedar -- node your-mcp-server.js
Review the shadow log to understand what your agent is doing before writing restrictive policies.
Once you understand the tool-call patterns, write specific policies:
// Allow file reads, deny writes outside src/
permit(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name == "read_file"
};
permit(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name == "write_file"
&& resource has args
&& resource.args.path like "src/*"
};
// Deny everything else
forbid(
principal,
action == Action::"call_tool",
resource
);
Switch to enforce mode:
npx protect-mcp --policy policy.cedar --enforce -- node your-mcp-server.js
# Verify a single receipt
npx @veritasacta/verify receipt.json --key <public-key-hex>
# Verify an audit bundle (multiple receipts + keys)
npx @veritasacta/verify bundle.json --bundle
# Self-test the verifier (proves it works offline)
npx @veritasacta/verify --self-test
Exit codes: 0 = signature valid (proven authentic), 1 = signature invalid (proven tampered), 2 = verifier error (malformed input).
# Initialize hooks
npx protect-mcp init-hooks
# Claude Code now generates a signed receipt for every tool call.
# Receipts are stored in .protect-mcp/receipts/
Explanation: After initialization, every tool call Claude Code makes is logged with a signed receipt. No tool calls are blocked (shadow mode).
// Only allow approved tools with rate limiting
permit(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name in [
"get_customer",
"search_orders",
"list_products"
]
};
forbid(
principal,
action == Action::"call_tool",
resource
) when {
resource.tool_name in [
"delete_customer",
"modify_payment",
"execute_sql"
]
};
Explanation: A production MCP server that serves customer data. Read-only operations are permitted; destructive operations are blocked.
# Export the session's audit bundle
npx protect-mcp export-bundle --session sess_abc123 --out audit.json
# Verify every receipt in the bundle
npx @veritasacta/verify audit.json --bundle
# Expected output:
# ✓ Bundle: VALID
# Total: 47
# Passed: 47
# Failed: 0
Explanation: After an incident, export the audit bundle and verify that no receipts have been tampered with. The bundle contains all receipts from the session plus the signing keys needed for verification.
policy_digest to track which policy version produced each decision@veritasacta/verify@0.2.5)claimed_issuer_tier without independent verificationno_public_keySymptoms: npx @veritasacta/verify receipt.json returns exit 2 with no_public_key
Solution: Provide the public key explicitly: --key <64 hex chars>. The receipt does not embed the public key by default. Check protect-mcp.config.json for the issuer's public key.
Symptoms: Shadow log shows deny decisions for tools you expected to be allowed
Solution: Check your Cedar policy ordering. Cedar evaluates forbid rules before permit rules — a broad forbid will override specific permit rules.
Symptoms: Agent reports a tool call was denied after switching to enforce mode
Solution: Add the tool to your permit policy or switch back to shadow mode: remove --enforce flag. Review the receipt's deny_reason field for the specific policy violation.
@security-auditor — General security auditing and compliance@security-audit — Code vulnerability scanning@mcp-development — MCP server development patterns