aegis-action-firewall
Executes approved SQL actions against configured SQLite databases through the sealed host broker, enforcing table allowlists, row limits, and mutation/DDL controls.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@aegis-action-firewall run a read-only SQL query listing active users"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Aegis Action Firewall (aegis-action-firewall)
Zero-Trust Execution Control Plane for AI Agents — Formal Z3 SMT Policy Verification, Sealed Host Brokers, Bidirectional DLP, Biba Taint Tracking & SHA-256 HITL Audit Console.
AI agents connected to SQL databases, REST APIs, and external MCP servers face four existential security failures: hidden DDL/CTE mutations inside SELECT queries, SQL tautologies (WHERE 1=1), Server-Side Request Forgery (169.254.169.254 / IPv6-mapped loopback bypasses), and second-order prompt injections causing untrusted inputs to trigger privileged state changes. aegis-action-firewall places an unbypassable formal SMT boundary between the agent and every host credential or mutation.
1. Four-Plane Zero-Trust Architecture
+-------------------------------------------------------------------------+
| PLANE 1: AGENT BOUNDARY (Zero-Free-Text Pydantic v2 Contracts / MCP) |
| SqlActionIntent | HttpActionIntent | McpReadIntent (extra="forbid") |
+------------------------------------+------------------------------------+
|
v
+-------------------------------------------------------------------------+
| PLANE 2: DETERMINISTIC PARSERS & BIDIRECTIONAL DLP |
| * sqlglot Full Subtree AST (CTE writes, DDL, PRAGMA, tautologies) |
| * Anti-SSRF HTTP Validator (HTTPS, userinfo @, IPv6-mapped IPv4) |
| * Bidirectional DLP (Outbound secrets/Luhn | Inbound taint) |
+------------------------------------+------------------------------------+
|
v
+-------------------------------------------------------------------------+
| PLANE 3: FORMAL ARBITRATION & TAMPER-EVIDENT AUDIT |
| * Two-Phase Z3 SMT Solver (assert_and_track + unsat_core() < 5 ms) |
| * SHA-256 WAL Ledger (prev_hash -> event_hash + session_epochs)|
| * Host Capability Signer (HMAC-SHA256 bound to session, ver, hash) |
+-------------------+---------------------------------+-------------------+
| COMMIT | PENDING_APPROVAL
v v
+-----------------------------------+ +---------------------------------+
| PLANE 4A: SEALED HOST BROKERS | | PLANE 4B: HITL APPROVAL CONSOLE |
| * SqlHostBroker (fetchmany) | | * FastAPI + X-Aegis-Admin-Token|
| * HttpHostBroker (HostVault auth| | * Atomic APPROVED -> EXECUTED |
| zero redirects, scrubbed errs)| | * Constant-time hash verification|
+-----------------------------------+ +---------------------------------+Related MCP server: governed-mcp
Live Zero-Trust Audit & HITL Console
HITL Queue & Biba Taint Isolation (TAINTED (BIBA))

SHA-256 Audit Ledger & Formal Z3 Verdicts (CHAIN VERIFIED)

Interactive Red-Team Sandbox (1-Click Offline Simulation)

