💡 摘要
Interlock是一个用于AI基础设施的断路器,确保质量并提供取证日志。
🎯 适合人群
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);文件读写范围与路径穿越风险。以最小权限运行,并在生产环境启用前审计代码与依赖。

INTERLOCK
Interlock is a circuit-breaker + evidence layer for AI infrastructure. It monitors runtime signals (confidence/latency/failure), refuses or degrades when the system is outside safe bounds, and writes verifiable forensic logs.
What it does
- Quality gating: refuse/degrade low-certainty responses
- Survivability: shed load and recover cleanly under stress
- Evidence: cryptographic provenance for interventions + configs
- Adapters: integration points for vector DBs and local models
Quickstart
Docs: Quickstart · Local AI · Middleware
Express (Node)
import { interlockExpress } from '@interlock/express'; app.use(interlockExpress({ quality_floor: 0.8 }));
FastAPI (Python)
from interlock_fastapi.middleware import InterlockMiddleware app.add_middleware(InterlockMiddleware, interlock_url="http://brain:3000")
Supported Integrations
| Integration | Status | |-------------|--------| | Pinecone | ✅ Production | | FAISS | ✅ Production | | LangChain | ✅ Production | | LlamaIndex | ✅ Production | | Weaviate | ✅ Stable | | Milvus | ✅ Stable | | Ollama / Local AI | ✅ Tested |
Evidence & Validation
CI workflows produce repeatable artifacts (stress, scale, adapter certification).
See: Test Results · Live Incidents
OperatorPack Receipt Verification
Interlock includes tools to verify and index OperatorPack receipts (JSON).
Usage
-
Verify a receipt:
python tools/verify_operatorpack.py "C:\path\to\operatorpack.json"Outputs a JSON verdict (PASS/WARN/FAIL) based on performance and quality thresholds.
-
Index a receipt:
python tools/append_receipt_index.py "C:\path\to\operatorpack.json" "receipts/RECEIPTS_INDEX.md"Appends metrics to a Markdown table index file for long-term tracking.
Recommended Workflow
Place new receipts in receipts/inbox/ for verification before promotion.
Example using a sample receipt:
python tools/verify_operatorpack.py "receipts/examples/operatorpack_example_pass.json"
Receipt Workflow
Interlock supports a standard promotion workflow for OperatorPacks with 2-Tier Governance:
-
Inbox: Copy new receipt JSON files into
receipts/inbox/. -
Promote: Run the promotion script with the desired tier:
- Production (Default): Strict gates ($N \ge 10,000$).
pwsh -File tools/promote_receipt.ps1- Results land in
receipts/approved/orreceipts/rejected/. - Primary index:
RECEIPTS_INDEX.md.
- Results land in
- Exploration: Faster iteration gates ($N \ge 2,000$).
pwsh -File tools/promote_receipt.ps1 -Mode exploration- Results land in
receipts/approved_experimental/orreceipts/rejected_experimental/. - Secondary index:
RECEIPTS_INDEX_EXPERIMENTAL.md.
- Results land in
- Production (Default): Strict gates ($N \ge 10,000$).
-
Audit: Review the
receipts/approved/folder andRECEIPTS_INDEX.md(or the experimental equivalents) for historical data.
[!NOTE] Approved receipts and summaries are generated locally and are not committed to the repository to maintain data privacy.
Practical: What to do next
- Generate Evidence: Obtain a receipt JSON (OperatorPack) from a lab (e.g., TESLA) — keep it outside Interlock as the source of truth.
- Stage: Copy it into
receipts/inbox/. - Promote (Production):
Or specify a file:pwsh -File tools/promote_receipt.ps1pwsh -File tools/promote_receipt.ps1 -Receipt "C:\path\to\receipt.json" - Promote (Exploration):
pwsh -File tools/promote_receipt.ps1 -Mode exploration - Summarize:
python tools/summarize_receipts.py - Artifact Locations:
receipts/approved/orreceipts/approved_experimental/(Local only)receipts/rejected/orreceipts/rejected_experimental/(Local only)receipts/summary/(Local only)
These outputs are local artifacts and are gitignored by design in this public repo.
AI Collaboration
This repo uses a multi-agent workflow with safety guardrails.
- Project Memory: CLAUDE.md - Build commands, safety rules, agent assignment
- Safety Policy: docs/AI_COLLAB_SAFETY.md - PII protection, merge gates
- Coordination: multi_agent_coord.template.md - Handoff protocol template
AI agents must run tools/precommit_safety_scan.ps1 before commits.
License
MIT. See LICENSE.
优点
- 提高AI响应质量
- 为干预提供取证证据
- 支持多种集成
- 提高系统在压力下的弹性
缺点
- 需要正确配置以确保有效性
- 可能增加AI工作流程的复杂性
- 依赖外部集成
- 可能导致性能开销
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 CULPRITCHAOS.
