Skip to content
This repository was archived by the owner on Oct 13, 2026. It is now read-only.

API keys in Settings, for agents to use without reading them - #87

Closed
jlcjak wants to merge 1 commit into
i2cjak:mainfrom
jlcjak:api-keys
Closed

jlcjak wants to merge 1 commit into
i2cjak:mainfrom
jlcjak:api-keys

Conversation

@jlcjak

@jlcjak jlcjak commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Settings on the window, web and both phones gets an API keys section:

  • Add API key: a name and the key. The key is typed as dots and never shown again.
  • View API keys: the names, each with Delete.

Keys live in one .env file, <home>/secrets/api.env (0600, in a 0700 folder), one NAME='value' line each so a shell can load it. Names become environment variables (openai key → OPENAI_KEY); a service needing two keys gets two names.

Agents get an <api_keys> block with the names and the path. It tells them to load the file in the same command that needs a key (set -a; . FILE; set +a; curl -H "Authorization: Bearer $NAME" …), and never to print, read, log or write a value. They can list current names with sed. No client, RPC reply, phone screen, phone saved state or prompt carries a value.

Also: the phones' Settings rows can carry input fields, and Android's Settings list now clears the navigation bar (its last row sat under it).

Tested:

  • scripts/check.sh (laws keys_*), scripts/test.sh, test/apikeys_test.bend
  • a value with ', $, \, " and a backtick loads back unchanged through sh and bash
  • end to end on a test hub, with a stand-in claude recording its arguments: names in the prompt, no values, file modes
  • adding and deleting from the web (Chromium), the window (Xvfb) and the phone client

🤖 Generated with Claude Code

Settings (window, web, both phones) gets an API keys section: Add API key
(a name and the key; the key is typed as dots and never shown again),
View API keys (the names, each with Delete). Keys live in one .env file,
<home>/secrets/api.env (0600 in a 0700 folder), a NAME='value' line each so
a shell can load it; names become environment variables (openai key ->
OPENAI_KEY).

Agents get an <api_keys> block with the names and the path, told to load
the file in the same command that needs a key and never to print, read,
log or write a value; they can list current names with sed. No client,
reply, screen or prompt carries a value.

The phones' Settings rows can carry fields now, and Android's Settings list
clears the navigation bar (its last row was under it).

Laws keys_*; test/apikeys_test.bend.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@jlcjak

jlcjak commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Moved to BackplaneWorks/Backplane#29 (merged).

@jlcjak jlcjak closed this Oct 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant