Caspase apoptosis plugin for Hermes Agent — install once, your agent never runs away again
Project description
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
pip install caspase-hermes
Then drop the plugin into Hermes:
python -c "
import caspase_hermes, pathlib, shutil
src = pathlib.Path(caspase_hermes.__file__).parent
dst = pathlib.Path.home() / '.hermes' / 'plugins' / 'caspase'
shutil.copytree(src, dst, dirs_exist_ok=True)
print('installed →', dst)
"
Configure
export CASPASE_API_KEY=sk-...
export CASPASE_BASE_URL=https://your-control-plane.example.com # optional
export CASPASE_AGENT_NAME=my-coding-agent # optional display name
export CASPASE_POLICY=coding-default # optional policy
Or add the same keys to ~/.hermes/.env.
Run
hermes
Caspase activates automatically. Every session is queryable via the operator CLI (caspase agents list).
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 |
On kill, Caspase posts a death certificate with a full symptom log, shutdown sequence, and a one-click feedback URL so operators can label the verdict.
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 agents list
caspase logs <agent_id>
caspase kill <agent_id> --reason "infinite loop in file search"
caspase grants create <agent_id> --symptom loop --duration 1h --reason "known flaky task"
caspase grants revoke <grant_id>
See the repo root README for the full operator workflow, security model, and deployment guide.
License
MIT © 2026 Caspase Contributors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file caspase_hermes-0.1.0a0.tar.gz.
File metadata
- Download URL: caspase_hermes-0.1.0a0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d2910809d6f7089e02180a1e5dce5dbc7f64e1a3c753a4afb83430c0dc7a413
|
|
| MD5 |
4956673b4ae5e598c32f1b478c6d30a8
|
|
| BLAKE2b-256 |
6d667fdc3de1ca897e82464e3c42fe5780287b1a7f7e6c7c2ec5b371da3a9910
|
File details
Details for the file caspase_hermes-0.1.0a0-py3-none-any.whl.
File metadata
- Download URL: caspase_hermes-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16b44b7e611720ae30103c55a595e6179adb1cc434cc3cd77eea689297d4a71a
|
|
| MD5 |
47375101e2db04fc900c4d88b124f2de
|
|
| BLAKE2b-256 |
db8f186f216459d990e68fe8d006d8a6f4232b31f63542ad1efad3ba6e48faf5
|