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.

1

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:

Gateway MCP URLhttps://gateway.airlock.dev/mcpLocal Dev: http://localhost:4000/mcp

Authentication

Every request requires an agent bearer token in the Authorization header. Generate agent keys in the Agents tab of the dashboard:

Authorization HeaderBearer alk_live_9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4dAgent keys can be suspended instantly via the emergency kill switch.
2

Core Gateway Operations

How Airlock replaces blind multi-turn tool calling with compact code generation and zero-trust inspection.

search_tools()

Dynamically discovers upstream tool definitions and returns concise TypeScript interface stubs, reducing token ingestion by 94%+.

run_script()

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.

get_result()

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.

Policy Precedence: DENY (immediate rejection) > HOLD (operator review) > ALLOW (sandboxed run).
View Active Policies →
3

Client Configuration

Drop these configurations directly into your favorite agent harness or IDE.

Cursor (.cursor/mcp.json)JSON
{
  "mcpServers": {
    "airlock": {
      "url": "https://gateway.airlock.dev/mcp",
      "headers": {
        "Authorization": "Bearer alk_live_YOUR_API_KEY"
      }
    }
  }
}
Claude Desktop (claude_desktop_config.json)JSON
{
  "mcpServers": {
    "airlock": {
      "url": "http://localhost:4000/mcp",
      "headers": {
        "Authorization": "Bearer alk_live_YOUR_API_KEY"
      }
    }
  }
}
Python (LangChain / CrewAI / Requests)Python
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()
Node.js / TypeScriptTypeScript
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);