MCP WriteGuard — Fine-Grained Pre-Action Security
Governing write privileges for AI agent tools across databases, GitHub, APIs, and cloud infrastructure without modifying upstream MCP servers.
1. Why MCP Write Controls Matter
When AI coding agents use Model Context Protocol (MCP) servers to interact with live systems, read operations are generally low-risk. However, write operations (deletions, schema alterations, branch mutations, payments) present catastrophic failure modes if unmonitored or compromised by prompt injection.
ThumbGate WriteGuard operates as a pre-action interdiction layer that classifies every MCP tool into deterministic risk tiers (read, write, privileged_write, admin), inspects arguments for destructive payloads, and scrubs sensitive tokens from telemetry.
2. Risk Tier Classification Matrix
| Tier | Typical Tools | Default Policy | Audit Behavior |
|---|---|---|---|
| read | view_file, grep_search, list_dir | Allow | Scrubbed parameter log |
| write | write_to_file, replace_file_content | Allow with verification | Attribution receipt emitted |
| privileged_write | run_command, manage_task, kill | Scan dangerous patterns | Full trace + escalation guard |
| admin | set_branch_governance, approve_protected_action | Require operator approval | Immutable audit ledger |
3. CLI Usage & Policy Export
# Test a tool against WriteGuard policy
npx thumbgate writeguard --tool run_command --params '{"CommandLine":"rm -rf /"}'
# Export Cloudflare WriteGuard compatible JSON policy schema
npx thumbgate writeguard --export-policy --json