Tunable values are runtime settings: stored in the service's own database and edited by super admins in the Tawa Console. A redeploy or a code change is never needed to flip a value.
act). There is no app allowlist: the Console, the tawa CLI or any Bio-ID app the person signed in
through. Every write is audited with by (the person) and via (the agent, if any).off / shadow / enforce)Use tawa config (see config) for values that wiring needs before the database is reachable
or that must never be visible in a UI:
sub values allowed to write settings)If changing the value is a product or operations decision, it is a setting. If changing it reconnects the service to something, it is config.
Reference implementation: iec-janus, src/services/settings.ts and src/routes/adminSettings.ts.
authz, gas.buyUrl,
promo.launchGrantsEnabled), each with a zod schema, a defaultValue, a one-sentence
description, and an editor hint: 'boolean' | 'number' | 'string' | 'url' | 'json'.before, after, by and at.getSetting(key) is synchronous, never throws, and returns the registry default when no value
is stored or the stored value fails its schema.version. A write may send expectedVersion;
a mismatch is rejected so two admins cannot overwrite each other.getSetting on every run,
never once at boot, so a flag flipped in the Console takes effect on the next run.const SETTINGS = {
'promo.launchGrantsEnabled': {
schema: z.boolean(),
defaultValue: () => false,
description: 'Run the launch promo-grant cycle for eligible agency orgs.',
editor: 'boolean',
},
} as const
if (getSetting('promo.launchGrantsEnabled')) await runLaunchGrantCycle()
Mounted under the service's own prefix (<prefix>).
| Route | Purpose |
|---|---|
GET <prefix>/admin/settings | List every declared setting |
PUT <prefix>/admin/settings/:key | Set one value. Body: { "value": ..., "expectedVersion": 3 } (expectedVersion optional) |
GET <prefix>/admin/settings/:key/history?limit= | Audit rows for one key, newest first |
The list response:
{
"settings": [
{
"key": "gas.buyUrl",
"value": "https://example.com/buy",
"default": "",
"version": 4,
"source": "stored",
"updatedBy": "<bio-id sub>",
"updatedAt": "2026-10-04T12:00:00.000Z",
"description": "Where the 402 INSUFFICIENT_GAS response sends a caller to buy gas. Empty = no link.",
"editor": "url"
}
],
"canWrite": true,
"actor": "<bio-id sub>"
}
source is stored (a value is in the database) or default (the registry default; version 0).
updatedBy and updatedAt are absent for a key that has never been written.
sub in the service's owners
list) or, where the service says so, a platform super_admin.tawa login, tawa switches) or any other app.
Signature, issuer and expiry are still verified. Do not add a client_id/aud list of
"console apps" to a settings or admin route, in code, env or a runtime setting (Derek,
2026-11-18; the old SETTINGS_CLIENTS / CONSOLE_CLIENTS / BUILDER_SETTINGS_CLIENTS /
GATEWAY_OWNER_CLIENTS / promo.manualGrantClients lists were removed).403.
A service, script or agent holding the internal key cannot change a setting.act (or azp, or an agent session such as
amr chaac_cloud) is accepted on settings and admin writes when its subject (sub) is a settings
owner or super admin, whoever the actor is (Jefferson, tawa session, tawa-cli). The audit records
the actor as via next to the person (by), so a change made through an agent is visible
(Derek, 2026-11-18). Personas are refused. act handling on other routes (bind-authority, the
Locker) is unchanged, and the webmaster DNS-apply and ledger human-only period gates stay as they are.canWrite and actor in the list response tell the UI whether to render fields as editable.
tawa switches list -s policy-spot # every setting, value, version
tawa switches get -s policy-spot binders.defaultTemplateId
tawa switches set -s policy-spot binders.defaultTemplateId '"tpl_123"' # JSON value
tawa switches history -s policy-spot binders.defaultTemplateId
set sends expectedVersion from a fresh read, so it never overwrites a change it did not see.
The CLI sends your own login token; for a service that accepts only its own audience
(iec-bio-api) it exchanges the login first, as tawa session does.
The Tawa Console (tawa-web) renders every declared setting generically from description and
editor. Adding a key to the registry is all it takes; no Console change or deploy is needed.
| Service | Console page |
|---|---|
| iec-janus | Console → Janus Switches |
| iec-wallet | Console → Wallet Switches |
A PR that adds a tunable env var or config var is changed to a setting before merge. Reviewers ask one question: could someone want to change this without a deploy? If yes, it goes in the registry.
Last updated: November 19, 2026