INTEGRATION REFERENCE · SOURCE MIDDLEWARE

Govern the
tool-call lifecycle.

Inspect model-agnostic middleware for pre-tool checks, output screening, final-response holds, and optional evidence capture.

  1. 01

    Pre-tool

    Check configured tool, argument, and review requirements.

  2. 02

    Post-tool

    Apply configured output-screening patterns.

  3. 03

    Final response

    Evaluate configured holds before releasing the response.

Wire the lifecycle you need

The middleware exposes check_pre_tool, check_post_tool, check_final, and a synchronous call_tool_with_governance wrapper. It is model-agnostic and does not assume a particular Hermes API.

The integrator must connect those hooks to the actual runtime. A post-tool check cannot retroactively authorize or undo an already completed external action.

Capture evidence deliberately

Optional evidence capture records input hashes, policy IDs, decisions, previous and event hashes, and optional OpenTelemetry references. Persistent capture requires an evidence_path.

The writer uses local JSONL. Its source calls out additional locking and external anchoring work for production use.

Inspect the implementation

Begin with the middleware and its minimal constitution. Confirm which hooks your host actually invokes before treating the integration as coverage.

Open middleware source Read the example constitution