
Credence — Epistemic Guard
io.github.Lakshmi-Chakradhar-VijayaraoPublished by GitHub account Lakshmi-Chakradhar-Vijayaraov1.2.5Updated Nov 10, 2026
Epistemic guard for AI coding: tracks uncertain values and blocks writes until verified.
Overview
A local epistemic guard for AI coding that records values you state as uncertain and blocks file writes or commands embedding them until you confirm.
- What you can do
- Register uncertain values from your prompts through a passive observer hook before the assistant responds, and keep them in a local SQLite registry with session tracking and a constraint cap. Block Write, Edit, Bash and NotebookEdit actions that embed unverified or stale values, and clear the block once you confirm the value. Inspect pending constraints and review gate statistics and feedback tags. Run a demo smoke test and latency reports from the command line.
- When to use it
- Worth adding when an assistant writes code that hard-codes configuration values, limits, versions or expiries you only guessed at, and you want a hard stop before those guesses reach a file or command. It suits Claude Code users who want enforcement rather than warnings.
- Requirements
- A local Python install with the credence-guard package; the README also describes a Rust gate alternative. Setup requires adding an MCP server entry and Claude Code hooks for UserPromptSubmit and PreToolUse in the project settings. No API key is required. Optional environment variables configure the registry path, session ID, event log and constraint cap.
Installation
In SourceWeft
- Open Credence — Epistemic Guard in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Credence
AI doesn't remember what it wasn't sure about. Credence does.
[PyPI] [CI] [Python] [License: Apache 2.0]
[mcp] adds the FastMCP server for Claude Code. Core package has zero hard dependencies.
The problem
You say: "The rate limit is probably around 50 — I haven't confirmed it yet."
Fifteen turns later, Claude writes:
The API rejects every request at 2am. The real limit was 10. Claude forgot you weren't sure.
This isn't hallucination. The model reproduced exactly what it read. What it read had the qualifier stripped — by context compression, fifteen turns back.
What Credence does
Tracks uncertain values the moment you state them. Blocks writes that embed those values until you confirm them.
Every other tool warns. Credence enforces.
What it looks like
After you confirm: "Confirmed — rate limit is 100 req/min per stripe.com/docs" → gate clears.
Setup
1. Add to .mcp.json:
2. Add to .claude/settings.json:
Done. No API key required.
Registry: Credence creates
epistemic_registry.dbin your working directory. Add*.dbto your.gitignore, or setCREDENCE_DB=~/.credence/registry.dbto keep it global.Session tracking: Set
CREDENCE_SESSION_ID=my-projectto keep constraints stable across directory changes and terminal restarts.Event log: The gate writes block/allow events to
~/.credence/events.jsonl(local only, never sent anywhere). SetCREDENCE_NO_LOG=1to disable.Constraint cap: The registry allows up to 500 constraints per session by default. Override with
CREDENCE_MAX_CONSTRAINTS=<n>.
How it works
Two layers, neither requires model cooperation:
The observer fires before the model processes your message. If you say "I think the rate limit is 50", the registry has that entry before Claude generates a single token.
What gets blocked
Once verified, the gate clears.
What Credence does NOT do
- Does not verify facts — it cannot tell you if a value is correct
- Does not catch uncertainty that was never stated
- Does not block the model from saying a wrong value in prose — only from writing it to a file or command
Known issue (November 2026): the PreToolUse gate (python3 -m credence.hooks) only enforces when CREDENCE_SESSION_ID is set. Without it, the observer files constraints under an id derived from the working directory, which the gate never reads, so nothing is blocked. The Rust gate filters by Claude Code's own session id and reads CREDENCE_DB_PATH rather than CREDENCE_DB, so it can miss them too. Making the ids match is planned, together with a stricter value-level match: the current two-shared-words rule over-blocks once it enforces.
Measured results
46% of uncertainty qualifiers are stripped by Claude Haiku during context compression. Credence's probe skips compression for 100% of those segments (n=50), so no qualifier is lost.
Validated across 7 open-weight models (Qwen, Mistral, Llama, Phi, Gemma) from 5 organizations: same failure mode, same block rate.
Full methodology: docs/TECHNICAL_REPORT.md
Project layout
Research
The scientific basis for Credence is documented in paper/ (EQL / EQLR / FCR).
The companion geometry thesis — on confabulation detection and why the detection axis is dissociable from the causal control axis — lives in a separate repo: → Detection Without Control
Built by
Lakshmi Chakradhar Vijayarao — GitHub · LinkedIn · X
Apache 2.0 License
Source: README.md at commit a75329a
Tools
0Version history
1- v1.2.5LatestSep 16, 2026
Score
40% 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 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- 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
Declare a license in the repository or the registry entry.