MCP Airlock
MCP Airlock
Zero-Trust-Sicherheits-Gateway für MCP-Tools. MCP Airlock verwandelt jeden Tool-Aufruf in eine kurzlebige, kontextgebundene Berechtigungsentscheidung mit manipulationssicherer Herkunft.
Warum existiert dies?
Agenten-Tool-Ökosysteme scheitern an einer schmerzhaften Grenze: dem Sprung von nicht vertrauenswürdigem Prompt-Text zur privilegierten Tool-Ausführung.
Aktuelle Muster sind meist eines der folgenden:
statische Zulassungslisten (
Agent darf Tool X aufrufen)schwache Regex-Filterung
nachträgliche Protokolle ohne Integritätsgarantien
Sie versagen, wenn Prompt-Injection die Absicht mitten in der Sitzung verändert, was zu stiller Privilegienerweiterung oder Datenabfluss führt.
MCP Airlock löst dies mit einem fehlenden Grundbaustein für MCP:
Berechtigungs-Leases (Capability Leases): kurzlebige, signierte, kontextgebundene Rechte (
Sitzung + Absicht + Tool-Umfang + Einschränkungen)Kontextbewusste Richtlinien: dynamische Autorisierung bei jedem Aufruf (Risikobewertung + Tool-Einschränkungen + Lease-Prüfungen)
Manipulationssichere Herkunft: Nur-Anhängen-Hash-Kette über alle Zulassungs-/Ablehnungsentscheidungen hinweg
Related MCP server: mcp-permission-server
Kerninnovation
Kontextgebundene Berechtigungs-Leases (CBCL)
Jeder Tool-Aufruf wird anhand eines signierten Leases autorisiert:
Gebunden an
session_idGebunden an
intent_hashBegrenzt auf spezifische Tools
Zeitlich begrenzt
Optionale Einschränkungen (z. B. erlaubte Domains, maximales Risiko)
Wenn eine Prompt-Injection versucht, die Absicht zu ändern oder den Tool-Umfang zu überschreiten, wird die Ausführung verweigert.
Architektur
flowchart LR
A[Agent / MCP Client] -->|tools/call| B[MCP Airlock Server]
B --> C[Risk Engine]
B --> D[Capability Verifier]
B --> E[Policy Engine]
E -->|allow| F[Tool Adapter Layer]
E -->|deny| G[Policy Deny Response]
F --> H[External APIs / Internal Services]
B --> I[Provenance Ledger Hash Chain]Vertrauensgrenzen
flowchart TB
subgraph Untrusted
U1[Prompt Content]
U2[Agent Reasoning Trace]
end
subgraph Trusted Control Plane
T1[MCP Airlock]
T2[Policy + Lease Validation]
T3[Signed Provenance Ledger]
end
subgraph External Targets
X1[Public APIs]
X2[Internal APIs]
end
U1 --> T1
U2 --> T1
T1 --> T2
T2 --> X1
T2 --> X2
T1 --> T3Hauptmerkmale
MCP-stdio-Server kompatibel mit
initialize,tools/list,tools/callTool zur Berechtigungsausstellung:
airlock_issue_capabilityTool für Agenten-/API-Nutzungsanalysen:
airlock_usage_statsTool zur Messung der API-Exposition:
airlock_exposure_reportRichtliniendurchsetzungs-Middleware mit tool-spezifischen Risikoschwellenwerten
Bewertung von Prompt-Injection-Signaturen
SSRF-resistenter HTTP-Tool-Adapter (
http_get_json)Beispiel für echte API-Integration (
weather_hourly)Manipulationssicheres Herkunftsprotokoll + Verifizierungsbefehl
Leitfaden zur Sandbox-Härtung für agentische API-Sicherheit
CLI für serve/demo/issue/verify/stats/exposure
2-Minuten-Schnellstart
git clone https://github.com/lara-muhanna/mcp-airlock
cd mcp-airlock
python -m pip install -e .
python -m mcp_airlock --config examples/airlock.config.json demoWas Sie sehen werden:
eine menschenfreundliche Zusammenfassung (Handshake, Berechtigung, Zulassung/Ablehnung, Audit-Integrität)
böswilliger Aufruf abgelehnt mit verständlichen Gründen
signierter Herkunftsnachweis
Ein-Befehl-Lokal-Demo (keine Installation)
python -m mcp_airlock --config examples/airlock.config.json demo --city Austin --state TexasFür vollständige JSON-Payloads während der Demo:
python -m mcp_airlock --config examples/airlock.config.json demo --rawAls MCP-Server ausführen
python -m mcp_airlock --config examples/airlock.config.json serveMCP-Client-Setup-Beispiele:
CLI
# Issue a capability directly
python -m mcp_airlock --config examples/airlock.config.json issue \
--session-id sess-123 \
--subject agent:planner \
--tools weather_hourly,http_get_json \
--intent "Plan safe outdoor activities" \
--ttl-seconds 900 \
--constraints '{"allowed_domains":["api.open-meteo.com"],"max_risk":0.6}'
# Verify audit integrity
python -m mcp_airlock --config examples/airlock.config.json verify-log
# API usage stats by agent
python -m mcp_airlock --config examples/airlock.config.json stats --lookback-hours 24
# API exposure measurement
python -m mcp_airlock --config examples/airlock.config.json exposure --lookback-hours 24Beispiel für Agenten-Integration
Ausführen:
python examples/agent_integration.pyDieses Skript:
startet Airlock über stdio
verhandelt MCP initialize/list
stellt ein Lease aus
führt einen normalen Tool-Aufruf aus
führt einen injizierten Aufruf aus, der blockiert wird
Konfigurationsvorlage
examples/airlock.config.json
{
"secret_key": "dev-secret-change-this-before-production",
"provenance_log": "./airlock-provenance.log",
"max_ttl_seconds": 1800,
"default_risk_threshold": 0.55,
"tools": {
"weather_hourly": {
"require_capability": true,
"risk_threshold": 0.7
},
"http_get_json": {
"require_capability": true,
"risk_threshold": 0.45,
"allowed_domains": ["api.open-meteo.com", "geocoding-api.open-meteo.com"]
}
}
}Zusammenfassung des Sicherheitsmodells
Agent fordert Lease über
airlock_issue_capabilityan.Lease ist HMAC-signiert und enthält
session,intent_hash,tool_scope,expiry.Jeder
tools/call-Request enthält_capabilityund_context.Airlock erzwingt:
Lease-Gültigkeit + Signatur
Sitzungs- und Absichtskontinuität
Risikoschwellenwert
Tool-spezifische Einschränkungen (z. B. Domain-Zulassungsliste)
Entscheidung + Nachweis werden per Hash-Kette an das Herkunftsprotokoll angehängt.
Projektstruktur
mcp-airlock/
mcp_airlock/
cli.py
server.py
policy.py
capability.py
risk.py
provenance.py
config.py
tool_ids.py
tools/
http_json.py
weather.py
examples/
airlock.config.json
agent_integration.py
docs/
CLIENT_SETUP.md
SANDBOXING_AGENTIC_APIS.mdRoadmap
Upstream-MCP-Proxy-Modus (vorhandene MCP-Server transparent umschließen)
OPA/Rego-Richtlinien-Backend
OpenTelemetry-Traces + SIEM-Senken
Verwalteter Berechtigungs-Broker + Schlüsselrotation
Signiertes Replay-Paket für die Reaktion auf Vorfälle
Community
Beitrag-Leitfaden:
CONTRIBUTING.mdSicherheitsrichtlinie:
SECURITY.mdVerhaltenskodex:
CODE_OF_CONDUCT.mdRelease-Checkliste:
docs/RELEASE_CHECKLIST.md
Lizenz
MIT
Available Tools
4 toolsairlock_audit_tailC
Read recent signed provenance events.
Inputs: limit.
airlock_issue_capabilityC
Issue a short-lived capability lease bound to session+intent.
Inputs: session_id (required), subject (required), tools (required), intent (required), +2 more.
http_get_jsonA
Fetch JSON from a public HTTPS API endpoint.
Inputs: url (required), query.
weather_hourlyA
Resolve US city/state and fetch hourly weather from Open-Meteo.
Inputs: city (required), state (required), hours.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct function (provenance auditing, capability issuance, generic HTTP fetching, and weather retrieval) with minimal overlap. An agent can easily distinguish when to use each based on the task requirements.
Mixed naming patterns: two tools use 'airlock_' prefix with verbs (issue, audit_tail), while others use 'http_' prefix or no prefix (weather_hourly). The weather tool breaks the verb-first convention used by others, using a noun-adjective pattern instead.
Four tools is acceptably compact but the set suffers from scope confusion, mixing core Airlock security functions with unrelated utility tools (weather, HTTP). This feels like two different servers merged together rather than a cohesive toolset.
The Airlock domain (capability management) is severely underdeveloped, offering only issuance and audit tail reading without revocation, validation, or capability listing. The utility tools (weather, HTTP) are also minimal, offering only hourly forecasts and GET requests without parameter customization.
Maintenance
Related MCP Connectors
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Real-time prompt injection filtering, MCP payload inspection, and A2A trust scoring.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables secure interaction between LLMs and MCP tools by applying zero-trust security controls, including sensitive data masking, file system protection, and policy enforcement.MIT
- AlicenseNot gradedqualityDmaintenanceEnforces fine-grained, context-aware access control on MCP tool calls, with a tamper-evident, replayable audit log that records denials and verifies every decision.MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLM agents to enforce security policies by authorizing tool calls, scanning for prompt injection, checking memory writes, redacting PII, and accessing audit trails through MCP.-
- AlicenseNot gradedqualityCmaintenanceEnables production-hardened MCP tool serving with OAuth 2.1 audience-restricted tokens, purpose-bound tools, human-in-the-loop approvals, containment, and audit trails for AI agents.Apache 2.0