Permission guard: tool call allow/deny rules for AI agents
Project description
MCP Permission Guard — Pre-Action Authorization for AI Agents
Intent-based permission system with risk scoring, rule engine, and audit trail. Zero dependencies, pure Python stdlib.
The Problem
Agents execute destructive actions without guardrails. Binary allow/deny prompts don't work (93% auto-approved). The "lethal trifecta" — private data + untrusted content + external communication — creates risks no single tool can detect.
The Solution
MCP Permission Guard classifies tool calls into 14 intent categories, scores risk 0-100, evaluates rules, and produces deterministic allow/deny/ask decisions with full audit trail.
Tools (11)
| Tool | What it does |
|---|---|
classify_intent |
Map tool call → intent category (14 types) |
risk_assess |
Score 0-100 with lethal trifecta detection |
register_rule |
Add allow/deny/ask rule by intent |
evaluate |
Full evaluation: classify + risk + rules → decision |
audit_log |
Query decision history |
list_rules |
Show all registered rules |
remove_rule |
Delete a rule |
set_policy |
Global policy: allow_all / deny_all / ask_all / rules_based |
get_policy |
Read current policy |
get_stats |
Decision statistics |
reset |
Clear all state |
Intent Categories
filesystem_read (10) · filesystem_write (40) · filesystem_delete (80) · network_outbound (50) · network_inbound (30) · code_execution (60) · shell_command (70) · database_write (65) · database_read (20) · credentials_access (90) · config_change (55) · user_management (85) · service_restart (60) · package_install (75)
Tests
python -m pytest tests/ -v # 38 tests, all passing
Inspiration
- nah — Intent-level permission guards
- Open Agent Passport — Pre-action authorization
- Beyond Permission Prompts — Structured authorization
- Claude Code Auto Mode — Two-stage classifier
License
MIT — aaameobius-crypto
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_permission_guard-1.0.0.tar.gz.
File metadata
- Download URL: mcp_permission_guard-1.0.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78a2efa58ba7a1992c17831858d2966bac9bc780ef517691408932a16002c084
|
|
| MD5 |
f39dc05a4418501b3631e3fc60f11f70
|
|
| BLAKE2b-256 |
18e9f02a2144d65cfec65187f04ecde4dddef4d4fbdf56c9971ad35a3b76125b
|
File details
Details for the file mcp_permission_guard-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mcp_permission_guard-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2d6e0e55163da81d0570a608ddb5f2462bd800af40398dce410114e54efa770
|
|
| MD5 |
42dd27fb2e590b70e655904f43f86da6
|
|
| BLAKE2b-256 |
f77cf62a2d362233ce47894b99b3292e9580392eb01d2832db017a220a66f59f
|