
Epistemic Integrity Framework (EIF)
io.github.leocelis由 GitHub 账号 leocelis 发布v4.2.0更新于 Nov 5, 2026
Runtime gate for AI agent claims. Catches sycophantic drift, circular self-validation, causal errors
概览
对 AI 智能体的关键论断运行科学方法流水线,依据证据将决策路由为 ACT、REVISE 或 HALT。
- 可以做什么
- 创建并查看会话,把框架原则载入上下文
- 通过八阶段流水线声明、证伪、因果门控、校准、质疑、更新与解释假设
- 运行辅助关卡:对抗性输入检测、谄媚与立场漂移检查、假设排序、复现协议与纲领健康度
- 记录溯源信息、映射到欧盟 AI 法案条款并生成合规报告
- 记录标注结果,读取校准、拦截率与溯源报告
- 一次调用完成决策验证,或从自由文本中抽取结构化论断
- 适用场景
- 适用于智能体做高风险决策、错误自信代价高昂的场景,例如合规、工程、金融或不可逆操作,并希望在行动前用独立证据检验假设。
- 运行要求
- 远程 SSE 端点,需在 Authorization 头中提供 bearer API 密钥,密钥需通过项目的 GitHub Discussions 申请;托管端点被说明为私有 alpha。也可用 Python 和 eif-engine 包本地自托管,或通过 uvx 运行且无需密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Epistemic Integrity Framework (EIF),将其添加到工作区。
- 连接 Authorization token 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 SSE。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.leocelis%2Feif/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。
{
"mcpServers": {
"epistemic-integrity-framework-eif": {
"type": "sse",
"url": "https://eif.leocelis.com/sse",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}README
EIF - Epistemic Integrity Framework
Apply the scientific method to every assumption your AI agent makes.
[License: MIT] [Python 3.11+] [MCP Compatible] [tests] [ComplyEdge runtime enforcement]
The problem
AI agents compound errors. Each assumption that goes unchallenged becomes the foundation for the next one. A 90%-accurate agent running 10-step tasks produces correct output only 35% of the time - that's the compound error curve. That 0.9^10 curve is an upper bound: it assumes independent, non-recoverable per-step errors, whereas real pipelines have correlated and recoverable steps, so EIF's value is framed as reducing the error rate per load-bearing step rather than as the literal compound figure. In high-stakes domains (compliance, engineering decisions, financial advice), this translates to real cost.
The dominant source of that cost is not hallucinated facts, but unchallenged assumptions that are never tested against evidence.
What EIF does
EIF is a Python library and MCP server that runs an 8-phase scientific-method pipeline on every load-bearing assumption in an agent's response:
Plus auxiliary gates that run before/after the core loop:
At the end of each turn, EIF routes the agent's output:
- ACT - posterior ≥ threshold, evidence supports, safe to proceed
- REVISE - some assumptions unresolved, moderate confidence
- HALT - evidence contradicts a HIGH-consequence claim; do not proceed
Corpus evidence
EIF was validated against 14 multi-agent conversation scenarios across 5 domains (clinical, engineering, compliance, investment, M&A).
Scope note: the 14-scenario corpus is constructed and illustrative - it demonstrates the mechanisms, not field results. A separate field-validation track on real agent traffic is the basis for production false-positive measurement. EIF can also estimate a modeled dollar cost per HALT-routed claim (a distinct feature); those figures and their methodology live in
validation/CORPUS_REPORT.md, not here.
P4 (circular LLM self-validation) rate: 0.0% across all 14 scenarios. Every piece of evidence came from an independent source - executable code, coordinator tool outputs, or live web search.
Full evidence: validation/CORPUS_REPORT.md. Per-scenario reports available on request via GitHub Discussions.
Quick start
Two-tool path (recommended for first session)
Register a P0 host tool (highest-accuracy evidence tier)
When your agent has access to an authoritative data source (IGDB, your database, an internal API), register it as a P0 host tool. EIF calls it directly - no web search, no guessing.
P0 is the highest-priority evidence tier. Without a registered tool, EIF falls back to web search (P3), which can return false-positive SUPPORTS for specific numeric metrics. For production use, register the tool.
See examples/quickstart.py for a complete end-to-end example (a different scenario, an infrastructure-migration decision, walking DECLARE through EXPLAIN in one script).
MCP server (Cursor / Claude Code / Claude Desktop integration)
Per-client setup guides (register the server, install the rules block, verify,
troubleshoot) live in docs/integrations/:
Claude Code ·
Cursor ·
Claude Desktop.
The short version:
Option A - hosted endpoint (private alpha, zero install):
Request a key by opening a Discussion, then add the config for your client.
Cursor (~/.cursor/mcp.json) and Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
VS Code / GitHub Copilot (.vscode/mcp.json): use "servers" (not "mcpServers") and add "type": "http" to the entry.
The hosted endpoint is in private alpha. Everything below runs fully on your own machine with no key.
Option B - local venv (works today, fully self-hosted):
Option C - uvx (zero-install, works today):
uv runs the executable matching the package name by default; since the console
scripts are eif-mcp-server / eif-mcp-http-server (not eif-engine), --from
is required. Bare uvx eif-engine fails with "An executable named eif-engine
is not provided by package eif-engine".
EIF exposes 25 tools your agent can call:
Session (1 tool):
Core pipeline (8 tools):
Gates and monitors (5 tools):
Calibration and agenda (4 tools):
Utilities (7 tools):
Recommended agent loop (in your system prompt or MCP server instructions):
Paste the block below into an agent instruction file (.cursorrules, CLAUDE.md,
AGENTS.md, or .cursor/rules/eif.mdc) so eif_check_rules_installed can confirm
it is present and your agent picks up the loop automatically:
The canonical text of this block lives in
docs/integrations/README.md; the checker
accepts any <BEGIN-EIF vX.Y> marker, so existing v1.0 installs stay valid.
Evidence collection tiers
EIF's FALSIFY phase collects evidence from independent sources, prioritised:
P0 is the highest-priority tier and is the mechanism used in the Manor Lords / IGDB demo. P4 is never used for company-specific claims. In the validation corpus, P4 rate was 0.0% across all 14 scenarios.
Architecture
Research foundation
EIF integrates findings from:
Full research citations: docs/research_foundation.md
Primary-source literature reviews (15 documents, ~3,800 lines): research/
Production Integration
Three surfaces for intercepting LLM responses in your code - all run locally (your responses never leave your machine).
A) EIFInterceptor - wrap an existing OpenAI client
Install: pip install "eif-engine[sdk]" (or pip install -e ".[sdk]" from a source checkout)
Note: on any EIF server error the SDK fails open (the response passes through unverified) so your agent never blocks on EIF availability. Treat EIFHaltError as the only enforcement signal.
B) eif.auto - zero-config import hook
Configure via environment:
Start the HTTP server: eif-mcp-http-server
C) EIFCallbackHandler - LangChain / LangGraph
For in-process LangChain integration (no HTTP server required), use the original integration layer:
Design principles
- No LLM calls in the engine - all computation is deterministic local math; LLM calls happen only in evidence collection (P3/P4) and claim extraction (integration layer)
- Pydantic v2 throughout - every input and output is a typed, validated model
- H₀ = claim-is-TRUE - Popper orientation: REJECT means the claim fails
- EIG stopping rule - stop gathering evidence when KL(posterior ∥ prior) < 0.01 nats
- IMP4 direction law -
CONTRADICTSevidence must use lowP(E|H), not the same likelihood asSUPPORTS - P4 = 0% target - parametric self-validation is never used for company-specific or causal claims
Validation corpus
Full corpus: validation/
Additional per-scenario evidence reports (S6v31–S20) available on request via GitHub Discussions.
Development
See CONTRIBUTING.md for the repo layout, code style, and PR checklist.
CI runs the test suite (Python 3.11 and 3.12) plus a TrustLint EU AI Act screen over the intent artifacts (./scripts/compliance/check.sh). See docs/integrations/COMPLYEDGE.md for the full setup and the live trust surface.
Community
- Bugs: GitHub Issues
- Questions and ideas: GitHub Discussions
- Security reports: see SECURITY.md
Legal
Performance and market figures in this README are modeled or third-party estimates, not measured production results: see LEGAL.md.
License
来源:README.md,提交 3150ae5
工具
0版本历史
1- v4.2.0最新Nov 5, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分