Airlock – Egress firewall for AI agents with hash-chained immutable ledger 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. Egress & API Action Firewall for Autonomous AI Agents Airlock 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. Built to bridge threat detection and immutable state into an active defense layer. Autonomous agents make decisions fast. Too fast. Without a firewall layer, a misconfigured agent can: - Exfiltrate sensitive data through an unguarded API call - Hit internal endpoints it was never meant to reach - Fire DELETE requests that can't be undone - Leak credentials or tokens in outbound payloads Airlock stops all of that — before it happens. Agent Action Request │ ▼ ┌───────────────────┐ │ Airlock Server │ POST /intercept │ │ │ ┌─────────────┐ │ │ │ Rules Engine │ │ Scores: method, endpoint, payload, headers │ └──────┬──────┘ │ │ │ │ │ ┌──────▼──────┐ │ │ │ Verdict │ │ ALLOW / QUARANTINE / BLOCK │ └──────┬──────┘ │ │ │ │ │ ┌──────▼──────┐ │ │ │ Ledger │ │ Append-only, hash-chained, tamper-evident │ └─────────────┘ │ └───────────────────┘ │ ▼ 200 ALLOW or 403 BLOCK | Method | Route | Description | |---|---|---| | POST | /intercept | Evaluate an action before it fires | | POST | /rollback | Trigger rollback on a previously allowed action | | GET | /ledger | Read the full immutable action log | | GET | /verify | Verify ledger integrity hash chain check | | GET | /health | Health check | git clone https://github.com/rcortez056-spec/airlock.git cd airlock node src/index.js Server starts on port 3000 configurable via PORT env var . curl -X POST http://localhost:3000/intercept \ -H "Content-Type: application/json" \ -d '{ "method": "POST", "endpoint": "https://api.example.com/submit", "payload": { "data": "clean payload" }, "agent id": "my-agent", "source": "relevance-ai" }' ALLOW response 200 : { "allowed": true, "verdict": "ALLOW", "score": 0, "reasons": , "ledger id": "uuid-here", "timestamp": "2026-12-04T..." } BLOCK response 403 : { "allowed": false, "verdict": "BLOCK", "score": 75, "reasons": "Blocked endpoint pattern: /localhost/", "Endpoint failed format validation" , "ledger id": "uuid-here", "timestamp": "2026-12-04T..." } curl -X POST http://localhost:3000/rollback \ -H "Content-Type: application/json" \ -d '{ "ledger id": "uuid-of-action", "reason": "Agent misfired" }' curl http://localhost:3000/verify | Trigger | Score Added | |---|---| | Blocked HTTP method DELETE | +40 | | Blocked endpoint localhost, internal, AWS metadata | +50 | | Sensitive field in payload api key, secret, token, etc. | +20 each | | Sensitive field in headers | +15 each | | Endpoint fails format validation | +25 | Thresholds: - BLOCK → score ≥ 40 - QUARANTINE → score ≥ 25 - ALLOW → score < 25 Every intercepted action is logged to ledger.jsonl as an append-only, hash-chained record. Each entry includes: - Unique ID and timestamp - Hash of the previous entry tamper-evident chain - Verdict, score, and reasons - Action metadata method, endpoint, agent id, payload size The /verify endpoint checks the full chain and reports any tampering. node src/test.js All 13 tests pass. Covers: safe actions, blocked methods, sensitive payloads, internal endpoints, rollback, and ledger integrity. - Runtime: Node.js zero dependencies - Storage: Append-only JSONL ledger - Integrity: SHA-256 hash chain - Transport: HTTP deploy behind your existing infrastructure Built by Ramon Cortez https://www.linkedin.com/in/ramon-cortez-a227a2112 — AI Systems Architect Part of the autonomous defense stack alongside: - GitBridge AI https://github.com/rcortez056-spec/gitbridge-ai — GitHub event automation - Sentinel Guard Engine — pre-execution safety layer - Email Threat Detector — AI triage pipeline