interlock
Features

Everything on the decision path

Interlock is a pipeline: route by blast radius, evaluate deterministically, ask a local judge the narrow questions, probe the result, compose deny-wins, and record it all.

Gating & Decisions

The core interlock — every proposed action is routed, evaluated, and composed into a single verdict.

Pre-action gate

verified

Allow / ask / block before execution. Verified live on Claude Code, Codex, and Kiro: a force-push to main was refused before it ran, the agent was told why, and the session continued.

Three-tier routing

Read-only, in-workspace writes, and gated actions each get the right amount of scrutiny — with sensitive-path promotion (reads of ~/.ssh, ~/.aws, .env are promoted to gated).

Shell decomposer

Understands chains, pipes, subshells, backticks, interpreter one-liners, heredocs, base64 decode-and-execute, and data arguments — so obfuscation doesn't slip through.

Paths as the file system sees them

On macOS and Windows, whose file systems ignore case, ~/.CLAUDE/settings.json is ~/.claude/settings.json and is caught as one. Windows paths (C:\Users\me\.claude\...) hit the same rules, and the Startup folder and PowerShell profiles count as persistence.

Cedar mandate

An authorization envelope written in Cedar — the same policy language as Amazon Bedrock AgentCore Policy.

Composer

Deny-wins semantics, OGR continuation wording, and per-rule policy overrides fuse every signal into one disposition.

Denial budget

3 consecutive or 20 total denials escalate to the user, so a stuck agent can't grind against the gate.

Shadow mode

default

Decide and record, never enforce — the default for new installs so you can watch before you block.

Fail modes

Applied by the hook when the daemon can't judge a call. fail_mode.default (open unless you change it) covers a daemon you stopped with interlock stop; fail_mode.tamper (closed) covers a tampered gate or a daemon that disappeared without one. INTERLOCK_FAIL_MODE can only tighten.

The Judge

A small, local, open-weights decision model answers narrow structured questions — never free-form prose.

Strands Decider 2B

optional

Optional and off by default. Open-weights (Apache-2.0), runs locally on Apple Silicon (MLX) or NVIDIA GPU — or on SageMaker for teams.

Question library v1

intent_authorized · exfil_risk · confirmation_given · injection_present · injection_targets_action — typed questions, not open prompts.

Minimal state projector

Sees user messages, prior-call summaries, and the structured action — never agent prose, tool output, or policy text. Structural injection defense by construction.

Policy bands

Configurable thresholds on judge answers map to allow / ask / block.

interlock judge install

One command installs the judge on this machine (about 5 GB of weights) and adds it to your policy; the daemon starts and supervises it in the background, so startup never waits on the model.

Post-Action Probe

Tool results are attacker-controlled. The probe inspects output before the agent ever reads it.

Local injection detector

default

On by default, no cloud: flags tool output that tries to instruct the agent, including text hidden in HTML comments, invisible Unicode tag characters, zero-width text, and ROT13 or base64 encodings. Caught 24/24 labelled injections with 0 false positives on the evaluation corpus.

Public benchmarks

Measured on AgentDojo (its leaderboard injection template: 100% caught) and InjecAgent (97% of enhanced attacks on the harm set), with 0.25% false positives on real documentation. Scripts are in the repository so you can rerun them.

Bedrock Guardrails (optional)

Add InvokeGuardrailChecks as an extra detector for prompt injection, jailbreaks, and credential entities with character offsets.

Composed detectors

The local detector, Guardrails, and the judge compose deny-wins, so any one can catch an injection the others miss.

Dispositions

verified

pass · warn · withhold — the probe can annotate or replace a result, not just flag it. Withholding verified live in Claude Code for shell and file reads.

Flip test

built

interlock test --judge … --flip asks each judge question again with the deciding evidence flipped and lists the cases where the answer doesn't change: a judge that ignores the evidence. Tested with recorded answers; not yet against a live judge.

Harness Adapters

One decision API, many agents. Each adapter translates its harness's hook protocol to and from Interlock.

Claude Code

verified

Deny before execution and withhold injected results, verified live against the real CLI; user-level hooks installed by interlock init.

Codex

verified

Deny before execution verified live against the real CLI; hooks in ~/.codex/hooks.json (trust once with /hooks).

Kiro (IDE)

verified

33 ms end-to-end. Block works; ask renders as block-with-notice. Verified live.

Cursor CLI

verified

Deny before execution verified live; hooks in ~/.cursor/hooks.json.

GitHub Copilot CLI

verified

Deny before execution and withholding injected results, verified live.

Gemini CLI

verified

Deny before execution and withholding injected results, verified live; hooks in ~/.gemini/settings.json.

Windsurf (Devin.app)

verified

Deny before execution verified live; injected files are refused before Cascade reads them.

Antigravity · OpenCode

built

Built from their documented hooks and plugin APIs, installed by interlock init; live verification in progress.

Any MCP client

verified

