Skip to main content

KeePass provider

Resolve encrypted secrets from local .kdbx vaults — no cloud service required.

The KeePass provider gives Loom workflows access to secrets stored in standard KeePass databases. Vault credentials stay in the runtime environment; workflow YAML stores only keepass:// references. Loom resolves values at execution time, injects them into jobs, and redacts them at every output boundary.

When to use KeePass

ScenarioKeePass is a good fitConsider an alternative
Local development and CI on self-hosted runnersYes — vault file lives on disk, no external dependency
Air-gapped or offline environmentsYes — no network calls required
Centralized team secret management with audit logs1Password (op://) offers shared vaults with audit trails
Secrets that must rotate automaticallyUse a provider with rotation APIs

URI format

keepass://<database-alias>#<entry-path>:<field>
ComponentDescriptionExample
database-aliasAlias mapped to a .kdbx file via runtime env vars. Can be a simple name or a path.local, team, group/project/repo
entry-pathKeePass group/entry hierarchy using / separators. Matched by suffix, so you only need enough path segments to uniquely identify the entry.services/loom/deploy
fieldField name on the entry.password, token, username

Full example:

secrets:
DATABASE_PASSWORD:
ref: keepass://local/main#services/loom/deploy:password

How resolution works

Workflow YAML         Loom runtime              KeePass .kdbx
────────────── ───────────── ─────────────
ref: keepass://... → parse alias, path, field
→ resolve alias → env vars → open database
→ walk entries (suffix match) → read field
→ inject value (file or env)
→ redact at output boundaries

Step-by-step:

  1. Parse — Loom extracts database-alias, entry-path, and field from the ref URI.
  2. Alias resolution — The alias is converted to an uppercase key (lowercase letters uppercased, non-alphanumeric characters replaced with _). Loom reads LOOM_KEEPASS_DB_<KEY>_PATH to locate the .kdbx file.
  3. Credential indirectionLOOM_KEEPASS_DB_<KEY>_PASSWORD_ENV and LOOM_KEEPASS_DB_<KEY>_KEYFILE_ENV each point to the name of an environment variable that holds the actual credential. This two-layer design keeps master credentials out of Loom config.
  4. Database open — The .kdbx file is opened and decrypted using the resolved password, keyfile, or both.
  5. Entry lookup — Loom walks the KeePass group/entry tree and matches entries by path suffix. If the path matches exactly one entry, the requested field is read.
  6. Injection — The resolved value is injected into the job environment as a file path (file: true, the default) or as a raw value (file: false).
  7. Redaction — All resolved values are redacted before Loom writes to console output, receipts, or error messages.

Alias key conversion

Loom converts a database alias to an environment variable key using these rules:

Character typeConversion
Lowercase letter (az)Uppercased (AZ)
Uppercase letter or digitKept as-is
Everything else (/, -, ., etc.)Replaced with _

Examples:

AliasKeyEnv var prefix
localLOCALLOOM_KEEPASS_DB_LOCAL_*
teamTEAMLOOM_KEEPASS_DB_TEAM_*
group/project/repoGROUP_PROJECT_REPOLOOM_KEEPASS_DB_GROUP_PROJECT_REPO_*

Runtime environment variables

For a given alias key <KEY>:

VariableRequiredPurpose
LOOM_KEEPASS_DB_<KEY>_PATHYesAbsolute path to the .kdbx database file
LOOM_KEEPASS_DB_<KEY>_PASSWORD_ENVNo*Name of the env var containing the KeePass master password
LOOM_KEEPASS_DB_<KEY>_KEYFILE_ENVNo*Name of the env var containing the path to the KeePass keyfile

*At least one credential source must resolve. Both can be set for combined password + keyfile authentication.

Entry path matching

Entry paths use suffix matching. You do not need to specify the full path from the KeePass root group — only enough trailing segments to uniquely identify the entry.

Database structureentry-path in refResult
Root / services / loom / deployservices/loom/deployMatches (exact suffix)
Root / services / loom / deployloom/deployMatches (shorter suffix)
Root / v1 / deploy and Root / v2 / deploydeployFails — ambiguous (SECRETS_REF_INVALID)

If a path matches zero entries, resolution fails with SECRETS_REF_NOT_FOUND. If it matches more than one, resolution fails with SECRETS_REF_INVALID.

Error codes

All errors cause the job to fail closed (no fallback, no empty injection).

CodeCauseFix
SECRETS_PROVIDER_UNAVAILABLEAlias env vars missing, credentials invalid, or .kdbx file unreadableVerify LOOM_KEEPASS_DB_<KEY>_* variables and database path
SECRETS_REF_INVALIDMalformed URI or ambiguous entry pathCheck URI format; add more path segments to disambiguate
SECRETS_REF_NOT_FOUNDEntry path or field does not exist in the databaseConfirm the entry and field exist in the .kdbx file
SECRETS_REQUIRED_MISSINGA required: true secret could not be resolvedFix provider config or set required: false for optional secrets
SECRETS_UNSAFE_DEBUG_TRACECI_DEBUG_TRACE=true with file: false injectionRemove debug trace or switch the secret to file: true

Security model

The KeePass provider enforces three boundaries:

  1. References only in YAML — Workflow files store keepass:// URIs. Credential material never appears in committed files.
  2. Credential indirection — Vault master passwords and keyfile paths are referenced by env var name, not by value. The _PASSWORD_ENV / _KEYFILE_ENV variables contain names, not secrets.
  3. No read/show CLI commands — The loom secrets keepass CLI intentionally omits any command that would print secret values to stdout. All output is limited to metadata (alias, path, field names).

Resolved values are redacted at every output boundary. Even with redaction active, avoid printing secret-bearing variables in scripts.

Credential combinations

The KeePass provider supports three authentication modes when opening a .kdbx database:

ModeConfig requiredUse case
Password only_PASSWORD_ENV setSimplest setup for local development
Keyfile only_KEYFILE_ENV setAutomated environments where a keyfile is provisioned
Password + keyfileBoth setHighest security — requires both factors

Limitations

  • No remote vaults — the .kdbx file must be accessible on the local filesystem at runtime.
  • No automatic rotation — credential updates require running loom secrets keepass vault update or editing the database externally.
  • Single-user locking — KeePass databases do not support concurrent writes. Avoid parallel jobs that mutate the same vault.

Get started

  1. Install and setup — Configure a vault alias and runtime credentials.
  2. CLI reference — Create vaults and manage entries with loom secrets keepass.
  3. Workflow integration — Use keepass:// references in job definitions.

For the broader secrets system, see the Secrets overview.