An API key can only be given as a file path: let the operator paste it into Settings, kept write-only #160
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Settings take the backend's API key as the path of a file holding it (and the same for the planning backend). Using the Claude API after #155 meant creating the file by hand on the laptop, and in production with
docker execinto the container. Most apps that talk to a model API take the key in their settings page.The file path exists for a reason the change must keep: the settings spec says Braid never stores, returns, or writes the key into a run's configuration. Settings are saved as events in an append-only log, so a key saved there would live in every copy of the database forever.
What it needs
Done when
A key pasted on the Settings page is used by the next run and by Test connection, is not in the database, the event log or any API response, and survives a restart; and changing the backend URL to another host clears it.
Shipped in
bac6790(deployed; production serves it, new boot id). Change archived asopenspec/changes/archive/2026-10-09-settings-api-key.What shipped
Key set · ends in …, with Replace and Remove.Use a key file insteadkeeps the path field for a key you manage yourself./var/lib/openspecflow/keys/in production, on thebraid-statevolume). The save takes the key out of the request before anything is validated or logged, so it is in nohuman.settingsevent, no API answer and no run'sopencode.json(which references the file).Checked: in a browser on a local stack against a server that answers only one
x-api-key: tested before saving, saved, reloaded, restarted osfd, moved the URL to another host. A search of the whole state directory found the key only inkeys/backend.key, and nowhere once it was removed. Full lane green (backend, 187 browser specs, 13 simulated runs).Left to the operator: pasting the Anthropic key on production's Settings page. The hand-made
/var/lib/openspecflow/anthropic.keyfrom #155, if it was made, can then be deleted.