REDCODE / DOCS

Keys: REDcode keeps the shared key store for every EDGE tool

Draft 0.1, 2026-11-19, agreed with the owner the same day, with every recommendation below. Written from the REDnode session. The store itself is REDnode’s: Shared keys.

Why

On 2026-11-11 the EDGE VS Code extensions moved their AI service keys into VS Code’s own secret storage, each extension asking for its keys itself. The reason was a guess: the VS Code Marketplace had refused EDGEhack (“suspicious content”), and the shared store’s PowerShell decryption looked like the likely cause. That move had costs:

Then Marketplace support said keywords trigger the rejection. EDGEhack 0.1.1, which had no key code, was refused as well, and 0.1.2 went on the Marketplace on 2026-11-19 after support’s review. So the store was likely not the cause (unverified). The owner chose to bring the shared store back for every tool, with REDcode as its keeper.

The design

Part What it does
The store The shared files, unchanged: %APPDATA%\Edgemodders\keys\<service>.txt, Windows DPAPI for the current user, used-by.json beside them. A key set in the game or in VS Code is there for both
Who decrypts REDbridge, in .NET (ProtectedData, no PowerShell). No VS Code package carries decryption code. The .txt files are PowerShell’s ConvertFrom-SecureString hex, which is DPAPI with no extra entropy, so .NET reads them as they are (checked in K4a, both ways)
Who may ask REDbridge Only a client that started it with --keys: REDcode, and MCP servers that read keys. REDnode’s host starts its REDbridge without it, because it lends that REDbridge to packages and in-game servers
The keeper REDcode is the only VS Code extension that reads or writes the store, through REDbridge. Other extensions hold no key code
The interface REDcode’s extension API (REDcodeApi, beside revealInProject): keys.get(service, caller), keys.ask(service, caller) (asks the modder and saves the key for every tool), keys.onDidChange. Another extension calls it through vscode.extensions.getExtension("edgemodders.redcode-cyberpunk").exports
Keys view One place in REDcode to see, set, replace and clear every key, with the tools that read each one (used-by.json), as REDnode’s in-game Keys view does
Consent The first time a tool asks for a service, REDcode asks “EDGEhack wants your OpenAI key” and remembers the answer per tool and service. VS Code does not tell REDcode who calls, so the caller names itself: a courtesy, not a lock. VS Code extensions are trusted code in one process anyway
Environment A variable still wins (OPENAI_API_KEY and the rest), for CI and clients that pass keys

Decisions (the owner, 2026-11-19)

# Question Decided
1 Who decrypts for REDcode: keys.mjs through PowerShell, or REDbridge REDbridge. It keeps PowerShell decryption out of REDcode, the flagship with the verified badge, and removes the 1 s each PowerShell read costs
2 Hard or soft dependency on REDcode Hard: each key-using extension lists REDcode in extensionDependencies. EDGEhack and EDGEwave already do; EDGEmat and EDGEfab gain it
3 MCP servers started by Claude Code, outside VS Code They read the store through REDbridge when their environment has no key, so no key goes into claude mcp add -e
4 Keys saved in a tool’s own secret storage Moved once into the shared store, with a notice, so nobody is asked again

Phases

Phase Where What
K4a REDbridge Built on REDbridge’s main, 2026-11-20: keys.get, keys.set, keys.delete, keys.info, keys.list on the store, with used-by.json kept as REDnode’s library keeps it. Off unless REDbridge is started with --keys. Checked both ways against REDnode’s keys.mjs and against the dev PC’s own keys
K4b REDcode Built on REDcode’s main, 2026-11-20 (below): the Keys view, REDcodeApi.keys, the consent prompt. Hand test given to the owner; needs REDbridge 0.18.0 (built from REDbridge’s main until it is released)
K4c EDGEwave first The pilot: its extension asks REDcode, its MCP server reads through REDbridge, its saved ElevenLabs key moves over, and Connect an Assistant stops writing the key
K4d Every other key-using tool EDGEhack, EDGEmat, EDGEfab (and REDnode’s host, through REDbridge in place of PowerShell, if the owner wants it). A request issue each, posted 2026-11-21 on EDGEwave’s model: EDGEhack #3, EDGEmat #18, EDGEfab #10. REDnode’s host stays on its own keys.mjs (the owner, 2026-11-21: it already shares the store’s files, and its REDbridge runs without --keys on purpose)

Releases (the owner, 2026-11-19)

K4b as built (2026-11-20)