Covered by the MCP gateway, hooks or not.

interlock capture

Record the real hook payloads an agent sends, with Interlock's replies, check that blocks held, and export redacted fixtures. How an adapter moves from built to verified.

Cline · more

planned

Plugin adapters where the tool allows.

MCP Gateway

Every MCP server an agent talks to goes through Interlock, so any MCP client is covered, with hooks or without.

Tool-definition pinning

verified

Each tool's name, description, and schema are hashed on first use. A definition that later changes (a rug pull) is hidden until you review it.

Poisoned-tool hiding

verified

Descriptions that try to instruct the model (<IMPORTANT> blocks, reading secrets, rules about other tools) never reach the agent.

Gated tool calls

verified

Every MCP call is decided like any other tool call, including the shell rules for terminal-style tools. A refusal never reaches the server.

Withheld results

Tool results that carry injected instructions are replaced before the agent reads them.

OAuth checks

On remote servers, a token issued for another service is never passed on (audience binding), denied scopes are refused, administrative scopes are flagged, and each server's authorization servers are pinned on first use. Interlock reads audience and scopes only; it never stores tokens.

Local and remote servers

stdio servers through interlock mcp-proxy; remote (Streamable HTTP, including SSE) servers through the daemon.

One command

interlock gateway wrap routes the servers in Claude Code, Codex, Cursor, VS Code, Kiro, Gemini CLI, Claude Desktop, and Windsurf; unwrap restores them exactly.

Session-Level Protection

Some attacks are only visible across a session. Interlock keeps per-session state so it can see them.

Toxic-flow detection

Private data read + untrusted content taken in + a call that can send data out, in one session: Interlock asks before the third step (the "lethal trifecta").

Withheld stays withheld

Once a tool result is withheld as injected, a later call that reads the same file another way (a shell one-liner, a ROT13 or base64 encoding) is asked about. Found live on Gemini CLI.

MCP server and tool policy

Allow, ask, or block per server and tool with globs (github/delete_*), across every agent and the gateway.

Denial budget

An agent that keeps hitting refusals is stopped and the user is asked, instead of letting it try variations.

OS-Level Enforcement

Hooks see what an agent reports. The sandbox and egress proxy hold even for what it doesn't.

interlock sandbox

verified

Run any agent in an OS sandbox: shell rc files, ~/.ssh, LaunchAgents, and Interlock's own files can't be written, whatever path the write takes. Verified live with Claude Code on macOS.

Egress proxy

verified

Every outbound host decided by policy (cloud metadata endpoints refused, --strict allowlists); HTTPS tunnelled, never decrypted.

Proxy as the only way out

sandbox --egress confines the agent's network to localhost, so connections that skip the proxy never leave the machine.

Custom Agents

Agents you build yourself get the same gate in-process, with the same policy and audit log as the hooks.

Claude Agent SDK

verified

guard_options(options) adds PreToolUse / PostToolUse hooks: refused calls are denied with the reason, injected results replaced. Verified live with a real SDK session.

Strands Agents

verified

Agent(hooks=[InterlockHooks()]): refused calls are cancelled, injected results replaced. Tested with a real Strands agent.

LangChain / LangGraph

verified

guard_tools(tools) wraps any BaseTool, sync and async. Tested against langchain-core.

OpenAI Agents SDK

verified

guard_agent_tools(agent) adds native tool guardrails (reject_content). Tested through a real Runner.

Google ADK

verified

guard_agent(agent) adds before/after tool callbacks. Tested through a real InMemoryRunner.

CrewAI

verified

install() registers global tool hooks for every crew in the process. Tested through CrewAI's hook registry.

Semantic Kernel

verified

guard_kernel(kernel) adds a function-invocation filter for every plugin function. Tested through a real Kernel.

JavaScript & TypeScript

verified

npm install @interlockd/sdk (no dependencies): guardTools(tools) for the Vercel AI SDK, Mastra, and any { execute } tool map; guardOptions(options) for the Claude Agent SDK for TypeScript. Verified with the real packages.

Any framework

InterlockClient().decide(...) is a few lines to call from anything else.

Native Windows

new

interlock init installs the agent hooks on Windows (a Python hook shim with the same replies as the sh shim, about 60 ms per call) and starts the daemon at sign-in; the SDKs and the gateway work there too. Tested by running every agent's installed hook through cmd.exe and PowerShell on a Windows runner; live runs with each agent on Windows are still to come. The sandbox and the local judge need macOS or Linux.

Policy

Layered, validated YAML — hashed onto every verdict so a decision is always traceable to the policy that made it.

Layered configuration

defaults → user → workspace, validated and hashed onto every verdict.

Repository policies

Commit .interlock/policy.yaml and everyone with Interlock gets it inside the repo. It can only tighten your own policy unless you trust the repo, so a poisoned repo can't switch rules off.

Plugins

