SecretRef contract
One object shape everywhere:env and store refs have an implicit provider at their source’s effective default alias: secrets.defaults.env or secrets.defaults.store, falling back to default when unset. A matching same-source secrets.providers entry takes precedence; otherwise, the ref uses the built-in reader without a provider entry.
Other aliases and all file/exec refs require a registered secrets.providers entry with the same source. Changing a source’s default does not rewrite explicit refs: a ref that still names default after an override must match a registered same-source provider, or resolution fails.
- env
- file
- exec
- store
providermust match^[a-z][a-z0-9_-]{0,63}$idmust match^[A-Z][A-Z0-9_]{0,127}$
Provider config
Define providers undersecrets.providers:
env or store default alias is also used by an entry for another source, that source’s built-in provider wins. Non-default aliases and file or exec providers must resolve to an explicit entry with the matching source.
Read-only inspection recognizes valid store bindings without opening the database. That is configuration evidence, not proof that the value exists: credential availability stays unknown until runtime resolution.
Env provider
Env provider
- Optional exact-name allowlist via
allowlist. A matching explicit env provider enforces this list even when it is the selected default. Omit the list to allow any name; use[]to deny every name. - Missing or empty env values fail resolution. An explicit env SecretRef remains authoritative and does not fall through to another credential or auth profile.
File provider
File provider
- Reads the local file at
path. mode: "json"(default) expects a JSON object payload and resolvesidas a JSON pointer.mode: "singleValue"expects ref id"value"and returns the raw file contents (trailing newline stripped).- Path must pass ownership/permission checks;
timeoutMs(default 5000) andmaxBytes(default 1 MiB) bound the read. - Windows fail-closed: if ACL verification is unavailable for the path, resolution fails. Move the secret to a path whose ACLs OpenClaw can verify; there is no provider-level bypass.
Exec provider
Exec provider
- Runs the configured absolute binary path directly, no shell.
commandmust not be a symlink, must not be group- or world-writable, and on POSIX must be owned by the current user. For package-manager shims, resolve the real binary path (for example withrealpath "$(command -v vault)") and configure that absolute path. UsetrustedDirsto restrict executables to approved directories.config validatechecks every manual exec command path without executing providers. Config writes and dry runs check only changed or newly referenced providers, so an unrelated inactive provider does not block repairs. These are path trust checks, not proof that a provider can execute or return a secret.- Supports
timeoutMs(default 5000),noOutputTimeoutMs(default equalstimeoutMs),maxOutputBytes(default 1 MiB),env/passEnvallowlist, andtrustedDirs. jsonOnlydefaults totrue. WithjsonOnly: falseand a single requested id, plain non-JSON stdout is accepted as that id’s value.- Windows fail-closed: if ACL verification is unavailable for the command path, resolution fails. Use a command path whose ACLs OpenClaw can verify; there is no provider-level bypass.
- Plugin-managed exec providers can use
pluginIntegrationinstead of a copiedcommand/args. OpenClaw resolves the current command details from the installed plugin manifest during startup/reload; if the plugin is disabled, removed, untrusted, or no longer declares the integration, active SecretRefs on that provider fail closed.
code is an optional machine-readable diagnostic. OpenClaw displays the recognized
codes NOT_FOUND and AMBIGUOUS_DUPLICATE_KEY with the provider and ref id. Other
codes and free-form fields such as message are accepted for protocol-v1 compatibility
but are not displayed because resolver output can contain credential material.Store provider
Store provider
- Reads values from OpenClaw’s shared state SQLite database.
- The provider has no connection settings.
secrets.defaults.storeselects its default alias. - Only team scope is resolved. Identity scope is not supported yet.