Escrow Breaker Endpoint: POST /v1/firewall/policy-check MCP Tool: firewall_policy_check Zero Payload Retention & Zero Training-Data Resale $0 Charged on HTTP 402 / 403 Blocks

4D AI Agent Tool Policy Engine: Allow, Ask, and Deny Governance Gates

Replace binary all-or-nothing API keys with a deterministic 4D agent policy engine evaluating per-call cost, per-minute rate, daily tenant budget, and tool/domain allowlists to return allow, ask, or deny.

Target Role: Enterprise AI Governance & Platform Engineering Lead · Primary Keyword: 4D agent tool policy engine allow ask deny domain allowlist · Pipeline Stage: Stage 2 — Escrow Circuit Breaker (SQLite WAL 4D Budget)

Zero Payload Retention & Zero Training-Data Resale Pledge: Enterprise-Trust-Firewall runs on 100% pure Python 3 stdlib + SQLite WAL. Raw customer payloads, prompts, headers, and secrets are never persisted to disk, never logged in plaintext, and never sold or reused for model training. Audit receipts store redacted SHA-256 digests only.
Launch 5-Second Zero-Signup Try-Now Console Read Agent Skill Spec (REST + MCP + Treg Hub) Browse All 24 Guides

1. Threat Surface & Deterministic Firewall Controls

Production agents require graduated autonomy: low-risk read lookups on approved domains should execute automatically (allow), sensitive or near-threshold actions should pause for human signoff (ask), and unauthorized domains or over-budget calls must fail closed immediately (deny). Stage 2 Escrow Circuit Breaker implements this 4D policy model deterministically across REST and MCP.

How Enterprise-Trust-Firewall Enforces This Boundary

  1. Evaluates Dimension 1 (max_cost_micros per call) and supports soft ask-threshold triggers before hard cap denial.
  2. Evaluates Dimension 2 (per-minute sliding-window rate limit) to throttle bursty loops.
  3. Evaluates Dimension 3 (tenant_daily_budget_micros) inside SQLite WAL BEGIN IMMEDIATE transactions.
  4. Evaluates Dimension 4 (allowed_domains and allowed_tools allowlists) with fail-closed default deny for unknown destinations.

2. Concrete Benchmark & Threshold Metrics

Control / Benchmark Metric Enforced Threshold & Guarantee
Concurrency safetySQLite WAL (PRAGMA journal_mode=WAL; busy_timeout=5000ms) + BEGIN IMMEDIATE lock: 0 overspend under 20+ concurrent threads
4D policy dimensionsmax_cost_micros per call, per-minute sliding-window rate limit, tenant daily budget cap, tool/domain allowlist
Policy verdict statesDeterministic allow, ask (human approval gate), or deny (HTTP 402 budget / HTTP 403 policy)
Circuit-trip charge guaranteeStrictly charged_micros == 0 whenever budget or policy circuit trips

3. Working REST (cURL) & MCP JSON-RPC 2.0 Examples

REST API Invocation (POST https://trustwall.fastmesh.dev/v1/firewall/policy-check)

curl -sS -X POST https://trustwall.fastmesh.dev/v1/firewall/policy-check \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ${TRUSTWALL_API_KEY}" \
  -d '{"tenant_id":"enterprise_governance_01","tool_name":"wire_payout_create","target_url":"https://treasury.example.org/v1/payouts","estimated_cost_micros":85000,"max_cost_micros":100000,"ask_threshold_micros":50000,"rate_limit_per_min":10,"daily_budget_micros":1000000,"allowed_domains":["treasury.example.org"]}'

Structured Request Payload

{
  "tenant_id": "enterprise_governance_01",
  "tool_name": "wire_payout_create",
  "target_url": "https://treasury.example.org/v1/payouts",
  "estimated_cost_micros": 85000,
  "max_cost_micros": 100000,
  "ask_threshold_micros": 50000,
  "rate_limit_per_min": 10,
  "daily_budget_micros": 1000000,
  "allowed_domains": [
    "treasury.example.org"
  ]
}

Native Streamable MCP Invocation (POST https://trustwall.fastmesh.dev/mcp)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "firewall_policy_check",
    "arguments": {
      "tenant_id": "enterprise_governance_01",
      "tool_name": "wire_payout_create",
      "target_url": "https://treasury.example.org/v1/payouts",
      "estimated_cost_micros": 85000,
      "max_cost_micros": 100000,
      "ask_threshold_micros": 50000,
      "rate_limit_per_min": 10,
      "daily_budget_micros": 1000000,
      "allowed_domains": [
        "treasury.example.org"
      ]
    }
  }
}

Run via cURL against /mcp:

curl -sS -X POST https://trustwall.fastmesh.dev/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"firewall_policy_check","arguments":{"tenant_id":"enterprise_governance_01","tool_name":"wire_payout_create","target_url":"https://treasury.example.org/v1/payouts","estimated_cost_micros":85000,"max_cost_micros":100000,"ask_threshold_micros":50000,"rate_limit_per_min":10,"daily_budget_micros":1000000,"allowed_domains":["treasury.example.org"]}}}'

