{"openapi":"3.1.0","info":{"title":"Enterprise-Trust-Firewall (TrustWall) API","version":"1.0.0","description":"Zero-Trust 4-Stage AI Agent Firewall & Self-Healing MCP Gateway: Stage 1 Audit Gate (SSRF/DNS-rebinding, >=20 bidirectional secret/PII redactors, indirect prompt injection & shell metacharacter blocking, TLS/security-header scoring), Stage 2 SQLite WAL 4D Escrow Circuit Breaker (HTTP 402/403 with strictly $0 charged on trip), Stage 3 Verify Guard (fake-200 interception, JSON Schema validation, verified-hit ArchiveCache, tamper-evident SHA-256 TrustAuditReceipt with Zero Raw Payload Retention), and Stage 4 Heal Fallback (deterministic schema drift healing, SSRF re-audited backup failover, and signed 24h SHA-256 SLAHealthCertificate).","contact":{"email":"security@fastmesh.dev","url":"https://trustwall.fastmesh.dev"}},"servers":[{"url":"https://trustwall.fastmesh.dev","description":"Production HTTPS Gateway"},{"url":"http://127.0.0.1:9028","description":"Local Gateway Instance"}],"paths":{"/health":{"get":{"operationId":"getHealth","summary":"Service health, stage readiness, pricing, and cache/receipt telemetry","responses":{"200":{"description":"Healthy firewall gateway status"}}}},"/openapi.json":{"get":{"operationId":"getOpenApiSpec","summary":"OpenAPI 3.1.0 specification document","responses":{"200":{"description":"OpenAPI JSON"}}}},"/v1/firewall/inspect":{"post":{"operationId":"firewallInspect","summary":"Stage 1 Audit Gate: SSRF, bidirectional secret/PII redaction, prompt injection & TLS score","description":"Base price: 2500 micro-USD ($0 on 403 block or 422 invalid).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"target_url":{"type":"string"},"payload":{},"response":{},"headers":{"type":"object"},"response_headers":{"type":"object"},"tls_version":{"type":"string"},"probe_tls":{"type":"boolean"},"dry_run":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Inspection clean/redacted with SHA-256 TrustAuditReceipt"},"403":{"description":"Blocked by SSRF, DNS-rebinding, prompt injection, or shell guard (charged_micros == 0)"},"422":{"description":"Malformed input (charged_micros == 0)"}}}},"/v1/firewall/policy-check":{"post":{"operationId":"firewallPolicyCheck","summary":"Stage 2 Escrow Circuit Breaker: 4D budget, sliding-window rate, and allowlist evaluation","description":"Base price: 1000 micro-USD ($0 on ask/deny/trip).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant_id":{"type":"string"},"tool_name":{"type":"string"},"target_url":{"type":"string"},"target_domain":{"type":"string"},"estimated_cost_micros":{"type":"integer"},"max_cost_micros":{"type":"integer"},"rate_limit_per_min":{"type":"integer"},"daily_budget_micros":{"type":"integer"},"ask_threshold_micros":{"type":"integer"},"allowed_domains":{"type":"array","items":{"type":"string"}},"allowed_tools":{"type":"array","items":{"type":"string"}},"denied_domains":{"type":"array","items":{"type":"string"}},"denied_tools":{"type":"array","items":{"type":"string"}},"approved":{"type":"boolean"},"reserve":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Policy decision allow or advisory ask"},"402":{"description":"Budget circuit breaker tripped (charged_micros == 0)"},"403":{"description":"Policy/rate/SSRF/injection blocked (charged_micros == 0)"}}}},"/v1/firewall/proxy-execute":{"post":{"operationId":"firewallProxyExecute","summary":"Full 4-Stage Zero-Trust Proxy Execute (Audit -> Escrow -> Verify/Cache -> Heal/Failover)","description":"Base price: 10000 micro-USD ($0 on block/trip/unhealed error).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["target_url"],"properties":{"target_url":{"type":"string"},"method":{"type":"string","default":"GET"},"headers":{"type":"object"},"request_body":{},"tool_name":{"type":"string"},"backup_urls":{"type":"array","items":{"type":"string"}},"expected_schema":{"type":"object"},"alias_map":{"type":"object"},"estimated_cost_micros":{"type":"integer"},"max_cost_micros":{"type":"integer"},"daily_budget_micros":{"type":"integer"},"rate_limit_per_min":{"type":"integer"},"allowed_domains":{"type":"array","items":{"type":"string"}},"allowed_tools":{"type":"array","items":{"type":"string"}},"no_cache":{"type":"boolean"},"approved":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Verified or healed upstream response with TrustAuditReceipt and 24h SLA cert"},"402":{"description":"Budget circuit tripped (charged_micros == 0)"},"403":{"description":"SSRF, prompt injection, or policy blocked (charged_micros == 0)"},"502":{"description":"Upstream failed and no healthy backup available (refunded, charged_micros == 0)"}}}},"/v1/firewall/heal-response":{"post":{"operationId":"firewallHealResponse","summary":"Stage 3 + 4 Response Healer: detect fake-200 or schema drift, patch or fail over, issue 24h SLA cert","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response":{},"drifted_payload":{},"status_code":{"type":"integer","default":200},"headers":{"type":"object"},"expected_schema":{"type":"object"},"alias_map":{"type":"object"},"backup_urls":{"type":"array","items":{"type":"string"}},"target_url":{"type":"string"}}}}}},"responses":{"200":{"description":"Healed payload, patch, 24h SLA cert, and TrustAuditReceipt"},"403":{"description":"Backup failover URL blocked by Stage 1 SSRF re-audit (charged_micros == 0)"},"502":{"description":"Unrecoverable response (charged_micros == 0)"}}}},"/v1/firewall/receipt/{receipt_id}":{"get":{"operationId":"getFirewallReceipt","summary":"Retrieve and cryptographically verify a stored SHA-256 TrustAuditReceipt (free, $0)","parameters":[{"name":"receipt_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified TrustAuditReceipt with tamper-evidence check"},"404":{"description":"Receipt not found"}}}},"/webhooks/creem":{"post":{"operationId":"creemWebhook","summary":"Creem HMAC-SHA256 idempotent prepaid credit webhook handler ($149 / $399 / $999 plans)","responses":{"200":{"description":"Processed or idempotent duplicate acknowledged"},"401":{"description":"Invalid HMAC-SHA256 creem-signature"},"503":{"description":"CREEM_WEBHOOK_SECRET not configured"}}}},"/mcp":{"post":{"operationId":"mcpJsonRpc","summary":"Native JSON-RPC 2.0 MCP endpoint (5 flat firewall tools)","responses":{"200":{"description":"JSON-RPC 2.0 response"}}}}}}