2. Formal Z3 Invariants & Red-Team Guarantees
Domain | Z3 Rule Code ( | Mathematical Constraint / Guarantee | Verdict on Violation |
Outbound Secrets |
|
|
|
Destructive Tier |
|
|
|
SQL Single & No DDL |
|
|
|
SQL Allowlist |
|
|
|
SQL Safe WHERE |
|
|
|
SQL Row Bounds |
|
|
|
HTTP Anti-SSRF |
|
|
|
HTTP Payload Cap |
|
|
|
Epoch Blast Radius |
|
|
|
Biba Integrity Guard |
|
|
|
HITL Risk Escalation |
|
|
|
3. 30-Second Quickstart (Interactive Demo & Red-Team Sandbox)
Run the offline demo environment (synthetic in-memory vault + httpx.MockTransport + SQLite WAL demo ledger — zero live credentials or external network traffic):
# 1. Install editable package and dependencies
pip install -e .
# 2. Optional: seed/reset the 6 reproducible demo scenarios explicitly
python scripts/seed_demo.py --reset
# 3. Launch the Audit & HITL Web Console in Demo Mode (auto-seeds if needed)
python -m aegis_firewall.console_api --demo --host 127.0.0.1 --port 8000Copy the ephemeral
X-Aegis-Admin-Tokenprinted once on startup.Open
http://127.0.0.1:8000, paste the token into the top bar, and click Connect.Inspect the CHAIN VERIFIED SHA-256 indicator, trigger one-click attacks in the Red-Team Sandbox tab, and approve or reject frozen intents in Pending Approvals (HITL).
(Note: Sandbox endpoints /api/sandbox/* fail closed with 403 Forbidden whenever --demo / enable_sandbox=True is not active.)
4. Production Deployment & Verification
Host Configuration
Policies (
config/policies.yaml): Declaresql.allowed_tables,sql.writable_tables,sql.sensitive_tables,http.allowed_domains,http.sensitive_endpoints, andhitl.risk_threshold.Sealed Host Vault (
.secrets/vault.json): Copy.secrets/vault.example.json(git-ignored) to storehmac_master_key(>= 16 chars), SQL DSNs, and upstream API tokens solely on the host process:
{
"hmac_master_key": "replace-with-32-byte-random-hex-secret",
"sql_connections": {
"app_db": { "backend": "sqlite", "dsn": "./data/app_runtime.db" }
},
"http_services": {
"crm": {
"base_url": "https://api.crm.example.com",
"auth_header": "Authorization",
"auth_scheme": "Bearer",
"token": "replace-with-host-crm-api-token"
}
}
}Environment Variables:
AEGIS_CONSOLE_TOKEN: Static admin token protecting/api/*(X-Aegis-Admin-Token).AEGIS_POLICIES_PATH,AEGIS_VAULT_PATH,AEGIS_LEDGER_PATH(legacyAEGIS_FIREWALL_*aliases also supported).MAIL_TRIAGE_LEDGER_PATH(optional): Path toaegis-mail-triageSQLite ledger opened strictly in?mode=roread-only mode to unify mail and action events inside/api/events.
Agent MCP Client Config (stdio)
Copy mcp_config.example.json directly into Claude Desktop, Cursor, or Antigravity IDE:
{
"mcpServers": {
"aegis-action-firewall": {
"command": "python",
"args": ["-m", "aegis_firewall.mcp_server"],
"env": {
"AEGIS_POLICIES_PATH": "./config/policies.yaml",
"AEGIS_VAULT_PATH": "./.secrets/vault.json",
"AEGIS_LEDGER_PATH": "./data/aegis_firewall.db"
}
}
}
}Security Audit & Test Verification
pytest -vAvailable Tools
5 toolshttp_request_safeC
Validate HTTPS allowlist/anti-SSRF, scan outbound DLP, evaluate Z3, and execute HTTP.
Inputs: url (required), method (required), service_id (required), session_id (required), +4 more. Returns: object
list_pending_approvalsB
Return queued HITL PENDING_APPROVAL entries cleanly without secrets or DSNs.
Inputs: session_id. Returns: object
mint_signed_context_tokenB
Sign a short-lived Ed25519 X-Aegis-Context-Token (ttl_sec <= 60) for Vault lease checkout.
Inputs: actor_id (required), trace_id (required), tenant_id (required), scopes, +3 more. Returns: object
sql_execute_safeC
Parse SQL AST, scan outbound DLP, evaluate Z3 policy invariants, and execute safely.
Inputs: query (required), session_id (required), connection_id (required), params, +2 more. Returns: object
verify_ledger_integrityA
Audit full SHA-256 chain continuity across aegis_audit_events.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a clearly distinct operation: SQL execution, HTTP execution, approval listing, ledger verification, and token minting. The two execution tools are separated by protocol (SQL vs HTTPS) with no overlap, and the auxiliary tools cover disjoint concerns. An agent can select unambiguously based on intent.
Three tools follow a verb_noun pattern (list_pending_approvals, verify_ledger_integrity, mint_signed_context_token), while sql_execute_safe and http_request_safe use a resource_verb_suffix pattern. The split is readable and semantically meaningful, but it is not a single predictable convention.
Five tools is tightly scoped for an action-firewall with HITL approval, audit integrity, and token minting responsibilities. Each tool corresponds to a distinct capability with no redundancy. Nothing feels padded or missing at the count level.
The surface covers governed execution, approval inspection, audit verification, and token minting, but list_pending_approvals has no companion to approve or reject queued requests, creating a dead end in the HITL workflow. Policy inspection or ledger event querying are also absent, though these are secondary.
Maintenance
Related MCP Connectors
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Read-only finance and operations controls for AI agents with evidence and safe next actions.
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides a secure, policy-driven read-only gateway that exposes multiple databases to AI tools via MCP, with governed select, search, and aggregate operations and no free-form SQL.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query a read-only data surface through typed tools, enforcing caller-specific row access, field masking, and withheld-row disclosure so they can retrieve entitled information without writes or silent data leakage.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants and LLM agents to query operational databases through a read-only MCP gateway with table whitelisting, automatic row limits, sensitive-data masking, and audit logging.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables secure runtime mediation of tool requests from MCP-connected AI agents, enforcing least-privilege policies, validating intent and inputs, detecting multi-step attacks and information leaks, and supporting explainable decisions, audit trails, and human approval for sensitive actions.MIT