Persistent personal agent & gateway hardening Fact-checked · 2026-11-23

Always-On Personal Agent Stack: Docker Isolation, Allowlists and Spend Caps

Connecting Hermes Agent or OpenClaw to Telegram, Discord, or Slack turns chat messages into commands on your machine. Pair container isolation, explicit user-ID allowlists, manual approval gates and provider spend limits so your persistent assistant stays safe.

Setup time
~25 minutes (Docker recommended)
Risk posture
High exposure surface · Require user allowlists & container isolation before binding chat apps
Cost profile
Free MIT-licensed software; pay only model API or Nous Portal usage
Use this stack when
  • Power users who want to trigger research, file workflows or scheduled checks from mobile chat apps without giving up self-hosting control.
  • Replacing closed hosted proactive assistants with an auditable local/VPS stack.
Skip this stack if
  • Running unauthenticated gateways on your main laptop alongside banking logins and production SSH keys.
  • Simple one-off Q&A—standard web chat is simpler and carries zero host execution risk.

Architecture & flow

Chat app (Allowlisted ID)Gateway & ApprovalDocker backendScoped workspace & skills
Only allowlisted user IDs reach the gateway; consequential actions pause for approval and execute inside Docker

Stack layers & catalog tools

Layer 2 · Isolated command backend

Source: OpenClaw gateway security docs ↗

Moves shell execution off your host OS into Docker containers or a dedicated sandbox VM with scoped directory mounts.

Wiring & protocols: Configured via Hermes terminal.backend: docker or OpenClaw sandbox.mode: non-main.

If Docker is unavailable, run under a separate low-privilege OS user or disposable VPS.

Layer 3 · Persistent memory & audited `SKILL.md` packs

Source: Personal AI agents ranking

Retains cross-session preferences and reusable skills while gating untrusted third-party skill code.

Wiring & protocols: Uses open SKILL.md manifests and optional external memory services.

Browse vetted SKILL.md packs on FollowSkills.com and inspect every bundled script first.

Find companion SKILL.md packs on FollowSkills.com → Discover compatible MCP servers on FollowMCP.com →

Wiring & hardening steps

1. Switch execution to Docker and tighten command approvals to `manual`

Hermes Agent defaults to terminal.backend: local and approvals.mode: smart. Lock both down before connecting external messaging.

hermes config set approvals.mode manual
hermes config set terminal.backend docker

2. Pin explicit user-ID allowlists before starting the gateway

Put only your own numeric user ID in ~/.hermes/.env (never GATEWAY_ALLOW_ALL_USERS=true), and keep OpenClaw dmPolicy closed to strangers.

# ~/.hermes/.env
TELEGRAM_ALLOWED_USERS=123456789

3. Bind the gateway to localhost and enforce API spend caps

Autonomous loops and heartbeat jobs can burn tokens rapidly if triggered unexpectedly. Use revocable keys with hard monthly caps and never expose port 18789 unauthenticated on the public internet.

Common traps & fixes

Trap Leaving GATEWAY_ALLOW_ALL_USERS=true or wildcard dmPolicy: "open" in a group chat.
Fix Allowlist only your personal user IDs and enable sandbox.mode: "non-main" for any multi-user surfaces.
Trap Letting the assistant read untrusted web pages/emails and immediately invoke shell or send tools.
Fix Separate untrusted ingestion from state-changing tools and keep human approval enabled on writes.
Trap Installing unreviewed community skills that read ~/.ssh or .env.
Fix Never mount ~/.ssh into the agent container and read every downloaded SKILL.md and script before enabling.

Pre-flight safety checklist

  • Execution backend set to Docker or an isolated VM with only scoped working folders mounted.
  • Explicit user-ID allowlists configured on every enabled chat gateway.
  • Gateway dashboard/API bound to 127.0.0.1 or protected behind an authenticated tunnel.
  • Dedicated, revocable API keys with hard monthly spend caps at the model provider.
  • All third-party skills inspected prior to installation.

FAQ

Should I build this stack on Hermes Agent or OpenClaw?

Choose Hermes Agent for built-in manual approval + Docker/Modal backend switches and structured skill learning; choose OpenClaw if you need 20+ messaging channels and native companion apps (with Docker sandboxing enabled).

Why can always-on personal agents rack up high token bills?

Long memory histories plus autonomous multi-step loops multiply token volume per task. Route routine summarization to lower-cost models and set provider spend caps.

Can I run this on Windows?

Yes—run it inside WSL 2 with Docker isolation rather than exposing your native host shell directly.

Agent Workflow Stacks

Was this page helpful?