Skip to main content

capsule-hermes

Capsule plugin for the Hermes autonomous AI agent runtime. Forwards Hermes hook events to the Capsule agentsecurity service for centralized policy enforcement and audit.

Install

Hermes 0.21.6 and later load plugin code only from an environment Hermes builds itself, so a plain pip install is invisible to them. Create a plugin directory that declares this package as a dependency, then enable it:

D="${HERMES_HOME:-$HOME/.hermes}/plugins/capsule"
mkdir -p "$D"
cat > "$D/plugin.yaml" <<'EOF'
name: capsule
description: Capsule Security policy enforcement and audit for Hermes
python_dependencies:
  - "capsule-hermes>=0.5,<1"
EOF
echo 'from capsule_hermes import register' > "$D/__init__.py"
hermes plugins disable capsule
hermes plugins enable capsule

On Windows, run this in PowerShell instead:

$H = if ($env:HERMES_HOME) { $env:HERMES_HOME } else { "$env:LOCALAPPDATA\hermes" }
$D = New-Item -ItemType Directory -Force -Path "$H\plugins\capsule"
Set-Content -Path "$D\plugin.yaml" -Value @'
name: capsule
description: Capsule Security policy enforcement and audit for Hermes
python_dependencies:
  - "capsule-hermes>=0.5,<1"
'@
Set-Content -Path "$D\__init__.py" -Value 'from capsule_hermes import register'
hermes plugins disable capsule
hermes plugins enable capsule

hermes plugins enable installs capsule-hermes from PyPI into the Hermes environment. The disable before it makes that happen even when capsule is already enabled, for example from an earlier pip install. Rerun the last two commands to upgrade.

On Hermes before 0.21.6, install the package into the Python environment that runs Hermes instead:

pip install capsule-hermes
hermes plugins enable capsule

Hermes plugins are opt-in, so the plugin stays inactive until it is enabled.

Configure

Add the endpoint and token to ~/.hermes/.env, which Hermes loads at startup:

CAPSULE_HERMES_ENDPOINT=https://agents.capsule.security/v1/hermes/hooks/events
CAPSULE_HERMES_TOKEN=<token>

The endpoint and token values are issued by Capsule when you install the Hermes integration in the Capsule portal (Integrations → Hermes). Every setting can also go in the plugins.entries.capsule block of Hermes' config.yaml; environment variables take precedence.

Optional config

Key Default Description
block_on_risk true Apply server block verdicts. Set to false to run the plugin in observe-only mode.
fail_open true Allow the event through if Capsule is unreachable or returns a non-2xx response. Set to false to fail closed.
timeout_ms 5000 Per-request HTTP timeout in milliseconds.

Hooks covered

The plugin registers handlers for the Hermes runtime hooks Capsule supports:

  • Blocking: pre_tool_call
  • Observation: pre_llm_call, post_tool_call, post_llm_call, pre_approval_request, post_approval_response, subagent_stop, on_session_start, on_session_end, on_session_finalize, on_session_reset, on_skill_lifecycle

The blocking hook awaits Capsule's verdict and returns {"action": "block", "message": ...} to Hermes when the server denies the action. Observation hooks dispatch fire-and-forget so telemetry never stalls the agent.

On the first hook of each session the plugin also sends SOUL.md, the project context file Hermes loads for the working directory, the MEMORY.md / USER.md memory store, and every installed SKILL.md.

License

Apache-2.0.

Metadata

Release files for capsule-hermes 0.5.0

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

Source distribution (sdist)

Source distribution for capsule-hermes 0.5.0
File Size Uploaded Provenance Actions
capsule_hermes-0.5.0.tar.gz 11.6 kB Without provenance Details for capsule_hermes-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for capsule-hermes 0.5.0
File Interpreter ABI Platform Actions
capsule_hermes-0.5.0-py3-none-any.whl Python 3 none any Details for capsule_hermes-0.5.0-py3-none-any.whl

Total release size: 27.1 kB

Release files / capsule_hermes-0.5.0.tar.gz

Download URL capsule_hermes-0.5.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fc0096efaab15971afa571c48431c4821f43a9a0dc1c8ccdcc96fc2423e14a25
BLAKE2b-256 checksum
How to use checksums
6a12bdb116dbbb854115fbc013ee476907c1323deaa8715e347c04553f5bfa47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / capsule_hermes-0.5.0-py3-none-any.whl

Download URL capsule_hermes-0.5.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc0e03dfcaf874fbb827c3ffe615391f8ee0b4d76c5ee1812e92d5ca852abd8d
BLAKE2b-256 checksum
How to use checksums
066fac2130982f29b865bc6a9056e6f7bb6142adc43c440b29f945ff5384f616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for capsule-hermes 0.5.0

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