interlock
● local-firstOGR conformanceApache-2.0 (planned)

The safety layer between your AI agent and your codebase.

Interlock hooks into the agent's tool-call path and checks every shell command, file write, and network action against deterministic safety rules, a scoped mandate, and a small local judgment model before it runs.

Works with Kiro · Claude Code · Codex · Strands Agents · LangGraph

interlock serve — ~/project

Gates every tool call

Allow, ask, or block — before execution. The decision happens on the agent's tool-call path, not after the damage is done.

Probes tool results

Catches prompt injection and credential leaks in output, flipping dangerous results to warnings or withholding them.

Records everything

A tamper-evident audit trail — findings, probabilities, policy hash, timing — durable to DynamoDB before the response returns.

Local-first

Runs on your laptop and your AWS account. No third-party service sits in the loop and no data leaves your account.

How it works

Three steps on the critical path

Interlock sits inline between the agent and the action. Every gated call runs the same loop.

01

Agent proposes an action

A shell command, file edit, git push, network call, or MCP tool invocation arrives on the tool-call path.

02

Interlock decides

48 deterministic rules in 6 packs, a Cedar mandate, and a 2B decision model answer: allow, ask, or block — under 60 ms for the deterministic path, under 700 ms with the model.

03

The verdict is recorded

Findings, probabilities, policy hash, and timing are written to a durable local spool before the response returns, then drained to DynamoDB.

Architecture

One daemon, one decision path

Harness adapters normalize every proposed action into a single event, then the daemon runs it through a deterministic engine, a local judge, and a result probe — composed deny-wins.

Harness adapters
KiroClaude CodeCodexStrandsLangGraph
↓ POST /interlock/v1/decide
interlockd daemon
  1. 01
    Normalizer
    harness payload → InterlockEvent
  2. 02
    Tier Router
    0 · 1 · 2
  3. 03
    Deterministic Engine
    48 rules · 6 packs · Cedar
  4. 04
    State Projector
    structured · role-separated
  5. 05
    Strands Decider 2B
    local judge model
  6. 06
    Bedrock Guardrails
    injection · secrets probe
  7. 07
    Composer
    deny-wins → verdict
  8. 08
    Audit Store
    spool → DynamoDB
trusted inputs: user messages + structured tool callsverdict durable before response returns
Tier routing

Cheap actions stay cheap

Not every action deserves the full pipeline. Interlock routes by blast radius so reads cost a millisecond and only genuinely risky actions pay for the judge.

Tier 0
Read-only
File reads, searches → allowed immediately
~1 ms
Tier 1
In-workspace writes
Edits under workspace roots → secrets + persistence check
~2 ms
Tier 2
Gated
Shell, git, network, deletes, MCP tools → full pipeline
~5 ms deterministic · ~400 ms with model
310
tests
252
pack corpus cases
82 hard negatives
48
rules in 6 packs
4
harness adapters
2.8 ms
p95 tier-0
inside the daemon
139 ms
per judge question
Apple Silicon (MLX)

Put a gate in front of your agent.

Install for your harness, run the daemon in shadow mode, and watch every decision in a live log. Enforce when you're ready.