Quick Start Guide
Connect any AI agent or Model Context Protocol (MCP) client to Airlock in minutes. Intercept prompt injection attacks, enforce data-flow policies, and protect upstream tools.
Add the Airlock Gateway MCP Endpoint
Airlock exposes an authenticated, standard Model Context Protocol (MCP) streamable endpoint.
Endpoint Details
Point your agent framework or MCP client to the gateway endpoint. The gateway accepts standard JSON-RPC 2.0 requests over HTTP:
http://localhost:4000/mcpAuthentication
Every request requires an agent bearer token in the Authorization header. Generate agent keys in the Agents tab of the dashboard:
Core Gateway Operations
How Airlock replaces blind multi-turn tool calling with compact code generation and zero-trust inspection.
Dynamically discovers upstream tool definitions and returns concise TypeScript interface stubs, reducing token ingestion by 94%+.
The agent submits its entire execution plan as a single script. Airlock statically analyzes the AST, extracts data flows, evaluates policy, and runs safe scripts in an isolated sandbox.
If a script contains sensitive data flows (like reading untrusted emails and writing to external sinks), it is held. Once an operator approves it, the agent retrieves the result here.
Client Configuration
Drop these configurations directly into your favorite agent harness or IDE.
{
"mcpServers": {
"airlock": {
"url": "https://gateway.airlock.dev/mcp",
"headers": {
"Authorization": "Bearer alk_live_YOUR_API_KEY"
}
}
}
}{
"mcpServers": {
"airlock": {
"url": "http://localhost:4000/mcp",
"headers": {
"Authorization": "Bearer alk_live_YOUR_API_KEY"
}
}
}
}import os, requests
GATEWAY_URL = os.getenv("AIRLOCK_GATEWAY_URL", "http://localhost:4000/mcp")
AGENT_KEY = os.getenv("AIRLOCK_AGENT_KEY", "alk_live_YOUR_KEY")
headers = {
"Authorization": f"Bearer {AGENT_KEY}",
"Content-Type": "application/json"
}
# 1. Search for available tools
stubs = requests.post(GATEWAY_URL, json={
"method": "search_tools",
"params": {"query": "inbox"}
}, headers=headers).json()
# 2. Run agent script plan
result = requests.post(GATEWAY_URL, json={
"method": "run_script",
"params": {
"code": "const emails = await tools.inbox.get_emails(); return emails.length;",
"intent": "Count inbound emails"
}
}, headers=headers).json()const GATEWAY_URL = "http://localhost:4000/mcp";
const AGENT_KEY = process.env.AIRLOCK_AGENT_KEY!;
// Submit script to Airlock Gateway
const res = await fetch(GATEWAY_URL, {
method: "POST",
headers: {
"Authorization": `Bearer ${AGENT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
method: "run_script",
params: {
code: "const t = await tools.tickets.list(); return t.length;",
intent: "Fetch ticket count"
}
})
});
const outcome = await res.json();
console.log("Airlock Outcome:", outcome);