Your agents can think freely. Nothing dangerous gets executed without passing the airlock.
Policy-as-code Β· human-in-the-loop approval Β· full ledger β at the one boundary that matters: where an agent's decision becomes a real-world action.
An over-eager agent tries to DROP TABLE customers, refund $25,000, and delete your S3 backups. Airlock allows the safe one, blocks the dangerous ones with a readable reason, and routes the ambiguous one to a human β without changing a line of agent logic.
On April 25, 2026, an AI coding agent deleted a company's production database and its backups in nine seconds. In March, a rogue agent at a major tech company exposed internal data to unauthorized employees. The 2026 CISO AI Risk Report found 47% of security leaders have watched agents take unauthorized actions β and only 5% feel confident they could contain a compromised one.
Meanwhile 85% of enterprises are customizing agents, but only 21% have a mature governance model (Deloitte, 2026).
That gap is the whole problem. We spend enormous effort making agents smarter and almost none making their actions accountable. Content filters catch bad words. Airlock catches bad actions β the DROP TABLE, the six-figure refund, the rm -rf on a backup volume β at the exact moment the agent tries to execute them.
Give your agents autonomy without the nine-second production-database deletion.
It sits at your agent's tool-execution boundary and, for every proposed action, returns one of three decisions from a policy a non-engineer can read:
| Decision | Meaning | Example |
|---|---|---|
| π’ ALLOW | Safe under policy β execute it | refund($75) |
| π΄ BLOCK | Forbidden β refuse and raise | DROP TABLE customers |
| π‘ REVIEW | Ambiguous β pause for a human | refund($25,000) |
Every attempt β allowed, blocked, or escalated β lands in an ledger you can hand to a risk or compliance reviewer. That's the artifact they actually ask for.
git clone https://github.com/APK99-dot/Airlock && cd Airlock
pip install pyyaml # the only runtime dependency
python examples/rogue_agent_demo.py # watch the firewall work
python examples/rogue_agent_demo.py --human # you approve/deny the $25k refundThe demo runs straight from the clone β no install step. Prefer it on your path?
pip install -e .(needs pip β₯ 21.3) installs theairlockpackage.
Add it to your own agent in one line per tool:
from airlock import Airlock
lock = Airlock.from_file("policies/example.yaml")
@lock.guard("payments.refund")
def issue_refund(amount: float, account: str) -> str:
... # your real tool. Airlock enforces policy before it ever runs.β¦or check imperatively at any framework's tool boundary:
verdict = lock.check("db.execute", {"query": sql})
if verdict.allowed:
run(sql)
else:
log.warning(verdict.reason) # "Destructive SQL is not permitted."default: allow
rules:
- name: block-destructive-sql
match:
action: "db.*"
args: { query: "(?i)\\b(drop|truncate|delete\\s+from)\\b" }
decision: block
reason: "Destructive SQL is not permitted on this database."
- name: review-large-refunds
match:
action: "payments.refund"
when: "float(args.get('amount', 0)) > 10000"
decision: review
reason: "Refunds over $10,000 require human approval."First match wins. Match on the action name (glob), argument content (regex), or a when expression. See policies/example.yaml.
- Any Python agent β the
@guarddecorator orlock.check() - MCP servers β
AirlockMCPProxysits in front of any MCP server; blockedtools/calls never reach it and return a structured error the agent can reason about - LangChain / LangGraph β
AirlockCallbackHandlerguards tools aton_tool_start
flowchart LR
A[AI Agent] -->|proposes action| G{{π‘οΈ Airlock}}
G -->|evaluate| P[Policy-as-code<br/>YAML rules]
G -->|π’ allow| T[Real Tool / MCP Server]
G -->|π΄ block| X[Refuse + reason]
G -->|π‘ review| H[Human approver<br/>terminal Β· Slack Β· dashboard]
H -->|approve| T
H -->|deny| X
G -.->|every verdict| L[(Ledger<br/>JSONL)]
Airlock is deliberately one layer of the guardrail stack β the action layer. It composes with content/prompt-injection filters (NeMo Guardrails, Galileo) rather than replacing them.
- β Not a content moderator or prompt-injection text filter β that's a different layer; run one alongside.
- β Not a model host, eval platform, or observability suite.
- β Not enterprise IAM/SSO/RBAC β it enforces policy, and hands identity to your existing stack.
- β Not a code sandbox β it decides whether an action runs, not where.
Doing one thing at the right boundary is the point.
| Content filters (NeMo, Galileo) | Heavyweight platforms | Airlock | |
|---|---|---|---|
| Catches bad actions (not just words) | β | β | β |
| Policy a non-engineer can read | β | β | β |
| One-line to add to an existing agent | β | β | β |
| MCP-native proxy | β | partial | β |
| Runs local, no account, MIT | β | β | β |
- Slack + web-dashboard approvers (dashboard scaffold in
dashboard/) - Policy simulator: replay a ledger against a proposed policy diff
- Signed, hash-chained ledger for tamper evidence
- Prebuilt policy packs (fintech, healthcare, internal-tools)
Issues and PRs welcome β especially real-world "an agent tried to do this" policy rules. See CONTRIBUTING.md.
MIT Β© APK99-dot