Installed packages can add interlock commands and background work beside the daemon, through a stable, versioned plugin API (interlockd.plugin_api) covered by contract tests, which can also validate, tighten and compose policies (layer a baseline and group policies into one managed policy). Plugins run beside the gate, never inside it, so they can't change a decision.

Managed policy

A managed-policy.yaml applied last that can only tighten decisions (it can switch enforce on, never loosen anything), reloaded without a restart. For device management and centrally managed machines.

Trust model

Workspace roots, allowed remotes, allowed hosts, protected branches, protected paths, sensitive paths, and package indexes.

Per-rule overrides

Change the action, enable/disable, or adjust the questions asked — rule by rule.

Safer force pushes (opt-in)

built

rewrites: [git.force_with_lease] turns a plain git push --force into a question that offers --force-with-lease instead. Claude Code only; its rewrite contract isn't verified live yet.

Policy unit tests

Run the policy against a corpus with interlock test before you ship a change.

interlock redteam

Replay attack scenarios (injection through tool results, exfiltration, persistence, supply chain, MCP poisoning) and the evaluation corpus through your policy, and see what would get through. Deterministic, no network; exits 1 on a regression, so it can gate CI.

GitHub Action

uses: interlockd/interlock: scan the repo's MCP servers, agent configs, prompts and agent code (SARIF for code scanning), test its policy, and optionally red-team it in CI.

interlock scan

Audit MCP servers and agent settings (unpinned packages, inline secrets, broad filesystem access, auto-approved tools, permission bypasses) and the project itself: Claude Code project settings and the hooks it ships, prompt and instruction files that hold secrets or tell the agent to skip safety checks, and agent code (Strands, LangGraph, OpenAI Agents SDK, CrewAI) whose tools reach the shell, files or network without Interlock.

Self-Protection

The gate only works if its own hooks, policy, token and daemon are the ones you installed. Interlock checks them, refuses to trust a gate it can't verify, and tells you what changed.

Daemon identity

new in 0.2

Every daemon reply carries an identity derived from your install's token. A hook applies only replies that carry yours, so another install's daemon or any other process on the port can't answer for it, and the call is refused (daemon_identity).

Fail closed when the gate is in doubt

new in 0.2

A rejected token, a reply without your daemon's identity, or a daemon that vanished without interlock stop is refused under fail_mode.tamper, closed by default. The refusal names the cause and the command that fixes it.

Stop versus loss

interlock stop, restart and the commands that restart the daemon leave a marker first, so a stop you made keeps your usual fail mode. A daemon killed without one is an unexpected loss, refused and recorded at the next start with the calls nobody judged.

Hook and shim checks

Each agent's hook entry and shim are checked on every request (one stat each when unchanged) and every 10 s. A changed shim is restored from the package; a removed hook is reported. In enforce mode, calls from that agent are blocked until interlock init or interlock ack.

Policy and token pinning

policy.yaml, the managed policy and the token are pinned by digest. An edit made outside interlock commands is reported with the top-level keys that changed, never their values, and the pinned copy stays in force until interlock policy accept or revert.

Protection state

protected, observing, stopped or compromised, per agent and for the install: the first line of interlock status, a block in interlock doctor, the health endpoint, the plugin API and OpenTelemetry. An optional desktop notification when it turns compromised.

interlock ack

Accepting a tamper finding is explicit: ack lists every reason and every file that differs from the baseline, asks, then re-baselines. Recorded in the hash-chained audit log, like every operator action.

Agents can't switch it off quietly

An agent that runs interlock ack, shadow, stop, uninstall, policy accept or token --rotate is asked about first (persistence.interlock_control), and the action it caused is recorded as coming from that tool call.

Proved on your machine

interlock selftest checks that a wrong token is rejected and recorded; --shim runs each installed hook against a stand-in daemon and expects it to refuse. interlock bench shows what the per-request check costs (about 0.04 ms at p95 on an M-series Mac).

Audit & Observability

Every decision is recorded locally first. Prove it hasn't been edited, explain it, export it.

Local append-only spool

fsync per record — the decision path never waits on the network.

Tamper-evident log

Records are hash-chained; interlock audit verify names the first edited, removed, or reordered record.

interlock explain

Why was that stopped? Plain language for every rule, what the agent was told, and the override snippet.

OpenTelemetry

One span per decision to any OTLP collector; a session is one trace. Arguments are never exported; tamper and protection records export only their kind and state.

AI bill of materials

interlock aibom: CycloneDX 1.6 inventory of agents, models, and MCP servers with package URLs and pinning.

DynamoDB single table (optional)

TTL 90 days, PITR, stream, 3 GSIs, KMS encryption. A CloudFormation sample (examples/aws/interlock-audit.yaml) creates it and keeps your records if the stack is deleted.

Background drainer

Drains the spool to DynamoDB with backoff, so offline operation just catches up later.

Review queue

GSI3 surfaces asked / blocked / warned per day for review.

Lakehouse export

planned

Streams → Firehose → S3 (Iceberg) → Athena.