Part Where
The calls src/keys.ts, no VS Code imports: listKeys, keyInfo, getKey, setKey, deleteKey over REDbridge’s keys.*, the service id check, the store’s folder (EDGEMODDERS_KEYS_DIR, else %APPDATA%\Edgemodders\keys), the view’s lines (describeKey, never the key) and REDbridge’s refusals turned into what to do (“needs REDbridge 0.18.0”, “Restart REDbridge”)
Who may call keys.* REDcode starts its REDbridge with --keys (0.17.0 ignores the flag). BridgeClient.request(), which REDcodeApi.bridge() hands out and the MCP server uses, refuses keys.*; REDcode’s own calls go through a symbol-keyed method (KeyAccess). A courtesy, as the design says
The view and the API src/keysView.ts: the Keys view (collapsed by default, after LocKeys), its commands, the consent prompt (modal, Allow or Don’t Allow, kept in global state redcode.keyConsent per caller and service, one question at a time), REDcodeApi.keys (get, ask, onDidChange), and a watch on the store’s folder so a key set in the game or another window shows and fires onDidChange
Consent Asked only when there is a key to hand over: get for an unset key answers undefined without asking. ask allows its caller, who just had the modder type the key
Checked Unit checks (3, 74 in all): ids, folder, consent names, refusals, the view’s lines, request() refusing keys.*, the calls through a stand-in bridge. Against REDbridge built from main on a scratch folder with test keys: the whole life of a key (set, read with used-by.json recording the caller, removed), a refused key, the variable winning, REDbridge without --keys, and REDbridge 0.17.0 starting with --keys and saying 0.18.0 is needed

K4c: built in EDGEwave on 2026-11-21 (EDGEwave main d650a20, 3a4a192, 8f0c586; https://github.com/Edgemodders/EDGEwave/issues/12#issuecomment-7068351109): keys.get then keys.ask for elevenlabs, its own secret storage kept beside a REDcode without keys, Clear ElevenLabs API Key pointing to the Keys view, its MCP server reading keys.get through its own REDbridge with --keys, and a one-time move by keys.set. Checked by EDGEwave against REDbridge 0.18.0 on a scratch store. The owner’s hand test passed on 2026-11-21, first round, steps 1 to 5, no findings (moved, asked, read by the MCP server with no key in Claude Code’s entry and “EDGEwave MCP” listed as a reader, changed, cleared; EDGEwave’s docs/testing.md, Shared keys, 0b247e0). EDGEwave #12 is closed; it ships in EDGEwave 0.3.0.

Release: the rule’s first half is met: the pilot ran the whole key lifecycle, MCP use included (2026-11-21). Its second half stands: K4d moves every other key-using tool, and then they are all released at once, REDcode with them (REDbridge 0.18.0 as redcode.minBridgeVersion).

K4d, 2026-11-22: all three built on their mains, each waiting only on the owner’s hand test: EDGEfab #10, EDGEmat #18 and EDGEhack #3 (EDGEhack main 9ab55de, https://github.com/Edgemodders/EDGEhack/issues/3#issuecomment-7080867709: the OpenAI key through api.keys with ask, secret storage beside a REDcode without keys, a one-time move of its own key through its REDbridge with --keys, Clear pointing to redcode.keys.focus, no key in its MCP server; hand test “Shared keys (#3)”, 5 steps). Hand tests: EDGEfab #10 passed (2026-11-22, part B, 5 steps) and EDGEmat #18 passed (2026-11-22, “Shared keys”, 6 steps), both closed; EDGEhack #3 passed too (2026-11-22, “Shared keys (#3)”, reported by the owner to the EDGEhack session). Every K4d tool has passed. The owner then asked (2026-11-22) that every key-using tool use keys.status, so Don’t Allow is never met with a password box, each with a passed hand step for it, before the joint release: EDGEmat (its step 7) and EDGEhack (f56478e) do; EDGEwave does too (EDGEwave #14, 2d11e92, its Shared keys step 6 passed 2026-11-22, closed); EDGEfab does too (aa1fcac, its keys test step 6 passed 2026-11-22, 8a9184f). Every key-using tool uses keys.status: the joint release waits only on the owner’s go, with REDbridge 0.19.0 and REDcode’s own hand tests. REDcode #33 closes when REDcode ships it. REDcode #33 stays open until both pass.

The joint release, 2026-11-22: REDcode 0.10.16 released (#33 closed), then EDGEhack 0.1.3 (run 45082221063), EDGEfab 0.2.0 (run 45083216504) and EDGEmat 0.3.4 (run 45083176318, after its Glow and tint test). EDGEwave 0.3.0 (run 45083033980). The joint release is complete: K4 is done. Then the joint release, on the owner’s go. REDcode’s own key user since (Animation Tools, the uthana service) rides with it.

Open