Skip to main content

Agent Policy Gateway MCP Server

Compliance and guardrails server for AI agents. Gives companies the tools to run AI agents safely and within regulatory boundaries.

Why This Exists

As AI agents gain autonomy — making purchases, accessing data, sending emails — companies face real compliance risks:

  • GDPR (EU): Agents processing personal data must follow strict rules. Violations cost up to 4% of global revenue.
  • EU AI Act (2024): High-risk AI systems need human oversight, transparency, and documentation. Non-compliance means fines up to 35M EUR.
  • Internal Policies: Companies need spend limits, allowed actions, domain restrictions, and audit trails.

This server provides the "boring infrastructure" that makes autonomous agents enterprise-ready.

Tools

Tool Description
check_pii(text) Scan text for PII (emails, phones, SSNs, credit cards, IBANs). Returns found types and redacted version.
apply_guardrails(action, context) Check if an action is allowed by configurable policies (spend limits, domain allowlists, blocked actions).
log_action(agent_id, action, details) Append-only audit log entry with timestamp. Stored in ~/.agent-audit-log/.
get_audit_log(agent_id, limit) Retrieve audit log entries for compliance review.
check_compliance(action_type, jurisdiction) Check EU AI Act risk level and GDPR requirements for an action type.
emergency_stop(agent_id, reason) Kill switch — logs critical event and returns immediate stop signal.

Installation

# Via pip
pip install agent-policy-gateway-mcp

# Via uvx (no install needed)
uvx agent-policy-gateway-mcp

Configuration

Add to your MCP client config:

{
  "mcpServers": {
    "policy-gateway": {
      "command": "uvx",
      "args": ["agent-policy-gateway-mcp"]
    }
  }
}

Or with pip install:

{
  "mcpServers": {
    "policy-gateway": {
      "command": "policy-gateway-server"
    }
  }
}

Usage Examples

PII Detection Before External Calls

check_pii("Send invoice to john.doe@company.com, CC 4532-1234-5678-9012")
→ has_pii: true, found: [email, credit_card], redacted version provided

Guardrails for Agent Actions

apply_guardrails("make_purchase", {"amount_usd": 500})
→ denied: exceeds $100 spend limit

apply_guardrails("send_email", {})
→ allowed

apply_guardrails("delete_user_data")
→ denied: blocked action

Compliance Check

check_compliance("automated_decision", "EU")
→ risk_level: high
→ requirements: human oversight, transparency, documentation, fairness audits
→ gdpr_articles: Art. 22 GDPR

Emergency Stop

emergency_stop("agent-007", "Agent attempting unauthorized data export")
→ kill_switch: true, logged to audit trail

Compliance Coverage

EU AI Act Risk Levels

  • Unacceptable: Biometric identification (real-time) — blocked
  • High: Automated decisions, credit scoring, recruitment, customer profiling
  • Limited: Content moderation, data processing
  • Minimal: Chatbot interactions

GDPR Articles Referenced

  • Art. 6 — Lawfulness of processing
  • Art. 9 — Special categories of data
  • Art. 13/14 — Information obligations
  • Art. 21 — Right to object
  • Art. 22 — Automated decision-making
  • Art. 30 — Records of processing
  • Art. 35 — Data protection impact assessment

Audit Log Format

Logs are stored as JSONL files in ~/.agent-audit-log/:

{"entry_id": "agent-1_1710936000000", "timestamp": "2024-03-20T12:00:00+00:00", "agent_id": "agent-1", "action": "api_call", "details": "Called external pricing API"}

License

MIT

Metadata

Release files for agent-policy-gateway-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-policy-gateway-mcp 0.1.0
File Size Uploaded
agent_policy_gateway_mcp-0.1.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-policy-gateway-mcp 0.1.0
File Interpreter ABI Platform
agent_policy_gateway_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / agent_policy_gateway_mcp-0.1.0.tar.gz

Download URL agent_policy_gateway_mcp-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
60b59490096ea0e86040f2a63a8018c60a0a1e435f28d328c8269cd1bbf13350
BLAKE2b-256 checksum
How to use checksums
6f400c6aad805c1be50132341a990fbdf652aec6db8ba1381163588b4a58ca8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / agent_policy_gateway_mcp-0.1.0-py3-none-any.whl

Download URL agent_policy_gateway_mcp-0.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aeede3a91d7af4ca97772223f90833c6f01fddefea25b0d7f0799560c8309e32
BLAKE2b-256 checksum
How to use checksums
363bc185488e69dc82ed5ee9a814c67746663502e0b63e6191ed41d045cc58f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page