interlock
How It Works

One daemon on the tool-call path

Interlock sits inline between the agent and the action. Every proposed tool call is normalized into one event, routed by blast radius, decided deterministically (with an optional local judge), probed after it runs, and recorded. This page follows one call through.

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 answer allow, ask, or block in about 2 ms. An optional Cedar mandate and open-weights decision model handle the ambiguous cases.

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
    61 rules · 9 groups · 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
How it decides

The decision pipeline, end to end

Every gated call runs the same thirteen steps. The deterministic prefix is bounded to single-digit milliseconds; the model and the probe run concurrently inside a strict budget.

13-step pipeline

1
Authenticate
Bearer token, size-check, assign event_id (ULID); check the calling agent's hook and shim. Every reply carries this install's daemon identity.
2
Normalize
Harness payload → InterlockEvent.
3
Ledger
Session, turn, counters.
4
Tier routing
Classify the action: tier 0 / 1 / 2.
5
Deterministic evaluation
Packs, mandate, budgets.
6
Policy compiler
Compile policy → typed questions.
7
State projector
Structured, bounded, role-separated context.
8
DecisionBackend
Optional: Strands Decider (local) or SageMaker.
9
Post-action probe
Local injection detector; Bedrock Guardrails and the judge if enabled.
10
Flip test
If injection_present ≥ threshold.
11
Composer
Deny-wins → final disposition.
12
Spool append
fsync — durable before the verdict returns.
13
Return verdict
allow / ask / block, with findings.

Latency budget

< 10 ms
Steps 1–5 complete on a laptop before anything async starts.
600 ms
Steps 6–10 bounded by the backend timeout (default).
concurrent
Optional detectors run alongside the local probe, not after it.

The full threat model, including known limits, is in docs/THREAT-MODEL.md.

Threat model

Assets protected

  • ▸Workspace
  • ▸Git history
  • ▸Credentials (~/.ssh, ~/.aws, .env)
  • ▸Shared infrastructure
  • ▸The agent's own configuration
  • ▸Interlock's own hooks, policy, and token

Why actions turn dangerous

(Anthropic taxonomy)

  • Overeager behavior
    The agent acts beyond what it was authorized to do.
  • Honest mistakes
    A wrong assumption about blast radius.
  • Prompt injection
    Hostile instructions in file contents, web pages, shell output, or MCP results.
  • Misaligned model
    The model's objective diverges from the user's.

The defense

Refuse the action before it runs. The response is identical in all four cases — Interlock doesn't need to know why an action is dangerous to stop it.

Adversary model

  • untrustedTool results are attacker-controlled.
  • taintedAgent prose is attacker-influenced after reading hostile content.
  • trustedOnly user messages and structured tool calls are trusted inputs.

When the gate itself is the target

A hook only applies a reply that carries your daemon's identity, so another install's daemon on the same port can't answer for it. A rejected token, a missing identity, or a daemon that disappeared without interlock stop fails closed. Hooks, shims, the policy and the token are pinned and checked; a change you didn't make is reported, never silently accepted.

The honest limit: the agent runs as you, and the hook it runs must read the token and the identity, so code running as you can read them too. What stops an agent is the rules that refuse its writes to Interlock's files and ask before it runs interlock commands that change protection, plus the OS sandbox.