Skip to main content
Glama

TruthGate for Agents

TruthGate is a fail-closed preflight, approval, evidence, and verification runtime for Hermes, OpenClaw, n8n agents, and custom LLM systems.

It does not promise zero hallucinations. It prevents unsupported output from being treated as verified completion.

v0.2 security model

  • Server-owned policy cannot be weakened by request payloads.

  • API routes require a bearer key.

  • High-risk approvals are HMAC-signed, task-bound, expiring, and single-use.

  • External tool traces can require HMAC signatures.

  • Evidence IDs, citations, trust, claim coverage, tool success, output text, and artifact hashes receive deterministic checks.

  • Evidence is scanned for common prompt-injection patterns before generation.

  • A genuinely different verifier model is required by default.

  • Audit events avoid raw prompts, tokens, and secrets.

  • Verified memory is deduplicated and retains task provenance.

  • Provider requests use bounded retries and sanitized errors.

Related MCP server: mneme-ai

Install

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env
truthgate-api

Open http://127.0.0.1:8787/docs. All /v1/* routes require:

Authorization: Bearer <TRUTHGATE_API_KEY>

Production startup rejects the included development secrets.

Hermes MCP integration

TruthGate exposes three narrow MCP tools:

  • truthgate_preflight

  • truthgate_verify

  • truthgate_authorize

Use integrations/hermes/config.example.yaml to configure the stdio server in ~/.hermes/config.yaml, then run /reload-mcp in Hermes. Copy the companion integrations/hermes/SKILL.md into your Hermes skills directory if you want Hermes to follow the gate workflow consistently.

Human approval

Preflight returns task_id and task_digest. A human can issue a short-lived approval:

truthgate approve \
  --task-id TASK_ID \
  --task-digest TASK_DIGEST \
  --risk-level high

The token does not authorize a different task contract and cannot be consumed twice.

Deterministic rules

Requests can attach server-validated rules:

  • evidence_exists

  • tool_succeeded

  • output_contains

  • artifact_sha256

Model verification is never enough by itself. A final result is verified only when the independent verifier and all deterministic gates pass.

API

  • GET /health

  • POST /v1/preflight

  • POST /v1/verify

  • POST /v1/run

  • POST /v1/authorize

  • GET /v1/memory

  • GET /v1/audit/{task_id}

Hard limitation

MCP cannot intercept every Hermes built-in tool result. Signed traces require a trusted host wrapper or a native Hermes tool-result hook. Without that hook, TruthGate should verify knowledge work and explicit evidence, but must not claim cryptographic proof of every action Hermes performs.

Available Tools

3 tools
truthgate_authorizeC

Consume a human-issued approval immediately before a risky action.

Inputs: task_id (required), task_digest (required), approval_token (required). Returns: object

truthgate_preflightC

Compile and gate a task before Hermes uses external tools.

Inputs: task (required), context, task_id, evidence_json, +2 more. Returns: object

truthgate_verifyC

Verify Hermes' final candidate against evidence and tool traces.

Inputs: payload_json (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a distinct role: preflight prepares tasks before tool use, verify checks final outputs, and authorize handles human approval. No overlap in purpose.

    Naming Consistency5/5

    All tools follow the 'truthgate_verb' pattern with clear action verbs (preflight, verify, authorize), providing a predictable naming scheme.

    Tool Count4/5

    Three tools is on the smaller side but suitable for a specialized gatekeeping server that handles pre-use, post-use, and approval steps.

    Completeness4/5

    The set covers the key stages of the gating workflow: pre-check, verification, and authorization. Minor gaps like handling verification failures are not critical.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables protocol-level runtime verification of AI agent tool calls across six dimensions with a fail-closed guarantee, blocking any action that fails verification before execution.
      243 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to operate through a local, signed boundary that blocks prompt injection and secret leakage, verifies outputs, preserves cross-session memory, and provides offline-verifiable receipts. It also exposes 900+ MCP tools for discoverable agent actions.
      7
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides a governed execution boundary for AI agents, enforcing deterministic policy, one-shot human approvals, and signed receipts for MCP tool effects.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables deterministic verification of AI agent decisions and actions, providing PASS/FAIL/ABSTAIN verdicts with replayable proofs and an optional signed receipt ledger.
      4 npm
      Apache 2.0