delval-gate
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
delval-gate
Fail-Closed Delivery Permission & Judgment Ledger for Long-Running AI Agents
(Zero-dependency Python 3 library, CLI, and Model Context Protocol (MCP) stdio server)
When AI coding and ops agents work across sessions—modifying configs, migrating schemas, publishing releases—stale judgments lingering in ordinary text or vector memory silently trigger unsafe deliveries. Even retraction-based memory layers degrade stale records at read time without blocking delivery when an agent cites them anyway.
delval-gate implements the DelVal five-state, ten-rule delivery-permission protocol—machine-checked in Isabelle/HOL 2026 (session RC_DelVal, zero sorry) and evaluated across 728 live LLM agent trials (0/293 unsafe published deliveries vs. 68/150 in a version-bound retraction control without a delivery gate, McNemar $p = 6.776 \times 10^{-21}$).
Core Guarantees (Formally Verified Invariants)
Invariant | What |
I-1a · Recovery Gate | Once a judgment turns |
I-1b · Closure Coherence | Object/file changes propagate |
I-2 · Objection Blocking | Open objections transition a judgment to |
I-3 · Pure-Citation Invariance | Repeated citations of the same evidence root never inflate independent root support ( |
I-4 · Frozen Reuse Contract | Preregistered harmless-change rules (SHA-256 hashed at initialization) preserve existing validity without false invalidation, and raise |
5-State Retirement Lifecycle | Full five-state machine ( |
Related MCP server: shield-kya
Installation
Zero third-party dependencies (Python 3.10+ stdlib only):
pip install delval-gateOr install from source:
git clone https://github.com/iannil/delval-gate.git
cd delval-gate
pip install -e .Or run directly from source without installing:
PYTHONPATH=src python3 -m delval_gate.cli --helpQuickstart (CLI & CI Gate)
# 1. Initialize a ledger with a frozen JSON reuse contract
delval-gate --ledger .delval.json init --contract examples/reuse-contract.json
# 2. Register an upstream evidence-bound judgment
delval-gate --ledger .delval.json register \
--jid "build:api-schema" \
--evidence "src/schema.py" "pyproject.toml" \
--digest "sha256:abc123" --passed
# 3. Register a downstream derived judgment depending on build:api-schema
delval-gate --ledger .delval.json register \
--jid "release:v2-ready" \
--evidence "docs/api.md" \
--deps "build:api-schema" \
--digest "sha256:def456" --passed
# 4. Structural change -> automatic transitive invalidation
delval-gate --ledger .delval.json change "src/schema.py"
# 5. Delivery gate FAILS CLOSED (exit code 2 + exact blocking reasons)
delval-gate --ledger .delval.json gate "release:v2-ready"
# 6. Trusted recheck in dependency order -> gate ALLOWS (exit code 0)
delval-gate --ledger .delval.json recheck --jid "build:api-schema" --passed --digest "sha256:new1"
delval-gate --ledger .delval.json recheck --jid "release:v2-ready" --passed --digest "sha256:new2"
delval-gate --ledger .delval.json gate "release:v2-ready"Run the full interactive demo script:
bash examples/demo.shMCP Server Mode (Claude Code / Cursor / Any MCP Agent)
delval-gate includes a zero-dependency JSON-RPC 2.0 Model Context Protocol (MCP) stdio server (delval-gate --ledger .delval.json mcp). Add it to your agent's MCP configuration:
{
"mcpServers": {
"delval-gate": {
"command": "delval-gate",
"args": ["--ledger", ".delval.json", "mcp"]
}
}
}Exposed MCP Tools
delval_register— register an evidence-bound judgment (echo-immune)delval_notify_change— notify changed paths (pathorpath@change_class) and propagate stalenessdelval_recheck— record a trusted verifier recheck outcome (sole recovery gate)delval_raise_objection/delval_resolve_objection— open or evidence-backed close an objectiondelval_withdraw/delval_supersede— permanently retire or replace a judgmentdelval_gate— fail-closed delivery-permission check over cited judgments and their transitive closuredelval_status— inspect statuses, distinct root counts, open objections, and audit trail
Python API
from delval_gate import JudgmentLedger
ledger = JudgmentLedger()
ledger.register("build:api", ["src/api.py"], passed=True, digest="sha256:111")
ledger.register("release:v1", ["docs/api.md"], deps=["build:api"], passed=True, digest="sha256:222")
ledger.notify_change(["src/api.py"])
decision = ledger.gate(["release:v1"])
assert not decision.allow
print(decision.blocked_reasons)
# ('claim-not-valid:build:api:stale', 'claim-not-valid:release:v1:stale')Running Tests
python3 -m unittest discover -s tests -vAcademic Papers & Formal Verification Archive
Protocol Semantics & Isabelle/HOL–Alloy Formalization: Tao Shi (Zhurong), Delivery Permission: Protocol Semantics for Judgment Ledger, Action Gate, and Bounded Separation, https://zhurongshuo.com/en/papers/delval-protocol/
Preregistered 150-Pair & 728-Trial Empirical Evaluation: Tao Shi (Zhurong), Does an Action Gate Reduce Unsafe Delivery? A 150-Pair Preregistered Experiment, https://zhurongshuo.com/en/papers/delval-experiment/
Isabelle/HOL 2026 Proofs, Alloy Models & 728-Trial Dataset (Zenodo DOI): 10.5281/zenodo.24455837
Author ORCID: 0009-0002-6890-085X
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Pre-execution governance for AI agents. Deterministic PASS/FAIL/REVIEW verdicts, replayable proof.
Owner-signed permissions for AI agent actions; ALLOW/BLOCK/REVIEW with request-bound receipts.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Tenant-scoped control layer for agent-to-agent systems: governed routing, approvals, evidence.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides permission gates and tamper-evident audit logging for AI agent tool executions, with declarative policies, consent ladders, and hash-chained verification.MIT
- AlicenseNot gradedqualityBmaintenanceA local gate that lets agents submit risky tool actions for policy evaluation and receive ALLOW, DENY, or REQUIRE_APPROVE decisions before executing irreversible side effects. It can also open human approval holds and record an activity trail without executing the side effect itself.1,427 npm3MIT
- AlicenseNot gradedqualityBmaintenanceGives AI coding agents a local, mechanical workflow authority: an agent's issue claim is recorded, every subsequent write and irreversible step (push, merge, tag, release) is re-verified against that record, and review verdicts are bound to exact commit bytes so a later push invalidates them. Refusals report what was read and what to do next, keeping an unreadable tracker distinct from a forbidden action.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables agents to route every action through a pre-execution gate that returns allow, escalate-to-human, or deny verdicts, backed by deterministic hard-rule blocks plus probabilistic gray-zone scoring, and to run a resumable orchestration loop covering routing, quality gates, stop-loss, acceptance, and escalation. Every decision, arbitration between conflicting agents, and human approval is written to an append-only hash-chained, Ed25519-signed ledger that can be postmortemed, calibrated, alert-scanned, and exported as offline verification bundles or OTel spans.1MIT