- Agent Vault running on one VPS, holding real Anthropic, GitHub, Slack, and Telegram credentials encrypted at rest behind a master password.
- A Hermes Agent running on a second VPS, reachable via a Telegram bot, with every outbound API call brokered through Agent Vault and revocable from the UI in one click.
Prerequisites
- A Hetzner Cloud account.
- API keys for the services you want Hermes to call. This guide uses Anthropic, GitHub, and Slack.
- A Telegram account on your phone.
Architecture
av-broker holds real credentials, encrypted at rest behind your master password. hermes-vps holds placeholder strings (__anthropic_api_key__, etc.) and one revocable agent token.
1. Provision the VPS boxes
Create a Hetzner project
agent-vault-lab) and click in. Everything that follows happens inside this project.Generate an SSH key on your laptop
ssh command in this guide uses -i ~/.ssh/agent-vault-lab to pin to this key.Upload the public key to Hetzner
~/.ssh/agent-vault-lab.pub, name it (e.g. lab), and tick Make default for this project before saving.Create the private network
- Name:
av-net - IP range:
10.0.0.0/24 - Network zone: any (e.g.
eu-central)
Create av-broker
| Panel | Setting |
|---|---|
| Location | A datacenter in your av-net network zone (e.g. nbg1) |
| Image | Ubuntu 24.04 |
| Type | CX23 (or any cheap x86 tier) |
| Networking | Tick av-net under Private networks, then set the IP to 10.0.0.2 |
| Name | av-broker |
Create hermes-vps
- Networking → Private network IP:
10.0.0.3 - Name:
hermes-vps
2. Restrict SSH to your laptop
Create and attach the firewall
ssh-lockdown. Add one inbound rule:- Protocol: TCP
- Port:
22 - Source IPs: the IPv4 from the previous step
av-broker and hermes-vps.3. Install Agent Vault on av-broker
Install Agent Vault
/usr/local/bin/agent-vault.Launch the server inside tmux
--host 10.0.0.2 binds both listeners to the private NIC, keeping Agent Vault unreachable from the public internet.First-run prompts: master password, admin email, admin password.Detach with Ctrl-B then D. You’ll see [detached from session av] and drop back to your normal shell. The server keeps running inside the tmux session.tmux new -s av, restart with the same command, re-enter the master password. For zero-touch restart, set AGENT_VAULT_MASTER_PASSWORD, but note the password then lives in an env file.4. Configure the vault
Open an SSH tunnel
http://localhost:14321 in your laptop’s browser and sign in with the admin email and password you set during install.Understand vaults, credentials, and services
- A vault is a named isolation boundary. We’ll create
prod. - A credential is one secret value stored under a name (e.g.
ANTHROPIC_API_KEY = sk-ant-...). Encrypted at rest. - A service is the wiring for one upstream host: host pattern + auth mode + substitution rules that reference credentials by name.
Add credentials
prod vault, Credentials tab → Add credential. This guide configures four credentials; Anthropic (model) and Telegram (inbound channel) are required for the rest of the guide to work, the others are illustrative. Substitute or add credentials for whatever services you want Hermes to call.| Key | Value |
|---|---|
ANTHROPIC_API_KEY | Anthropic API key (sk-ant-...) |
GITHUB_TOKEN | GitHub PAT with repo scope |
SLACK_BOT_TOKEN | Slack bot token (xoxb-...) |
TELEGRAM_BOT_TOKEN | Placeholder; you create the real bot in the next section |
chat:write, channels:read, and groups:read scopes. Reinstall the app after adding them so the token picks them up, and invite the bot to your target channel.
Add services

av-broker.| Name | Host | Placeholder | Surface | Credential |
|---|---|---|---|---|
anthropic-brain | api.anthropic.com | __anthropic_api_key__ | header | ANTHROPIC_API_KEY |
github | api.github.com | __github_token__ | header | GITHUB_TOKEN |
slack | slack.com/* | __slack_bot_token__ | header | SLACK_BOT_TOKEN |
telegram | api.telegram.org | __telegram_bot_token__ | path | TELEGRAM_BOT_TOKEN |
header (the upstream reads the credential from an HTTP header). Telegram uses path because its Bot API encodes the token inline in the URL (/bot<TOKEN>/sendMessage).5. Create the Telegram bot
Mint the bot via BotFather
@BotFather. Send /newbot, give it a display name, then a username ending in bot. BotFather returns a token: 123456789:ABC-DEF....Paste the real token into Agent Vault
prod → Credentials → TELEGRAM_BOT_TOKEN → edit → paste the BotFather token → save.6. Connect Hermes
SSH into hermes-vps and install the Agent Vault CLI
av-broker running):hermes-vps. On this box the AV CLI is a client wrapper; no server runs here.Install Hermes and walk the setup wizard
/usr/local/lib/hermes-agent/ and then launches an interactive four-question setup wizard. Answer:-
How would you like to set up Hermes? → Quick setup.

-
Select provider: scroll to the bottom and choose Leave unchanged.

-
Select terminal backend: Keep current (local).

-
Connect a messaging platform? Skip (set up later via
agent-vault run -- hermes gateway setup). You’ll configure Telegram in a later section using the gateway wizard.
Write placeholder credential lines into Hermes's .env
Mint an agent token (back to your laptop's AV UI)

-
Agent name:
hermes-vps -
Vault access: click + Add vault, pick
prod, leave role atproxy -
Click Add

export lines. The agent token and the prod vault name are pre-filled; the broker address renders as the placeholder <AGENT_VAULT_ADDR> (the server was launched without that env var set, so the UI can’t infer it). Click the inline Copy button. You’ll paste it in the next step.
Export the three AV env vars
hermes-vps terminal, paste the snippet. Replace <AGENT_VAULT_ADDR> with http://10.0.0.2:14321:ADDR), who is calling (TOKEN, revocable from the UI), and which set of credentials and services applies (VAULT).7. Configure the Hermes gateway
The gateway is Hermes’s always-on messaging daemon. Configure it via a wizard wrapped inagent-vault run so its environment has the broker config.
Walk the wizard
configured in the platform list because the placeholder line you wrote to ~/.hermes/.env earlier is enough for the wizard to consider it set up. You’ll skip reconfiguring the token and just add the user allowlist.-
Select a platform to configure → Telegram (shown as
(configured)).
-
Reconfigure Telegram? →
N. -
Add allowed users now? →
Y. -
Allowed user IDs (comma-separated) → your numeric Telegram user ID from
@userinfobot. This locks the bot to your account. -
Select a platform to configure → scroll to the bottom and select Done.

-
Install the gateway as a systemd service? →
Y. -
Choose how the gateway should run → System service (the second option). System service writes the unit to
/etc/systemd/system/and starts on boot natively. Nologinctl enable-lingerneeded.
-
Run as which user? →
root. -
Start the service now? →
N. The unit has no Agent Vault env yet; the next section wires it before starting.
/etc/systemd/system/hermes-gateway.service and enables it on boot.8. Start the gateway daemon
The unit needs Agent Vault’s environment wired explicitly, since systemd doesn’t inherit it from your shell.Paste 1: write /root/.hermes/gateway.env
hermes-vps where $AGENT_VAULT_TOKEN is still set:-rw------- 1 root root <~600–700> ... gateway.env. If you see the warning instead, re-run the export AGENT_VAULT_TOKEN=... line from the previous section.Paste 2: systemd drop-in
cat: [Service] and EnvironmentFile=/root/.hermes/gateway.env.SLACK_APP_TOKEN not set warning in journalctl is expected and harmless. Slack outbound still works; only inbound (Socket Mode) is skipped.If the service fails to start
AGENT_VAULT_TOKEN made Paste 1 skip writing the env file. Re-export, redo Paste 1, then systemctl daemon-reload && systemctl restart hermes-gateway.
9. Lock down egress (optional)
Restricthermes-vps outbound to av-broker only. A compromised Hermes then has nowhere to exfiltrate.
Create and attach the egress firewall
hermes-egress. One outbound rule: TCP, destination 10.0.0.0/24, any port.In Apply To → Servers, select only hermes-vps. Attaching this to av-broker breaks the brokered requests.10. Try it end-to-end
Send any prompt to your Telegram bot. Hermes replies, with every outbound call routed through10.0.0.2:14322.
To exercise all four brokered services in one prompt:
Summarize the last five commits inTo watch brokered traffic in real time, tail the gateway journal on<owner>/<repo>and post the summary to#ai-updateson Slack.
hermes-vps:
11. Revoke and recover
Send another Telegram message
401 from the broker. The placeholder strings on hermes-vps are inert without a valid agent token.Re-issue to recover
AGENT_VAULT_TOKEN in /root/.hermes/gateway.env, then systemctl restart hermes-gateway. Hermes replies normally. See Agents → Rotating an agent token.Cleanup
- Hetzner Cloud Console → Servers: delete
av-brokerandhermes-vps. - Networks →
av-net: delete. - Firewalls: delete
ssh-lockdownandhermes-egress. - Rotate or revoke the real upstream API tokens you uploaded (they remain valid in their home services until you do).
Related
- Hermes Agent quickstart: local-laptop version of this flow.
- Connect a custom agent: same pattern for any agent that supports
HTTPS_PROXY. - Container isolation: local Docker isolation as an alternative to a remote VPS.


