How charan-suresh/interlock works
INTERLOCK is a deterministic security gateway and defensive benchmark for LLM-agent tool execution. A request enters through the API, selects a defense mode, and in the INTERLOCK mode is planned before untrusted inputs are processed; execution then passes through gateway checks before tools run. Value labels, provenance, quarantine, and corroboration support those checks. The API also exposes benchmark runs and replay, while the web app presents comparison and execution visualizations. Some UI wiring and runtime details are unsampled, so those links are omitted.
Main entry points: executor.py Plan execution · gateway.py Policy gateway · CompareView.tsx Run comparison · handles.py Value vault
Components 29
Security runtime
- Defense modes
interlock/defenses - INTERLOCK mode
interlock/defenses/interlock.py - Plan generation
interlock/core/planner.py - Plan contract
interlock/core/plan.py - Plan execution
interlock/core/executor.py - Policy gateway
interlock/core/gateway.py - Quarantine extraction
interlock/core/quarantine.py - Value vault
interlock/core/handles.py - Flow labels
interlock/core/labels.py - Corroboration
interlock/core/corroborate.py - Policy contract
interlock/core/policy.py - Execution events
interlock/core/events.py - LLM client
interlock/core/llm.py
Tools and evidence
- Tool schemas
interlock/tools/registry.py - Mock tools
interlock/tools/mocks.py - Exfiltration collector
interlock/tools/collector.py
Benchmark arena
- Benchmark runner
interlock/arena/runner.py - Arena metrics
interlock/arena/metrics.py
Web views
- Run comparison
web/components/CompareView.tsx - Plan flowchart
web/components/AnimatedFlowchart.tsx - Execution timeline
web/components/ExecutionTimeline.tsx - Verdict panel
web/components/VerdictPanel.tsx - Media inspector
web/components/MediaInspector.tsx - Collector terminal
web/components/CollectorTerminal.tsx - Benchmark scoreboard
web/components/Scoreboard.tsx - Label chip
web/components/LabelChip.tsx
Other components
- Requestor
Connections 39
- Requestor → HTTP API: submits task
interlock/api.py - HTTP API → Defense modes: selects mode
interlock/api.py - HTTP API → Benchmark runner: runs benchmarks
interlock/api.py - INTERLOCK mode → Plan generation: generates plan
interlock/defenses/interlock.py - Plan generation → LLM client: requests completion
interlock/core/planner.py - Plan generation → Plan contract: builds plan
interlock/core/planner.py - Plan generation → Tool schemas: loads tool schemas
interlock/core/planner.py - INTERLOCK mode → Plan execution: executes plan
interlock/defenses/interlock.py - Plan execution → Policy gateway: checks tool call
interlock/core/executor.py - Plan execution → Value vault: uses handles
interlock/core/executor.py - Plan execution → Quarantine extraction: extracts untrusted data
interlock/core/executor.py - Plan execution → Corroboration: verifies claims
interlock/core/executor.py - Plan execution → Mock tools: dispatches tools
interlock/core/executor.py - Plan execution → Execution events: publishes events
interlock/core/executor.py - Quarantine extraction → Value vault: stores extracted values
interlock/core/quarantine.py - Quarantine extraction → LLM client: extracts structured data
interlock/core/quarantine.py - Corroboration → Value vault: checks ancestry
interlock/core/corroborate.py - Value vault → Flow labels: attaches labels
interlock/core/handles.py - Policy gateway → Value vault: resolves handles
interlock/core/gateway.py - Policy gateway → Flow labels: enforces flow labels
interlock/core/gateway.py - Policy gateway → Plan contract: checks contract
interlock/core/gateway.py - Policy gateway → Policy contract: evaluates policy
interlock/core/gateway.py - Policy gateway → Tool schemas: looks up sink
interlock/core/gateway.py - Policy gateway → Execution events: publishes replans
interlock/core/gateway.py - Mock tools → Exfiltration collector: logs exfiltration
interlock/tools/mocks.py - Mock tools → Tool schemas: uses schemas
interlock/tools/mocks.py - HTTP API → Execution events: replays events
interlock/api.py - Benchmark runner → Arena metrics: computes metrics
interlock/arena/runner.py - Benchmark runner → LLM client: runs model
interlock/arena/runner.py - Benchmark runner → Defense modes: runs defense modes
interlock/arena/runner.py - Run comparison → Plan flowchart: renders
web/components/CompareView.tsx - Run comparison → Execution timeline: renders
web/components/CompareView.tsx - Run comparison → Verdict panel: renders
web/components/CompareView.tsx - Run comparison → Media inspector: renders
web/components/CompareView.tsx - Run comparison → Collector terminal: renders
web/components/CompareView.tsx - Plan flowchart → Label chip: renders
web/components/AnimatedFlowchart.tsx - Execution timeline → Label chip: renders
web/components/ExecutionTimeline.tsx - Verdict panel → Label chip: renders
web/components/VerdictPanel.tsx - Media inspector → Label chip: renders
web/components/MediaInspector.tsx