Encryption at Rest
API keys are never stored in plaintext. The encryption chain:
- User runs
mithril config set gemini "AIza..." - A random salt is generated
- Argon2id derives an encryption key from the salt (+ optional user password)
- AES-256-GCM encrypts the API key
- The encrypted blob + salt are stored in
~/.mithril/config.yaml
Docker/CI: Environment Variables
In Docker, credentials come from environment variables (no file encryption needed):
MITHRIL_KEY_GEMINI=AIza...MITHRIL_KEY_OPENAI=sk-...MITHRIL_KEY_ANTHROPIC=sk-ant-...
Priority: env var → encrypted file. Env vars always win.
Permission System
Tools can be configured as:
- allow — execute without asking
- confirm — ask user before executing (default for dangerous tools)
- deny — never execute