agent-airlock
Open-source security firewall for AI agents — validates tool calls, strips ghost arguments, enforces type safety, PII masking, RBAC, cost tracking & sandbox isolation. Works with LangChain, OpenAI Agents SDK, PydanticAI & CrewAI.
claude mcp add --transport stdio sattyamjjain-agent-airlock pipx run agent-airlock \ --env AIRLOCK_DEBUG="Enable verbose debugging output" \ --env AIRLOCK_POLICY="Optional: path or name of policy profile"
How to use
agent-airlock provides an open-source firewall for AI agents. It acts as a protective wrapper around agent function calls, stripping ghost/unauthorized arguments, enforcing strict type validation, and offering self-healing error feedback to keep interactions safe. The library exposes a decorator that can be applied to functions to guard their execution, ensuring that only approved parameters are passed and that any LLM-invented or unsafe inputs are either blocked or sanitized. Use cases include safeguarding tool calls, API interactions, or critical operations within an agent's decision loop. The quickstart shows how to install the package and decorate a function to demonstrate argument validation and safe execution. In practice, you can integrate Airlock into your agent framework to enforce RBAC, PII masking, and sandboxed execution, while benefiting from its wired-in open telemetry and observability hooks for monitoring safety compliance.
How to install
Prerequisites:
- Python 3.10+ (as indicated by the project badges) or a compatible Python runtime
- Internet access to install via pip/pipx
Installation steps:
- Install the package (recommended via pipx to isolate the CLI and runtime):
pipx install agent-airlock
- Alternatively, install with pip for direct use in a virtual environment:
pip install agent-airlock
- (Optional) Verify installation and run a quick sanity check in Python:
python -c "from agent_airlock import Airlock; @Airlock()\ndef test(x: int) -> int: return x+1\nprint(test(1))"
- If you need to integrate with your existing tooling, review the docs for configuring the Airlock decorator, scaffolding an E2B sandbox, and enabling observability via OpenTelemetry.
Prerequisites recap:
- A Python 3.10+ environment
- Access to install packages from PyPI or via pipx
- Basic familiarity with Python decorators and function annotations
Additional notes
Tips and common considerations:
- Env vars: AIRLOCK_DEBUG can enable verbose logging; AIRLOCK_POLICY can point to a policy profile to customize allowed patterns and behaviors.
- If you encounter issues with argument stripping, ensure your function signatures have proper type annotations, as Airlock relies on type information for validation.
- When integrating into larger agents, consider wrapping only the sensitive calls (e.g., file operations, network requests) rather than entire decision functions to minimize performance impact.
- For production, enable OpenTelemetry observability to monitor safety events, blocked calls, and policy breaches.
- RBAC and PII masking features help tailor access controls and secret handling according to your environment. Review and adjust as needed for your use-case.
- If you see self-healing errors, these are designed to guide corrective action in prompts and calls; adjust prompts or policies to balance safety and UX.
Related MCP Servers
ncp
Natural Context Provider (NCP). Your MCPs, supercharged. Find any tool instantly, load on demand, run on schedule, ready for any client. Smart loading saves tokens and energy.
open-skills
Battle-tested skill library for AI agents. Save 98% of API costs with ready-to-use code for crypto, PDFs, search, web scraping & more. No trial-and-error, no expensive APIs.
mengram
Human-like memory for AI agents — semantic, episodic & procedural. Experience-driven procedures that learn from failures. Free API, Python & JS SDKs, LangChain & CrewAI integrations.
nutrient-dws
A Model Context Protocol (MCP) server implementation that integrates with the Nutrient Document Web Service (DWS) Processor API, providing powerful PDF processing capabilities for AI assistants.
octagon-vc-agents
An MCP server that runs AI-driven venture capitalist agents (Fred Wilson, Peter Thiel, etc.), whose thinking is continuously enriched by Octagon Private Markets' real-time deals, valuations, and deep research intelligence. Use it to spin up programmable "VC brains" for pitch feedback, diligence simulations, term sheet negotiations, and more.
ai-learning
AI Learning: A comprehensive repository for Artificial Intelligence and Machine Learning resources, primarily using Jupyter Notebooks and Python. Explore tutorials, projects, and guides covering foundational to advanced concepts in AI, ML, DL and Gen/Agentic Ai.