Skip to main content
Glama
Agent Policy Gateway MCP Server

Agent Policy Gateway MCP Server

by AiAgentKarl

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.

Related MCP server: ai-compliance-monitor

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"}

More MCP Servers by AiAgentKarl

Category

Servers

🔗 Blockchain

Solana

🌍 Data

Weather · Germany · Agriculture · Space · Aviation · EU Companies

🔒 Security

Cybersecurity · Policy Gateway · Audit Trail

🤖 Agent Infra

Memory · Directory · Hub · Reputation

🔬 Research

Academic · LLM Benchmark · Legal

→ Full catalog (40+ servers)

License

MIT

Available Tools

6 tools
apply_guardrailsA

Prüft ob eine Agent-Aktion gemäß konfigurierbarer Policies erlaubt ist.

Prüft: Spend-Limits, erlaubte Domains, geblockte Aktionen, Aktionen die menschliche Freigabe brauchen, API-Rate-Limits.

Args: action: Die geplante Aktion (z.B. "send_email", "make_purchase") context: Optionaler Kontext mit Details: - amount_usd: Betrag in USD (für Spend-Checks) - domain: Ziel-Domain (für Domain-Checks) - api_calls_this_minute: Aktuelle API-Calls (für Rate-Limits) - custom_policies: Dict mit Policy-Overrides

Returns: allowed: Boolean ob die Aktion erlaubt ist decision: "allow", "deny" oder "require_approval" reason: Begründung der Entscheidung policy_checked: Welche Policy gegriffen hat

Inputs: action (required), context.

check_complianceA

Prüft ob ein Aktionstyp besondere Anforderungen unter EU AI Act oder DSGVO hat.

Kennt Risikokategorien: automated_decision, biometric_identification, credit_scoring, content_moderation, recruitment, data_processing, customer_profiling, chatbot_interaction.

Args: action_type: Art der Aktion (z.B. "automated_decision", "recruitment") jurisdiction: Rechtsraum — aktuell "EU" unterstützt

Returns: action_type: Abgefragter Aktionstyp jurisdiction: Geprüfter Rechtsraum risk_level: AI Act Risikostufe requirements: Liste der Anforderungen gdpr_articles: Relevante DSGVO-Artikel is_prohibited: Ob die Aktion verboten ist

Inputs: action_type (required), jurisdiction.

check_piiA

Scannt Text auf personenbezogene Daten (PII).

Erkennt: E-Mail-Adressen, Telefonnummern (US/EU), SSNs, Kreditkartennummern und IBANs.

Gibt gefundene PII-Typen und eine bereinigte Version zurück. Nutze dieses Tool BEVOR du Text an externe Services sendest.

Args: text: Der zu prüfende Text

Returns: found_pii: Liste der gefundenen PII-Typen mit Positionen redacted_text: Text mit entfernter PII (ersetzt durch [PII_TYP]) has_pii: Boolean ob PII gefunden wurde pii_count: Anzahl gefundener PII-Elemente

Inputs: text (required).

emergency_stopA

Löst einen Notfall-Stopp für einen Agent aus.

Loggt das Emergency-Stop-Event ins Audit-Log und gibt ein Kill-Switch-Signal zurück. Der aufrufende Agent MUSS nach Erhalt dieses Signals alle laufenden Aktionen sofort beenden.

Args: agent_id: ID des zu stoppenden Agents reason: Grund für den Notfall-Stopp

Returns: kill_switch: True — Agent muss sofort stoppen agent_id: Gestoppter Agent reason: Grund des Stopps timestamp: Zeitstempel audit_entry: ID des Audit-Eintrags

Inputs: agent_id (required), reason (required).

get_audit_logA

Ruft Audit-Log-Einträge für einen Agent ab.

Liest die JSONL-Audit-Datei und gibt die letzten Einträge zurück. Nützlich für Compliance-Reviews und Incident-Analyse.

Args: agent_id: Eindeutige ID des Agents limit: Maximale Anzahl Einträge (Standard: 50)

Returns: entries: Liste der Log-Einträge (neueste zuerst) total_entries: Gesamtanzahl Einträge agent_id: Abgefragter Agent

Inputs: agent_id (required), limit.

log_actionB

Loggt eine Agent-Aktion in ein Append-Only Audit-Log.

Jeder Agent bekommt eine eigene JSONL-Datei unter ~/.agent-audit-log/. Einträge sind unveränderlich und enthalten Zeitstempel, Agent-ID, Aktionstyp und Details.

Args: agent_id: Eindeutige ID des Agents action: Art der Aktion (z.B. "api_call", "data_access") details: Zusätzliche Details zur Aktion

Returns: logged: Boolean ob erfolgreich entry_id: Eindeutige ID des Log-Eintrags file_path: Pfad zur Audit-Datei

Inputs: agent_id (required), action (required), details.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a distinct and non-overlapping purpose: policy enforcement, legal compliance, PII scanning, emergency stop, action logging, and audit retrieval. No two tools could be confused for the same operation.

    Naming Consistency4/5

    Most tools follow a verb_noun pattern (apply_guardrails, check_compliance, check_pii, get_audit_log, log_action), but 'emergency_stop' is a noun phrase without a leading verb, breaking the pattern slightly.

    Tool Count5/5

    Six tools is well-scoped for a policy gateway server, covering guardrails, compliance, PII, emergency stop, and audit without feeling too few or excessive.

    Completeness4/5

    Core use cases are covered: policy enforcement, legal checks, PII scanning, emergency stop, and audit logging. Minor gaps exist (e.g., no explicit tool for human approval or policy configuration), but agents can still function with these tools.

    Related MCP Connectors

    Related MCP Servers