Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

caspase-hermes

Caspase apoptosis supervision for Hermes Agent. Drops in as a plugin: Caspase watches every tool call and LLM turn in your Hermes session and terminates the agent cleanly if it enters a runaway loop, exceeds its cost/token cap, runs past a wall-clock deadline, or calls a tool outside the policy allowlist.

Install & enable (zero config)

# Install the plugin into Hermes' environment:
uv tool install hermes-agent --with caspase-hermes   # or: pip install caspase-hermes

# Enable it (one shot — flips plugins.enabled in your Hermes config):
caspase enable-hermes

That's it. No API key, no control plane, no env vars. Hermes auto-discovers the plugin via the hermes_agent.plugins entry-point group; caspase enable-hermes adds caspase to plugins.enabled. Run hermes and every session is supervised. When a runaway is killed, the death certificate prints to your terminal and saves to ~/.caspase/kills/.

Why caspase enable-hermes and not hermes plugins enable caspase? The latter (and the interactive hermes plugins UI) only manage git-installed plugins under ~/.hermes/plugins/ — they don't see pip/entry-point plugins like this one. caspase enable-hermes writes the supported plugins.enabled config key for you. (To do it by hand: add caspase to plugins.enabled in ~/.hermes/config.yaml, Windows %LOCALAPPDATA%\hermes\config.yaml.)

Configure (optional — for a control plane)

Everything above works with nothing set. These add control-plane archival, a fleet view, manual kill, and grants:

export CASPASE_API_KEY=sk-...                                   # ⇒ enables the control plane; unset = local-only
export CASPASE_BASE_URL=https://your-control-plane.example.com  # default localhost:8000
export CASPASE_AGENT_NAME=my-coding-agent                       # display name
export CASPASE_POLICY=coding-default                            # policy
export CASPASE_LOCAL_CERT=0                                     # disable the local cert print/save (default: on)

Or add the same keys to ~/.hermes/.env, or run caspase init once to persist them to ~/.caspase/config.toml. With a key set, every session is also queryable via the operator CLI (caspase fleet).

What it does

Condition What happens
Agent calls the same tool 5× in a row with identical inputs Kill (loop)
Cumulative LLM cost exceeds policy cap Kill (token_runaway)
Session runs longer than policy wall-clock cap Kill (wall_clock)
Agent calls a tool not in the policy allowlist Kill (tool_scope_violation)
Operator issues caspase kill <agent_id> Kill (manual_kill)
Operator issues a grant Suppress one symptom type for up to 24 h

How the kill works

Hermes hooks are non-blocking — they can't raise out of the agent loop. Caspase uses Hermes' canonical interception path: when an apoptosis check fires, the plugin's pre_tool_call callback returns

{"action": "block", "message": "caspase apoptosis: <reason>. End the session."}

Hermes refuses to run the tool and surfaces that message as the tool error to the LLM. The harm is halted immediately — no further tool execution, no further cost — and every subsequent tool call also blocks until the agent's loop ends naturally. At session end, on_session_end fires and the plugin posts a death certificate (full symptom log, shutdown sequence, feedback URL) to the control plane.

This is the same pattern Hermes' built-in security-guidance plugin uses for its strict block mode, and it's documented in PR #26759 as the canonical interception path for "rate limiting, security restrictions, approval workflows."

Policies

Shipped defaults:

Policy Loop cap Cost cap Wall-clock cap
strict 3 repeats / 15 actions $2.00 5 min
coding-default 5 repeats / 20 actions $25.00 30 min
permissive 10 repeats / 40 actions $100.00 2 h

Operator CLI

caspase fleet
caspase logs <agent_id>
caspase kill <agent_id> --reason "infinite loop in file search"
caspase grant <agent_id> --symptoms loop --duration 1h --reason "known flaky task"
caspase revoke <grant_id>

See the repo root README for the full operator workflow, security model, and deployment guide.

Hermes hooks used

The plugin attaches to five hooks (see hermes_cli/plugins.py::VALID_HOOKS):

Hook Why
pre_tool_call The checkpoint — runs all symptom checks; returns the block directive if armed
post_tool_call Records tool outcome; re-runs cost/wall-clock checks
pre_llm_call Lifecycle marker (model name)
post_api_request Token + cost accounting (this hook carries usage in v0.14, not post_llm_call)
on_session_end Flush death cert, tear down background worker

License

MIT © 2026 Caspase Contributors

Metadata

Release files for caspase-hermes 0.1.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for caspase-hermes 0.1.0a1
File Size Uploaded Provenance Actions
caspase_hermes-0.1.0a1.tar.gz 20.1 kB Without provenance Details for caspase_hermes-0.1.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for caspase-hermes 0.1.0a1
File Interpreter ABI Platform Actions
caspase_hermes-0.1.0a1-py3-none-any.whl Python 3 none any Details for caspase_hermes-0.1.0a1-py3-none-any.whl

Total release size: 39.3 kB

Release files / caspase_hermes-0.1.0a1.tar.gz

Download URL caspase_hermes-0.1.0a1.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
971e6bc6aab9f410b78dc2ace40297ce040365b8d2a43627b076adbf1c53e5ee
BLAKE2b-256 checksum
How to use checksums
c041377782daa14d652a4f5e6c57ca7c7b0741c7b6e8d3b704416b88a0cb31f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / caspase_hermes-0.1.0a1-py3-none-any.whl

Download URL caspase_hermes-0.1.0a1-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d6d8e14a26b12e2a1fc6ec0d43fd65be53643a74aff54326da1951de6977f0d
BLAKE2b-256 checksum
How to use checksums
aa20fb98cf865b1971e30d46286161840b638e5ca338273ea9d6911e3945db50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for caspase-hermes 0.1.0a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page