Configuration reference: sefra.yaml
sefra serve --config sefra.yaml reads the deployment configuration once, at start. It differs per environment and is not part of a bundle. This page lists every key Sefra accepts.
Rules for the whole file
Section titled “Rules for the whole file”- Unknown keys are errors, so a misspelt key stops Sefra at start instead of being ignored.
- No secret is written in the file. The keys marked secret below take their value from the environment:
${NAME}is replaced by the variableNAMEat start, and an unset or empty variable stops Sefra. Each must be exactly one${NAME}, exceptdatabase.url, which must contain at least one (postgres://sefra_app:${PASSWORD}@db:5432/sefra); a literal value is refused.${…}in any other key is not expanded. - Durations are strings:
"500ms","30s","5m","24h". - Connector secrets are not environment references but secret references (
secrets), resolved at run time.
listen
Section titled “listen”| Key | Default | Meaning |
|---|---|---|
listen.mcp |
none | Address of the agent listener: POST /mcp and the REST mirror. Required for --role api |
listen.operator |
required | Address of the operator listener: the operator API, the approval page, the console, /healthz and /readyz |
Ports 8080 and 8081 by convention. Put both behind TLS termination; the agent listener may be reachable by agents only, the operator listener by people and automation.
database
Section titled “database”| Key | Meaning |
|---|---|
database.url |
Secret. PostgreSQL 18 connection URL of the runtime role, sefra_app. It may append to the audit trail and cannot change an event; sefra migrate runs as the owner of the tables with its own SEFRA_DATABASE_URL |
temporal
Section titled “temporal”| Key | Default | Meaning |
|---|---|---|
temporal.address |
required | host:port of the Temporal frontend |
temporal.namespace |
required | sefra by convention, with a 7-day retention period |
temporal.task_queue |
required | sefra-executions by convention |
temporal.tls |
none | Optional section. Its presence turns TLS on, version 1.2 or later. The server’s certificate is always verified, and no option skips that |
temporal.tls.ca_file |
the system roots | PEM bundle that signed the server’s certificate |
temporal.tls.cert_file, temporal.tls.key_file |
none | Client certificate and key, for mutual TLS. Both or neither |
temporal.tls.server_name |
the host of temporal.address |
The name the server’s certificate must carry |
temporal.payload_encryption |
none | Optional section. Encrypts every payload Temporal stores with AES-256-GCM |
temporal.payload_encryption.key_id |
required in the section | Id of the current key: 1 to 32 letters, digits, - or _ |
temporal.payload_encryption.key |
required in the section | Secret. Base64 of 32 random bytes. New payloads are written under it |
temporal.payload_encryption.previous |
none | Map of earlier key ids to their keys. Each value is a secret in the same format. These keys only read |
temporal:
address: temporal.internal:7233
namespace: sefra
task_queue: sefra-executions
tls:
ca_file: /etc/sefra/temporal-ca.pem
cert_file: /etc/sefra/temporal-client.pem
key_file: /etc/sefra/temporal-client.key
server_name: temporal.internal
payload_encryption:
key_id: 2026-11
key: ${SEFRA_TEMPORAL_PAYLOAD_KEY}
previous:
2026-05: ${SEFRA_TEMPORAL_PAYLOAD_KEY_OLD}
TLS files. A file that cannot be read, a CA file with no certificate, or only one of cert_file and key_file stops Sefra at start.
Keys. Generate one with openssl rand -base64 32 and pass it in an environment variable. Each key must be exactly one ${NAME}. A literal key, a value that is not base64 of 32 bytes, a missing key id, or a previous key with the current id stops Sefra at start, and the error names the key without showing its value. The key is as sensitive as the database password: whoever has it and the history can read every step output.
What is protected. Workflow and Activity inputs and outputs, Signals, and failure messages and stack traces. Trace-context headers, ids, workflow and Activity names, statuses, timings and error types stay readable to Temporal. Search attributes and memos are not encrypted; Sefra sets none. Temporal’s web UI shows ciphertext for every payload, so read an execution through the audit trail.
Reading. A payload without the encrypted encoding is read as it is, so executions started before encryption was turned on continue. An encrypted payload with an unknown key id or a changed byte is an error: the workflow task fails and is retried, and nothing runs on it. Failure text is the exception. If it cannot be decrypted, the Temporal SDK leaves the message as Encoded failure and raises no error.
Rotation. Set a new key_id and key, and move the old key under previous. Turning encryption off, removing a key or changing a key’s material needs a drain first: Upgrading by drain has the steps.
Warnings at start. Neither stops Sefra.
| Condition | Logged once at start |
|---|---|
No temporal.tls, and the address is not localhost or a loopback IP |
temporal connection is not encrypted: set temporal.tls, or keep Temporal on a private network |
No temporal.payload_encryption |
temporal stores step outputs in workflow history in the clear: set temporal.payload_encryption |
Every call to the agent interface and the operator API carries a JWT access token. The probes, the protected resource metadata and the approval page and console routes, which use a session, do not; Network and connections lists them.
| Key | Default | Meaning |
|---|---|---|
oauth.issuers |
required | Allow-list of issuer identifiers. Each issuer’s discovery document and keys are fetched from <issuer>/.well-known/ |
oauth.audience |
oauth.resource.mcp |
An audience a token may carry, besides the two resources |
oauth.resource.mcp |
required | The public base URL of the agent listener, published as resource in its protected resource metadata and accepted as audience |
oauth.resource.operator |
required | The same for the operator listener. Links in webhooks and the approval page are built from it |
oauth.claims.principal |
sub |
Claim holding the principal id (the user, when the token has act); falls back to client_id |
oauth.claims.type |
sefra_type |
Claim holding agent or human; absent means agent |
oauth.claims.agent_roles |
sefra_agent_roles |
Claim holding the agent’s roles |
oauth.claims.user_roles |
sefra_user_roles |
Claim holding the user’s roles (the human’s, or the one in on_behalf_of) |
A token with an act claim is an agent acting for a user: act.sub is the agent, the principal claim the user. The reserved roles sefra_viewer, sefra_auditor, sefra_operator and sefra_admin must reach Sefra in the user roles claim of a human.
approval_page
Section titled “approval_page”Optional. Without it the page is off and approvals are decided through the API or the CLI.
| Key | Default | Meaning |
|---|---|---|
approval_page.issuer |
the first of oauth.issuers |
The provider people sign in at; must be on oauth.issuers |
approval_page.client_id |
required | Sefra’s OpenID Connect client at the provider. Register the redirect URI <oauth.resource.operator>/sign-in/callback |
approval_page.client_secret |
none | Secret, optional. Without it Sefra is a public client with PKCE |
approval_page.authorization_endpoint |
discovered | Only where browsers reach the provider under another name than Sefra does |
console
Section titled “console”Optional. Without it, or with enabled: false, the console is off and nothing is served under /console/. People sign in through the approval_page client; with the console on and no approval_page, sefra serve refuses to start.
| Key | Default | Meaning |
|---|---|---|
console.enabled |
false | Serve the console under /console/ and its API under /console/api/ |
console.deployment_label |
empty | Shown in every header, at most 64 bytes, for example production |
console.trace_url_template |
empty | Absolute URL; ${trace_id} is replaced. Makes an execution’s trace id a link |
console.temporal_url_template |
empty | Absolute URL; ${execution_id} is replaced. Makes an execution’s workflow a link |
With the console on, a session lasts timings.console_session from the sign-in, and every write from it, an approval decision on the page included, needs a sign-in within timings.page_session; an older session is sent through sign-in again.
secrets
Section titled “secrets”Maps each secret name used in a bundle’s connectors.yaml to where its value is. Values are read at run time and again every timings.secret_refresh; a secret that cannot be read makes /readyz fail and the connector’s calls fail before anything is sent. A bundle whose connector names a secret missing here is refused at upload.
| Form | Example | Meaning |
|---|---|---|
| A name | erp_token: SEFRA_ERP_TOKEN |
An environment variable (development) |
env |
erp_token: { env: SEFRA_ERP_TOKEN } |
The same, explicit |
file |
erp_client_secret: { file: /run/secrets/erp_client_secret } |
A mounted file; one trailing newline is dropped |
manager |
erp_client_secret: { manager: sefra/erp, key: client_secret } |
Field key of the secret at path manager in secret_manager |
secret_manager
Section titled “secret_manager”Optional; needed by manager references.
| Key | Default | Meaning |
|---|---|---|
secret_manager.type |
required | openbao: the KV secrets engine version 2 over HTTP, also HashiCorp Vault’s API |
secret_manager.address |
required | Base URL |
secret_manager.mount |
secret |
The KV mount |
secret_manager.token |
required | Sefra’s token, as { env: VAR } or { file: /path }, read on every call. Give it read on <mount>/data/<path> of Sefra’s secrets only (credential scoping) |
webhooks
Section titled “webhooks”| Key | Meaning |
|---|---|
webhooks.approval_requested.url |
Where approval.requested is posted; empty: not sent |
webhooks.operator_alert.url |
Where operator.alert is posted (an execution in needs_intervention, a workflow not started); empty: not sent |
webhooks.signing_secret |
Secret. Key of X-Sefra-Signature: v1=<hex HMAC-SHA256 of "<timestamp>.<body>">, with X-Sefra-Timestamp. Required when a URL is set. Receivers verify it and refuse a timestamp more than 5 minutes off |
What each body carries is in Network and connections. The client follows no redirect: a 3xx answer is a failed attempt, audited and retried.
| Key | Meaning |
|---|---|
audit.redaction_secret |
Secret, required. Key of the keyed hashes that replace sensitive values. Changing it makes new hashes incomparable with old ones: keep it for the life of the deployment, and back it up with the database |
timings
Section titled “timings”The durations you can set, so that tests can shorten them. Defaults apply to every key left out. Production uses the defaults unless a reason is written down.
| Key | Default | Meaning |
|---|---|---|
sync_wait |
10s | How long a submission waits for a final status before returning a handle |
poll_after_executing |
5s | poll_after_s while executing or compensating |
poll_after_pending_approval |
30s | … while pending_approval |
poll_after_needs_intervention |
300s | … while needs_intervention |
approval_expiry_default |
24h | How long an approval stays open |
approval_expiry_max |
168h | Upper bound of the expiry |
approval_recheck |
5m | How often a waiting approval wakes besides signals |
fact_timeout |
2s | Default timeout of a fact read (a manifest’s timeout_ms overrides it) |
forward_attempt_timeout |
30s | One attempt of a forward call |
forward_initial_backoff, forward_max_backoff |
1s, 30s | Backoff between forward attempts, doubling |
compensation_attempt_timeout |
30s | One attempt of a compensation |
compensation_initial_backoff, compensation_max_backoff |
1s, 5m | Backoff between compensation attempts |
compensation_total |
24h | How long a compensation is retried before compensation_failed |
probe_attempt_timeout |
30s | One probe attempt |
activity_start_to_close |
40s | Temporal’s limit on one call Activity; longer than an attempt |
idempotency_retention |
720h | How long a key and a step’s output are kept after the final status (30 days) |
denial_breaker_window |
10m | Window of the denial breaker (20 rejections suspend the agent) |
duplicate_window |
24h | Window of facts.sefra.duplicates_24h |
operational_retention |
168h | How long step inputs are kept after the final status (7 days); match Temporal’s namespace retention |
webhook_signature_window |
5m | The verification window, for receivers; Sefra itself does not read it |
token_leeway |
30s | Clock skew allowed on token times |
jwks_max_age |
5m | Signing keys are fetched again after this |
jwks_min_refresh |
10s | At most one refetch per issuer this often, on an unknown key |
page_session |
1h | Approval page session after the sign-in, also sent as max_age. With the console on: how recent a sign-in a write needs |
console_session |
8h | With the console on: a session after the sign-in. Not shorter than page_session |
page_sign_in |
10m | How long a started sign-in may take |
secret_refresh |
5m | How long a connector secret is used before it is read again |
audit_self_check |
5m | How often a worker recomputes the whole audit chain as a self-check, shown in the console; sefra audit verify stays the independent check |
startup_wait |
60s | How long serve retries PostgreSQL and Temporal at start |
Environment variables
Section titled “Environment variables”| Variable | Read by | Meaning |
|---|---|---|
Any ${NAME} of the file |
serve |
The secrets above |
OTEL_EXPORTER_OTLP_ENDPOINT and the other standard OTEL_* |
serve |
Telemetry over OTLP/HTTP; unset: none is sent |
SEFRA_DATABASE_URL |
migrate, audit, policy replay, usage |
The database, as the tables’ owner for migrate and any role that may read the audit tables otherwise |
SEFRA_LICENSE_FILE |
serve |
The path of the licence file; unset: the deployment runs its evaluation or the licence it has already installed |
SEFRA_OPERATOR_URL, SEFRA_OPERATOR_TOKEN |
approvals, control, executions, drain, license |
The operator listener and a bearer token (CLI) |
SEFRA_URL, SEFRA_TOKEN |
bundle apply, bundle upload |
The same, for bundle upload; the token of a sefra_admin |