Admin Config (KV overlay)
Path: packages/config · apps/admin (Config UI + /api/config) · control-plane integrationEnv() · Pulumi brilliant-config KV
Status: Landed in #290 (merged 2026-10-02). Searchable table + create/delete: #381 (merged 2026-10-03). Staging brilliant-config KV already existed; prod still needs the infra workflow (reviewer approval) before the next prod deploy, or render fails closed on the new CONFIG_KV binding.
Composio auth-config ids are not secrets, but they used to live in the Secrets Manager bundle. Changing one meant editing the bundle and re-pushing every Worker’s secrets; a missing id shows up as “the Connect button didn’t show up” (see gotchas/integrations.md). #290 moves them into a brilliant-config KV namespace and an admin Config page.
This is also the first feature written in Effect 4, as the reference for gradual adoption (see Effect adoption below).
What staff see
Landed in #381 (merged 2026-10-03). The old provider-card grid is gone; the page is one searchable table (shared Table), like Flags.
| Surface | Behaviour |
|---|---|
| Table | One row per registered key: Setting (key, plus provider/scope or description), Value, Status (“Set here” / “Not set”), actions. |
| Search | Case-insensitive; matches provider name, scope, key name, description, and stored value. Every word must match (e.g. jira read → one row; paste an auth-config id to find which key holds it). Count (“N of M settings”) sits next to the env name. |
| Create | New config in the header, or Create on an unset row. Picker lists only unset registered keys, grouped by provider. Stores a value for a key that has none — mirrors “Create flag”. Needs recent sign-in, audit reason; production also requires typing prod. |
| Edit | On a stored row: save a new value. Same gates. |
| Delete | On a stored row: remove the KV value so readers fall back to the Worker env var / Secrets catalog. Same gates. This is the former Revert. |
No free-form keys. Config names are a code registry (CONFIG_KEYS); each has a schema and a reader. An admin-invented key would sit in KV with nothing reading it and no schema to check it, so create only offers registered unset names (@cc admin-config-changes-are-audited-first already requires a registered name).
Values saved on Config override the same names on the Admin Secrets / Secrets Manager path. The secrets catalog note says so.
API (/api/config)
| Method | Meaning | Refusal |
|---|---|---|
POST /api/config/:name | Create — store a value for a registered key that has none. Audits as admin.config.create, then writes; 201. | 409 already_set if a value is already stored (stale list cannot overwrite). |
PUT /api/config/:name | Edit an existing stored value. Audits as admin.config.update. | 404 not_set when nothing is stored (no quiet create). |
DELETE /api/config/:name | Delete stored value (fallback to env). Audits as admin.config.reset (same action name as the old Revert, so history stays continuous). | 404 not_set when nothing is stored (no no-op audit). |
Every refusal happens before the audit entry, so a rejected change never leaves an audit row. Auth (recent sign-in), registry check, schema validation, and prod confirmation are unchanged. KV has no conditional write, so the 409/404 checks narrow a two-admin race rather than close it.
Control-plane /admin/audit accepts admin.config.create. Contracts updated in the same diff: admin-config-changes-are-audited-first, admin-audit-record-staff-assertion, config-change-body-is-complete.
Storage & bindings
| Piece | Role |
|---|---|
| Pulumi KV | brilliant-config (staging/prod via the Cloudflare ids secret); side envs get brilliant-config-<env> |
| Worker binding | CONFIG_KV on control plane and admin (wrangler.jsonc); conductor also binds it for question auto-answer (#317, merged) |
| Package | @brilliant/config — ConfigStore service, in-memory + KV layers, typed key registry, ConfigStoreError vs ConfigValueError |
Side envs: admin writes this namespace. patchAdminConfig throws if a side env has no own CONFIG_KV id — a quiet fallback would bind the base id and let a side env edit staging’s live settings (gotchas/side-envs.md). #317 also binds conductor to the same per-env CONFIG_KV so question auto-answer reads the side env’s timeout, not staging’s.
Prod rollout: base wrangler.jsonc declares CONFIG_KV; renders fail closed when the binding’s id is missing from the target account’s ids secret. Run the prod infra workflow (reviewer approval) before the next prod deploy, or prod render stops. Staging’s namespace already exists.
Runtime behaviour
- Allowlisted overlay only. Control-plane
integrationEnv()may take from KV only names inCOMPOSIO_AUTH_CONFIG_KEYS(@cc config-overlay-is-allowlisted-and-fails-to-env). A KV entry can never replace a signing key or other binding. - Fail to env, not to unset. KV failure or a malformed value falls back to the Worker env var — never “unset” and never a thrown error that breaks Connect. A malformed stored value can still be deleted.
- Nothing changes until saved. Until an id is written on Config, Workers keep using secrets / env as today.
- Audit before mutate. Change needs a recent sign-in; value is validated before the audit row; the audit row is written before KV is touched (
admin.config.create/admin.config.update/admin.config.reset). A failed audit blocks the write (@cc admin-config-changes-are-audited-first). - Classic KV lag. Changes can take up to about a minute to reach every location (measured on a side env; see
gotchas/cloudflare.md). The Config page warns operators.
Registry today:
- Eight Composio providers ×
{READ,FULL}→ 16 keys namedCOMPOSIO_AUTH_CONFIG_<PROVIDER>_{READ,FULL}. QUESTION_AUTO_ANSWER_SECONDS(#317, merged) — see Question auto-answer timeout.
Question auto-answer timeout (#317, merged)
| Key | Role |
|---|---|
QUESTION_AUTO_ANSWER_SECONDS | Seconds the conductor waits before auto-answering an unanswered question or plan-approval form. Default 300. 0 disables. Allowed range otherwise 30–3600. Missing key or KV outage → 300 (never “off”). |
Editable on the admin Config page (same audit / recent-sign-in / prod-confirm gates as Composio ids). Product rules for what gets answered: Control plane — Server-side question / plan auto-answer. Hand-written KV values need the store’s config/ prefix.
Effect adoption
From AGENTS.md:
- Small new features are written in Effect (v4).
packages/configis the reference:Context.Service, layers per implementation, typedTaggedErrors,Effect.runPromiseat exactly one plainasyncboundary so Hono routes stay ordinary. - Editing an existing non-Effect feature: ask whether to migrate; do not migrate on your own, and do not refuse the fix because the file is not Effect.
- Keep Effect out of one-shot tooling (Pulumi,
scripts/env). - Do not cite Effect APIs from memory or v3 tutorials (
Context.Tag→Context.Service); check the installed.d.ts. Version is pinned by rootoverrides(OpenCode needs it).
Related
- Admin Secrets · Control plane — question / plan auto-answer · Conductor — Question / plan auto-answer · Secrets & environments · Side environments · Troubleshooting · Hosting & Pulumi
- Source PRs: #290 (merged 2026-10-02); #317 (merged 2026-10-02 —
QUESTION_AUTO_ANSWER_SECONDS); #381 (merged 2026-10-03 — searchable table, create/delete)
BILLING_UNLIMITED_CREDITS (#907, merged)
PR #907 (merged 2026-10-14) documents how the registered config key BILLING_UNLIMITED_CREDITS is used outside staging-only hand edits (the switch itself landed in #902):
| Env | Who sets it | Notes |
|---|---|---|
| Side env | env:up writes true once while the key is unset | An operator's stored false (or true) survives a re-run |
| Staging | Hand edit in admin › Config | Never written by Pulumi or a config file |
| Production | Ignored whatever it says (logged); enforces | Scripts never write it |
Each isolate memos the value for 30 seconds, so a change can take that long to show. scripts/e2e/billing-live-check.ts may temporarily set a side env to false for its run and restore afterwards; it refuses to write staging/prod. See Side environments — unlimited credits.
BILLING_KEEP_APPS_PUBLISHED (#916, removed by #920)
Removed: this key no longer exists (#920, merged)
PR #920 (merged 2026-10-14 14:20 IDT) removed this Config key, its reader and its tests. Keep-apps is now the platform flag billing_keep_apps_published in admin › Flags, created separately in staging's and prod's Flagship, with per-tenant and per-env targeting and a strict read so an unreadable Flagship postpones that tenant instead of unpublishing. See Admin Feature Flags and Billing: keeping apps published via Flagship. The rest of this section is history.
PR #916 (merged 2026-10-14 12:55 IDT by yoni-monday) added this registered key. It was off unless the stored value was exactly true, and it was honoured in production.
| Value | When hosting grace ends |
|---|---|
Unset or false | Unpublish apps and suspend (today's behaviour) |
true | Suspend only; apps stay published and the audit row says so |
| Read fails | No grace ends that run; one warning, retried next run |
It shares the 30-second memo, KV read and strict true/false codec with BILLING_UNLIMITED_CREDITS (billing/config-switch.ts). Switching it off later does not unpublish tenants already suspended while it was on, and there is no admin unpublish action.
Full #916 rules: Billing: keeping apps published (#916).
Studio model keys: STUDIO_AUTO_TIERS and STUDIO_DEFAULT_MODEL (#905, merged)
#905 (merged 2026-10-14 11:39 IDT) adds two registered keys (packages/config/src/studio-auto-tiers.ts, studio-default-model.ts) that choose which models Studio runs, with no deploy.
| Key | Used when | Code default (unset) |
|---|---|---|
STUDIO_AUTO_TIERS | A request sends model: "auto" (the Studio picker's default) | quick claude-haiku-5-5/low · balanced meta/muse-spark-1.3/medium · deep gpt-6.1-sol/high · brilliant claude-opus-5-5/xhigh |
STUDIO_DEFAULT_MODEL | A prompt names no model (MCP create_app / send_prompt, API callers) and its session has none yet | claude-opus-5-5/low |
Both values are compact JSON on one line (the Config field is single-line; JSON because model ids contain /, . and @). Example STUDIO_AUTO_TIERS:
{"quick":{"model":"claude-haiku-5-5","thinkingLevel":"low"},"balanced":{"model":"meta/muse-spark-1.3","thinkingLevel":"medium"},"deep":{"model":"gpt-6.1-sol","thinkingLevel":"high"},"brilliant":{"model":"claude-opus-5-5","thinkingLevel":"xhigh"}}Example STUDIO_DEFAULT_MODEL: {"model":"claude-opus-5-5","thinkingLevel":"low"}
- Saves are refused when a tier is missing or unknown, a model is not offered in Studio, or the model does not offer that thinking level (per-model levels from #820).
- Propagation: the conductor caches each read for 60 s, so a change shows up on a later prompt within about a minute.
- Cost note: the Balanced tier is what new Studio builds run by default, so editing it shifts cost and quality for most new builds.
- Display fix: the Config list now re-encodes values with the key's schema, so JSON values no longer show as
[object Object]. packages/confignow depends on@brilliant/models, so the admin worker bundles the model catalogue.- Side env gotcha: before this PR,
env:up's reused-image path (image: reuse/image: skipin the log) rendered the conductor config without the side env'sCONFIG_KVid, so the conductor read staging's config while the side env's admin wrote its own. Symptom: a side env Config change to these keys (orQUESTION_AUTO_ANSWER_SECONDS) is ignored. Fixed inscripts/env/lib/up-deploy.ts; an env deployed before the fix needsenv:upagain.
Related: Control plane: Studio Auto mode, Conductor: Auto tiers and admin default model.