Secrets and configuration
Access and integrationThe two stores a factory reads from, their scopes and precedence, and how the app shows what is missing.
A factory is data, not a place to keep credentials. It asks for a stored value by key, and the deployment resolves that key from the scopes it can see. There are two stores with the same shape and different sensitivity.
Secrets: credential(key)
A credential is a stored secret, fetched with the external port
credential(key):
step agent:
runner: opencode
in:
prompt: "Draft the answer."
token: credential(key: "opencode")
The expected precedence, narrowest first, is:
- factory — a value stored for this factory;
- user — the acting person's own value;
- organization — the factory's organization.
A factory reads only its own tenant's secrets, whatever key it names. The
environment is never read: FCT_CREDENTIAL_<KEY> is not a scope.
An automated Run (a webhook or a cron tick) has no
acting user, so it skips the user tier. A personal factory has no
organization tier. A value is write-only: the API returns the key, label
and timestamps, never the value, and the Run receives it as a secret that is
redacted wherever the Run is observed.
In the app there are three secret pages, one per scope:
- a factory's Secrets at
/factories/<id>/secrets; - My secrets at /secrets, the user scope;
- an organization's shared secrets on its page.
An owner or admin manages a scope's secrets; any member may see which keys
exist. Stored values are encrypted by default where the deployment configured
FCT_ENCRYPTION_KEYS, a Fernet keyring: the first key encrypts and all decrypt,
so rotation is prepending a key.
Configuration: config(key, default?)
Configuration is the non-sensitive counterpart: a model name, a base URL, a
feature flag. It is text, readable, comparable and editable.
step agent:
runner: opencode
in:
model: config(key: "opencode.model", default: "opencode-go/deepseek-v4.1-flash")
Resolution is the same narrow-to-wide order — factory, then user, then the
factory's organization — followed by any deployment-wide tier the deployment
adds (a file, the environment, a defaults table). A missing key returns the
call's default; without a default the step fails.
In the app: a factory's values at /factories/<id>/config, the caller's at
/config, and an organization's on its page. Every member may read a
factory's values; only an owner or admin may change them.
What the factory page tells you
The factory page lists one row per key the factory names, with the candidate sources in the run's precedence order:
- the source a run would pick is highlighted;
- a key with nothing to resolve it is red;
- a key whose every call site has a
default:is marked optional; - a key that only your personal value resolves is amber and marked manual only, because a scheduled or webhook Run has no acting user and will not see it.
That last warning is the common failure mode: a personal credential works when you fire the trigger, then the cron Run cannot find it. Store it at the factory or organization scope for automation.
Choosing where a value belongs
| value | scope |
|---|---|
| a model token one person uses while testing | user |
| the token every Run of a factory needs | factory |
| a shared token for every factory in the tenant | organization |
| a value that should be visible in the page | config, not a secret |
| a value shared by all factories in the deployment | the deployment's own tier |
For a repository-linked factory, prefer the factory scope: the source is reproducible, the deployment can be rebuilt, and the secret does not depend on which person happened to trigger the Run.
Your factories will appear here. Create one and open it beside this guide.