{"slug": "airlock-egress-firewall-for-ai-agents-with-hash-chained-immutable-ledger", "title": "Airlock – Egress firewall for AI agents with hash-chained immutable ledger", "summary": "Ramon Cortez, an AI systems architect, released Airlock, an open-source Node.js egress firewall that intercepts every outbound API call an AI agent attempts and scores it against a threat rules engine before it fires. Airlock assigns points for risky behavior — +40 for blocked HTTP methods such as DELETE, +50 for blocked endpoints including localhost, internal addresses and AWS metadata, +20 per sensitive payload field and +15 per sensitive header — and returns ALLOW below a score of 25, QUARANTINE at 25 or above and BLOCK at 40 or above, logging every verdict to an append-only SHA-256 hash-chained ledger.jsonl that the /verify endpoint checks for tampering. The zero-dependency server runs on port 3000 and ships with 13 passing tests covering safe actions, blocked methods, sensitive payloads, internal endpoints, rollback and ledger integrity.", "body_md": "**Egress & API Action Firewall for Autonomous AI Agents**\n\nAirlock intercepts every outbound API call an AI agent attempts to make — scoring it against a threat rules engine before it fires. Blocked and quarantined actions are logged to a tamper-evident immutable ledger. Nothing gets out without clearance.\n\nBuilt to bridge threat detection and immutable state into an active defense layer.\n\nAutonomous agents make decisions fast. Too fast. Without a firewall layer, a misconfigured agent can:\n\n- Exfiltrate sensitive data through an unguarded API call\n- Hit internal endpoints it was never meant to reach\n- Fire DELETE requests that can't be undone\n- Leak credentials or tokens in outbound payloads\n\nAirlock stops all of that — before it happens.\n\n```\nAgent Action Request\n        │\n        ▼\n┌───────────────────┐\n│   Airlock Server  │  POST /intercept\n│                   │\n│  ┌─────────────┐  │\n│  │ Rules Engine │  │  Scores: method, endpoint, payload, headers\n│  └──────┬──────┘  │\n│         │         │\n│  ┌──────▼──────┐  │\n│  │   Verdict   │  │  ALLOW / QUARANTINE / BLOCK\n│  └──────┬──────┘  │\n│         │         │\n│  ┌──────▼──────┐  │\n│  │   Ledger    │  │  Append-only, hash-chained, tamper-evident\n│  └─────────────┘  │\n└───────────────────┘\n        │\n        ▼\n  200 ALLOW or 403 BLOCK\n```\n\n| Method | Route | Description | \n|---|---|---|\n| `POST` | `/intercept` | Evaluate an action before it fires | \n| `POST` | `/rollback` | Trigger rollback on a previously allowed action | \n| `GET` | `/ledger` | Read the full immutable action log | \n| `GET` | `/verify` | Verify ledger integrity (hash chain check) | \n| `GET` | `/health` | Health check | \n\n```\ngit clone https://github.com/rcortez056-spec/airlock.git\ncd airlock\nnode src/index.js\n```\n\nServer starts on port `3000` (configurable via `PORT` env var).\n\n```\ncurl -X POST http://localhost:3000/intercept \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"method\": \"POST\",\n    \"endpoint\": \"https://api.example.com/submit\",\n    \"payload\": { \"data\": \"clean payload\" },\n    \"agent_id\": \"my-agent\",\n    \"source\": \"relevance-ai\"\n  }'\n```\n\n**ALLOW response (200):**\n\n```\n{\n  \"allowed\": true,\n  \"verdict\": \"ALLOW\",\n  \"score\": 0,\n  \"reasons\": [],\n  \"ledger_id\": \"uuid-here\",\n  \"timestamp\": \"2026-12-04T...\"\n}\n```\n\n**BLOCK response (403):**\n\n```\n{\n  \"allowed\": false,\n  \"verdict\": \"BLOCK\",\n  \"score\": 75,\n  \"reasons\": [\"Blocked endpoint pattern: /localhost/\", \"Endpoint failed format validation\"],\n  \"ledger_id\": \"uuid-here\",\n  \"timestamp\": \"2026-12-04T...\"\n}\ncurl -X POST http://localhost:3000/rollback \\\n  -H \"Content-Type: application/json\" \\\n  -d '{ \"ledger_id\": \"uuid-of-action\", \"reason\": \"Agent misfired\" }'\ncurl http://localhost:3000/verify\n```\n\n| Trigger | Score Added | \n|---|---|\n| Blocked HTTP method (DELETE) | +40 | \n| Blocked endpoint (localhost, internal, AWS metadata) | +50 | \n| Sensitive field in payload (api_key, secret, token, etc.) | +20 each | \n| Sensitive field in headers | +15 each | \n| Endpoint fails format validation | +25 | \n\n**Thresholds:**\n\n- `BLOCK` → score ≥ 40\n- `QUARANTINE` → score ≥ 25\n- `ALLOW` → score < 25\n\nEvery intercepted action is logged to `ledger.jsonl` as an append-only, hash-chained record. Each entry includes:\n\n- Unique ID and timestamp\n- Hash of the previous entry (tamper-evident chain)\n- Verdict, score, and reasons\n- Action metadata (method, endpoint, agent_id, payload size)\n\nThe `/verify` endpoint checks the full chain and reports any tampering.\n\n```\nnode src/test.js\n```\n\nAll 13 tests pass. Covers: safe actions, blocked methods, sensitive payloads, internal endpoints, rollback, and ledger integrity.\n\n- **Runtime:** Node.js (zero dependencies)\n- **Storage:** Append-only JSONL ledger\n- **Integrity:** SHA-256 hash chain\n- **Transport:** HTTP (deploy behind your existing infrastructure)\n\nBuilt by [Ramon Cortez](https://www.linkedin.com/in/ramon-cortez-a227a2112) — AI Systems Architect\n\nPart of the autonomous defense stack alongside:\n\n- [GitBridge AI](https://github.com/rcortez056-spec/gitbridge-ai) — GitHub event automation\n- Sentinel Guard Engine — pre-execution safety layer\n- Email Threat Detector — AI triage pipeline", "url": "https://wpnews.pro/news/airlock-egress-firewall-for-ai-agents-with-hash-chained-immutable-ledger", "canonical_source": "https://github.com/rcortez056-spec/airlock", "published_at": "2026-12-04 21:55:02+00:00", "updated_at": "2026-12-04 22:16:01.196570+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "ai-tools", "developer-tools"], "entities": ["Airlock", "Ramon Cortez", "Node.js", "GitBridge AI", "GitHub"], "also_reported_by": [], "takeaway": "Airlock scores each agent API call before it fires — +40 for blocked methods like DELETE, +50 for internal or AWS-metadata endpoints, +20 per sensitive payload field — blocking at 40 and quarantining at 25, with every verdict written to a SHA-256 hash-chained ledger checked by /verify.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/airlock-egress-firewall-for-ai-agents-with-hash-chained-immutable-ledger", "markdown": "https://wpnews.pro/news/airlock-egress-firewall-for-ai-agents-with-hash-chained-immutable-ledger.md", "text": "https://wpnews.pro/news/airlock-egress-firewall-for-ai-agents-with-hash-chained-immutable-ledger.txt", "jsonld": "https://wpnews.pro/news/airlock-egress-firewall-for-ai-agents-with-hash-chained-immutable-ledger.jsonld"}}