1- # Agent-Airlock
1+ # Agent-Airlock 🛡️
22
3- ** The Pydantic-based Firewall for MCP Servers. Stops 99% of Hallucinated Tool Calls.**
3+ ** The Pydantic-based Firewall for MCP Servers. Stops Hallucinated Tool Calls Before They Wreck Your System .**
44
55[ ![ PyPI version] ( https://badge.fury.io/py/agent-airlock.svg )] ( https://badge.fury.io/py/agent-airlock )
6+ [ ![ CI] ( https://github.com/sattyamjain/agent-airlock/actions/workflows/ci.yml/badge.svg )] ( https://github.com/sattyamjain/agent-airlock/actions/workflows/ci.yml )
7+ [ ![ codecov] ( https://codecov.io/gh/sattyamjain/agent-airlock/branch/main/graph/badge.svg )] ( https://codecov.io/gh/sattyamjain/agent-airlock )
68[ ![ Python 3.10+] ( https://img.shields.io/badge/python-3.10+-blue.svg )] ( https://www.python.org/downloads/ )
79[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
810
@@ -98,12 +100,12 @@ def run_code(code: str) -> str:
98100
99101``` python
100102from fastmcp import FastMCP
101- from agent_airlock import Airlock, SecurityPolicy
103+ from agent_airlock import Airlock, STRICT_POLICY
102104
103105mcp = FastMCP(" secure-server" )
104106
105107@mcp.tool
106- @Airlock (policy = SecurityPolicy. STRICT )
108+ @Airlock (policy = STRICT_POLICY )
107109def delete_records (table : str , where : str ) -> dict :
108110 # Validated, policy-checked, and logged
109111 ...
@@ -128,20 +130,78 @@ def my_tool(...):
128130
129131## Why Agent-Airlock?
130132
131- | Feature | LangChain | AutoGen | Agent-Airlock |
132- | ---------| -----------| ---------| ---------------|
133- | Schema Validation | Manual | Manual | ** Automatic** |
134- | Self-Healing | No | No | ** Yes** |
135- | Sandbox Execution | No | No | ** E2B Native** |
136- | Open Source | Yes | Yes | ** Yes** |
137- | MCP Native | No | No | ** Yes** |
133+ | Feature | LangChain | AutoGen | Prompt Security | ** Agent-Airlock** |
134+ | ---------| -----------| ---------| -----------------| -------------------|
135+ | Schema Validation | Manual | Manual | Enterprise | ** Automatic** |
136+ | Self-Healing Errors | No | No | No | ** Yes** |
137+ | Sandbox Execution | No | No | No | ** E2B Native** |
138+ | MCP Native | No | No | Gateway | ** Decorator** |
139+ | Pricing | Open Source | Open Source | Enterprise $$ | ** Open Source** |
140+
141+ ## Predefined Policies
142+
143+ ``` python
144+ from agent_airlock import (
145+ PERMISSIVE_POLICY , # No restrictions
146+ STRICT_POLICY , # Requires agent ID
147+ READ_ONLY_POLICY , # Blocks write/delete operations
148+ BUSINESS_HOURS_POLICY , # 9 AM - 5 PM only
149+ )
150+
151+ # Custom policy
152+ from agent_airlock import SecurityPolicy
153+
154+ PRODUCTION_POLICY = SecurityPolicy(
155+ allowed_tools = [" read_*" , " query_*" ],
156+ denied_tools = [" delete_*" , " drop_*" ],
157+ rate_limits = {" *" : " 100/minute" },
158+ time_restrictions = {" write_*" : " 09:00-17:00" },
159+ )
160+ ```
161+
162+ ## Output Sanitization
163+
164+ ``` python
165+ from agent_airlock import Airlock, AirlockConfig
166+
167+ config = AirlockConfig(
168+ mask_pii = True , # Masks SSN, credit cards, emails
169+ mask_secrets = True , # Masks API keys, passwords
170+ max_output_chars = 5000 , # Prevents token explosion
171+ )
172+
173+ @Airlock (config = config)
174+ def query_users (name : str ) -> dict :
175+ # Output automatically sanitized:
176+ # {"ssn": "123-45-6789"} → {"ssn": "***-**-6789"}
177+ # {"api_key": "sk-live-xxx"} → {"api_key": "***REDACTED***"}
178+ return db.find_user(name)
179+ ```
138180
139181## Documentation
140182
141- - [ Full Documentation] ( https://github.com/sattyamjain/agent-airlock )
142- - [ Examples] ( ./examples )
143- - [ Security Best Practices] ( ./docs/SECURITY.md )
183+ - [ Examples] ( ./examples ) - Usage patterns and integrations
184+ - [ Security Best Practices] ( ./docs/SECURITY.md ) - Production deployment guide
185+ - [ API Reference] ( https://github.com/sattyamjain/agent-airlock#api-reference )
186+
187+ ## Contributing
188+
189+ Contributions are welcome! Please:
190+
191+ 1 . Fork the repository
192+ 2 . Create a feature branch (` git checkout -b feature/amazing-feature ` )
193+ 3 . Run tests (` pytest tests/ -v ` )
194+ 4 . Run linting (` ruff check src/ tests/ ` )
195+ 5 . Commit your changes (` git commit -m 'Add amazing feature' ` )
196+ 6 . Push to the branch (` git push origin feature/amazing-feature ` )
197+ 7 . Open a Pull Request
144198
145199## License
146200
147201MIT License - see [ LICENSE] ( ./LICENSE )
202+
203+ ---
204+
205+ ** Built with ❤️ for the AI agent security community.**
206+
207+ * If Agent-Airlock saved your production database from an LLM hallucination, consider giving us a ⭐!*
0 commit comments