Docker provides isolation for Hermes terminal operations — safer for autonomous agents. Here is how to set it up.
Why Docker
Docker gives you isolation that cloud tools like ChatGPT or Devin can't offer — your agent runs on your own hardware.
- Sandboxed terminal commands
- Read-only root filesystem (configurable)
- Dropped Linux capabilities
- Namespace isolation
- Tirith security module integration
The trade-off: slightly more resource overhead. The gain: much safer autonomous operation.
Install Docker
On Mac: Docker Desktop
On Linux: sudo apt install docker.io then sudo usermod -aG docker $USER
Verify: docker --version
Configure Hermes to Use Docker
hermes config set terminal.backend docker
Verify:
hermes config show | grep -A2 terminal
Docker Compose Example
For persistent volumes:
version: '3'
services:
hermes:
image: ghcr.io/nousresearch/hermes-agent:latest
volumes:
- ./data:/root/.hermes
environment:
- HERMES_MODEL_PROVIDER=openrouter
stdin_open: true
tty: true
Run: docker-compose up -d
Container Hardening
Hermes Docker mode uses security best practices:
- Read-only root: Filesystem is read-only except where write needed
- Dropped capabilities: Removes dangerous kernel access
- Namespace isolation: Container has its own process/network space
This limits damage if the agent runs a compromised command.
Tirith Security Module
Tirith is Hermes' security layer. For Docker:
- Commands scanned before execution
- Blocked patterns: prompt injection, credential theft, backdoors
- Docker sandbox adds additional isolation
Configure Tirith in config.yaml:
security:
tirith:
enabled: true
block_patterns:
- credential_exfiltration
- prompt_injection
Common Issues
Docker not found
Ensure Docker is installed and running. docker ps to verify.
Permission denied
Add your user to the docker group: sudo usermod -aG docker $USER, then log out/in.
Container keeps restarting
Check logs: docker logs [container]
Alternatives
- Local terminal: Default, no isolation
- Docker: Good isolation, moderate overhead
- SSH: Run on remote server
- Daytona/Modal: Serverless, hibernates when idle
Sandboxed code execution via Docker
FAQ
Does Docker slow down the agent? Minimal overhead for most tasks. Noticeable for heavy file operations.