Expected Deterministic Firewall Response

{
  "decision": "ask",
  "http_status": 202,
  "reason": "cost_above_ask_threshold_requires_human_approval",
  "charged_micros": 0,
  "approval_required": true
}

4. Tamper-Evident SHA-256 TrustAuditReceipt (Zero Payload Retention)

Every request produces a canonical 64-hex SHA-256 TrustAuditReceipt stored in SQLite WAL using redacted payload digests only. Verify any receipt free ($0) via GET /v1/firewall/receipt/tr_538b07fc0b745031, MCP tool firewall_verify_receipt, or offline Python 3 stdlib SHA-256 hashing:

{
  "receipt_id": "tr_538b07fc0b745031",
  "service": "enterprise-trust-firewall",
  "version": "1.0.0",
  "action": "policy_check",
  "tenant_hash": "5f01ad60a8e6",
  "target_host": "treasury.example.org",
  "verdict": "ASK",
  "decision": "ask",
  "http_status": 202,
  "charged_micros": 0,
  "zero_bill_reason": "blocked_or_unbilled_ask",
  "input_sha256": "20d98b8285b5ff205d70723eebc7b41377f5c1ddd6bed6d50248484f56a465a4",
  "output_sha256": "22712082e48cd0a625c6f38b1a4cf8ecf506a861953db1e92688c145daa3e27a",
  "redaction_count": 0,
  "redacted_categories": [],
  "policy_checks": [
    {
      "stage": "stage2_escrow_breaker",
      "endpoint": "/v1/firewall/policy-check",
      "verdict": "ASK"
    }
  ],
  "stage_summary": {
    "primary_stage": "stage2_escrow_breaker",
    "mcp_tool": "firewall_policy_check"
  },
  "sla_cert_id": null,
  "zero_payload_retention": true,
  "issued_at_utc": "2026-12-02T05:30:00Z",
  "receipt_sha256": "20de129edf42551aaa5f23e23af5fcc917e905d5985d067f4f6aeba8ef629bcc",
  "sha256_attestation": "20de129edf42551aaa5f23e23af5fcc917e905d5985d067f4f6aeba8ef629bcc"
}

5. Architecture & Capability Benchmark Comparison

Solution Pricing & Billing Model Agent Runtime Defense Audit & Data Retention Operational Outcome
Enterprise-Trust-FirewallPrepaid Creem ($149/$399/$999) + $0 on 402/403 tripsTransactional BEGIN IMMEDIATE micro-USD reservation, settlement, and automatic refund4D allow/ask/deny policy + SHA-256 TrustAuditReceiptPrevents $50,000 agent retry storms deterministically
Cloud Billing AlertsFree with cloud account (delayed 15-60 min)Post-facto email alert after the bill has already explodedZero inline blocking or per-tool escrowCannot stop runaway loops in real time
API Gateway Rate Limiter$50-$500/moCounts requests/sec only; blind to per-call micro-USD tool costNo reservation/refund ledger or ask-gate semanticsAllows high-cost tool calls to drain budget
In-Memory Python CountersDIYRace conditions under multi-worker load; lost on restartOverspends under concurrent fan-outZero durable audit trail

6. Transparent Creem Plans ($0 on Blocked Calls)

Start immediately in the 5-second zero-signup Try-Now Console, then activate prepaid Creem tiers with HMAC-SHA256 idempotent credit settlement:

Team Gateway $149

$149.00 non-expiring prepaid credits (149,000,000 micros, ~7,450 headline ops at $0.02), zero seat tax, all 4 firewall stages, SHA-256 receipts, and $0 on blocked calls.

SKU: sku_trustwall_team_gateway_149 · Creem Checkout

Security Pro $399

$450.00 non-expiring prepaid credits (+$51.00 bonus, 450,000,000 micros, ~22,500 headline ops), multi-tenant SQLite WAL escrow pools, 10% repeat ArchiveCache tier, and 24h SLA certificates.

SKU: sku_trustwall_security_pro_399 · Creem Checkout

Enterprise Firewall $999

$1,250.00 non-expiring prepaid credits (+$251.00 bonus, 1,250,000,000 micros, ~62,500 headline ops), unlimited agents, custom policy packs, replay-safe Creem webhook auto-topup, and Zero Payload Retention attestation.

SKU: sku_trustwall_enterprise_firewall_999 · Creem Checkout

7. Frequently Asked Questions

What does an 'ask' policy decision do?

An 'ask' decision halts automatic execution with charged_micros == 0 and returns structured approval metadata so your orchestrator can request human-in-the-loop confirmation.

Can domain allowlists restrict an agent to specific partner APIs only?

Yes. Any target_url whose host falls outside allowed_domains receives an immediate HTTP 403 deny decision before any network I/O.

Are policy checks available as a standalone dry-run endpoint?

Yes. POST /v1/firewall/policy-check and MCP tool firewall_policy_check evaluate all four dimensions without executing the upstream call.

8. Related Enterprise-Trust-Firewall Guides

Try Live Firewall Console → · Explore All 24 Security & GEO Guides →