Architecture
┌─────────────────────────────────────────────────────────┐
│ AI Agent (Hermes / LLM) │
│ "run psql with DATABASE_URL" │
└────────────────────┬────────────────────────────────────┘
│ CLI / HTTP
▼
┌─────────────────────────────────────────────────────────┐
│ trustless CLI │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ secret │ │ run │ │ proxy │ │
│ │ (list/ │ │ (subproc │ │ (HTTP │ │
│ │ get/set)│ │ inject) │ │ proxy + │ │
│ └────┬─────┘ └────┬─────┘ │ MITM) │ │
│ │ │ └─────┬─────┘ │
│ │ │ │ │
│ ┌────┴─────────────┴──────────────┴─────┐ │
│ │ Backend Interface │ │
│ │ (pass / env / bitwarden — swappable) │ │
│ └─────────────────────┬──────────────────┘ │
└────────────────────────┼────────────────────────────────┘
│
┌─────────────┴─────────────┐
│ │
▼ ▼
┌──────────────┐ ┌──────────────┐
│ pass store │ │ Target API │
│ (GPG + pass) │ │ / Service │
└──────────────┘ └──────────────┘
Backend Abstraction
The credential resolver is abstracted behind a simple interface:
type Backend interface {
Resolve(ctx context.Context, key string) (string, error)
List(ctx context.Context) ([]Entry, error)
}
Implemented backends:
pass(default) — wrapspass show <key>, reads first line as secretenv— reads from environment variables viaos.Getenv()(for CI/CD, containers)bitwarden— wraps thebwCLI (bw list items), resolves secureNotefields[value]/ login passwords / notes first line. Session key is passed viaBW_SESSIONenv (never argv). Unlock viatrustless bw-unlock(session key saved to~/.config/trustless/bw-session, 0600). Fails closed on invalid session. Details: docs/bitwarden-backend-design.md
Configure via trustless config set backend <name>.