Repository navigation
fix: a stored secret is write-only, for everybody — keys, tool-server auth, agent secrets, settings (CLEAN-275) - #254
Merged
Conversation
No route, tool, preview or error returns a stored secret or any part of it any more, the Owner included. Answers say apiKeySet / authValueSet / botTokenSet, a setting's secret + set, an env entry's withheld. One place: #/setup/writeOnly, with a presenter per slice (llmAsRead, mcpServerAsRead, agentChannelAsRead, settingAsRead, agentEnvAsRead, manifestAsRead). - Default-deny: a setting's value only for a key the catalogue files secret: false (aws_access_key_id is now secret, uncatalogued keys are withheld); an env value only for a name in AGENT_ENV_SHOWN; MCP_SERVERS_B64 shown without credentials. - Writes: an omitted or empty secret keeps the stored value, null clears a tool server's credential, a value replaces. - CLEAN-271's Owner exception (WITHHELD_SECRET) is retired. - The notification destination's last-four hint is gone. - Settings read by a person are live, through the assistant or not (readingSettingsAsShown); its deploy still reads the approved values. - The GitHub check runs server-side: POST /settings/github/check and check_github_token. - Provider and probe errors are scrubbed. - writeOnly.census.spec.ts files every credential-shaped DTO field, setting and env name, and fails on a route or tool that answers a secret-bearing row without a presenter. Co-Authored-By: Claude <noreply@anthropic.com>
…LEAN-275) The LLM list and edit, the tool-server form, the Settings forms (Bridle, GitHub, Storage, Knowledge), the agent Secrets tab, the Environment panel, the channels form and the notification destination no longer show, mask, reveal or prefill a stored secret. A secret field is empty with "Set · replace" or "Not set"; empty keeps the stored value, a typed value replaces it, Remove clears what may be cleared. The GitHub check asks the API. The Secrets tab loses the JSON plaintext view. App: no screen shows a stored secret; the registration flag reader follows the typed settings answer. SDKs regenerated in both consoles. Co-Authored-By: Claude <noreply@anthropic.com>
…in could read (CLEAN-275) Co-Authored-By: Claude <noreply@anthropic.com>
…N-275) secrets.mjs: as the Owner and an Admin at 390 and 1440 px, the LLM edit page, the tool-server form, the Bridle, GitHub, Storage and Knowledge settings and the notification destination show Set, never a value (DOM, inputs, HTML, Nuxt payload, every response body); an empty save keeps, a typed value replaces, Remove clears, proved in the database. The GitHub check runs server-side. Agent Secrets and channels say "not run" without an S3 store. leak-sweep: stored secrets are allowed for nobody, the Owner included (docs/agent-tools.md "## Secrets"); the CLEAN-275 known entry is gone; an explicit Owner check; the notification address's last four characters are a canary of their own; aws_access_key_id is planted; a short existing setting is no longer overwritten; excerpts never print a real value next to a canary; the env preview says when it cannot be reached. Both join all.mjs. assistant-built-from: the Admin and the Owner both read flags, not keys. Co-Authored-By: Claude <noreply@anthropic.com>
…t shows ${RANCH_API_TOKEN} (CLEAN-275)
At 390 px the chat and embedding credential selects took the width of
their longest option and ran past the card. The tool-server form printed
${'$'}{RANCH_API_TOKEN} literally: a Vue template does not interpolate ${}.
Co-Authored-By: Claude <noreply@anthropic.com>
…-write-only # Conflicts: # admin/slices/setup/api/data/repositories/api/schemas.gen.ts # admin/slices/setup/api/data/repositories/api/types.gen.ts # app/slices/setup/api/data/repositories/api/schemas.gen.ts # app/slices/setup/api/data/repositories/api/types.gen.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: CLEAN-275.
What was wrong
Any Admin received stored secrets in plaintext; the Owner did too. Confirmed on production, read-only: the installation's settings hold the hub key, the AWS key pair, an Anthropic API key, a Claude Code OAuth token and a GitHub PAT, and
GET /settingsreturned every value to any Admin. Also returned: every LLM credential's key (the list showed its first and last four characters, the edit form was prefilled with it), every tool-server credential, agent secrets, the env preview (model key, hub key, AWS keys,MCP_SERVERS_B64with server auth inside), Telegram bot tokens, the last four characters of the notification address, and template install previews echoing a manifest'sauthValue. The assistant's tools masked catalogued secret settings only, so an uncatalogued key came back in plaintext.The rule
A stored secret is write-only, for everybody, the Owner included. No route, tool, preview, export, log or error returns a stored secret or any part of it. A response says only whether one is set. CLEAN-271's exception (the assistant's secrets readable by the Owner) is retired.
What changes
apiKeySet,authValueSet,oauthClientIdSet,botTokenSet,{ name, set, updatedAt }for agent secrets,{ name, value|null, withheld }for the env preview. One presenter per slice on shared helpers in#/setup/writeOnly.value: null, set. The env preview shows values only for names inAGENT_ENV_SHOWN;MCP_SERVERS_B64is re-encoded without credentials.nullclears it where clearing is allowed; a required secret cannot be cleared, and a secret setting is cleared withDELETE /settings/:group/:name. No write answer echoes a value.POST /settings/github/check, toolcheck_github_token): the console used to call GitHub from the browser with the PAT it read back.list_settingscalled by a person through the assistant returned the value kept back for the assistant (CLEAN-271). Kept-back values now apply only to work for the assistant itself.writeOnly.census.spec.tsfails when a credential-shaped field is unfiled, a response DTO declares a stored secret, a credential-like setting or pod env name is shown, or a route/tool answers a secret-bearing row without a presenter.${'$'}literally.docs/agent-tools.md("## Secrets" rewritten) anddocs/operations/secret-rotation.md: what was readable, how each is rotated, the hub-key order.Behaviour to know before merging
anthropic_api_keyandclaude_code_oauth_token, every LLM key, tool-server credentials, agent secrets includingmcpOauth:*, Telegram bot tokens — andJWT_SECRET(CLEAN-281). The hub key must stay equal to the API'sBRIDLE_API_KEYenv: the Owner sets the setting, then the API env, then every agent restarts. See the runbook.Checked
bun run buildclean.test:scripts245/245. Admin and appnpx nuxt typecheckclean; touched console slices green;locale:check,i18n:checkclean. Swagger and both SDKs regenerated.secrets.mjs468/468 as the Owner and a limited Admin.leak-sweep.mjs, adopted here as a regression check): 27/27 — 9 roles over the API, the tools and both consoles; the Owner and the assistant received none of the 13 planted secrets; no role reads the hub key. Only the known CLEAN-175 status-stream ids remain.Twin consoles
LLM, tool servers and settings are admin-only. The app console shows or prefills no stored secret anywhere; only
useRegistrationEnabled.tschanged, to read the typed settings answer.