
Epistemic Integrity Framework (EIF)
io.github.leocelisPublished by GitHub account leocelisv4.2.0Updated Nov 5, 2026
Runtime gate for AI agent claims. Catches sycophantic drift, circular self-validation, causal errors
Overview
Runs a scientific-method pipeline over an AI agent's load-bearing claims, routing each decision to ACT, REVISE or HALT with evidence.
- What you can do
- Create and inspect sessions, and load the framework's principles into context
- Declare, falsify, causally gate, calibrate, challenge, update and explain assumptions through the eight-phase pipeline
- Run auxiliary gates: adversarial input detection, sycophancy and position-drift checks, hypothesis ranking, replication protocol and programme health
- Record provenance, map it to EU AI Act articles, and generate compliance reports
- Log labeled outcomes and read calibration, catch-rate and provenance reports
- Verify a decision in one call or extract structured claims from free-form text
- When to use it
- Useful when an agent makes high-stakes decisions where being confidently wrong is costly, such as compliance, engineering, financial or irreversible actions, and you want assumptions tested against independent evidence before acting.
- Requirements
- A remote SSE endpoint with a bearer API key in the Authorization header, requested through the project's GitHub Discussions; the hosted endpoint is described as a private alpha. Alternatively, self-host locally with Python and the eif-engine package, or run it via uvx with no key.
Installation
In SourceWeft
- Open Epistemic Integrity Framework (EIF) in the dashboard and add it to a workspace.
- Connect Authorization token credentials. They are stored privately and never shown on public pages.
- Enable the server for the chats that should use its tools.
Web executable via SSE. Remote servers run from the web runtime once configured in a workspace.
Use with an agent
Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.
Read https://sourceweft.com/mcp/io.github.leocelis%2Feif/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.Other MCP clients
Add this to your client's mcpServers config.
{
"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
Source: README.md at commit 3150ae5
Tools
0Version history
1- v4.2.0LatestNov 5, 2026
Score
85% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 daysRequired25 pts
- Auth declaredRequired10 pts
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts