Skip to content

Secrets & vault

Your credentials live in a single age-encrypted file on your VPS. They are decrypted at service start and exposed only to the Han AI processes that need them.

The vault

ItemValue
Path~/.hanai-vault.age (under the hanai user’s home)
Formatage-encrypted key/value file
Created byThe provisioner during step 8 of setup
Read bysystemd at boot, rendered into /etc/hanai/runtime.env and /etc/hanai/dashboard.env

What’s in it

KeyWhat it is
TELEGRAM_BOT_TOKENThe bot token from BotFather.
OPENAI_API_KEYLanguage model and transcription provider key.
AIRTABLE_PATPersonal access token scoped to your base.
AIRTABLE_BASE_IDThe Airtable base ID for your workspace.
SESSION_SECRETAuto-generated. Signs dashboard session cookies.
URL_TOKEN_SECRETAuto-generated. Signs short-lived URLs.
SMTP_*Optional. Host, user, password, from-address for the email capability.
CHROMA_URLOptional override for the local vector store.

How loading works

  1. At boot, systemd reads /etc/hanai/runtime.env and /etc/hanai/dashboard.env.
  2. These files are rendered from the age vault during provisioning and on update.
  3. The runtime wraps secret access so that a missing value returns null rather than crashing — capabilities degrade gracefully when a credential isn’t set.

What this means for you

  • If a capability needs a credential you haven’t provided, the AI COO knows it’s unavailable and won’t pretend it can use it.
  • You can add or rotate a credential later. Your operator drops it into the vault and restarts the service.
  • Nothing reads the vault except your VPS.

Rotating a credential

Message your operator with what needs rotating. Rotation is a vault edit plus a service restart. The bot is back online in under a minute.

Next