Repository navigation
Description
Parent
Ticket KY1 of spec #2378 (0.1.2), the contract-first ticket. Size: L.
What to build
The one place a host API key is ever read: a new rule in driver v1, the key helper, its registry, and the kit's check. This is a security piece, so its review is a full review.
1. The rule. In kernel/driver.v1.md, section 2 (Logins), add this rule after N3, word for word. N1 to N3 stay unchanged.
- N4. A host that can be driven only through an API that takes the user's key is reached only through the kit's key helper,
kernel/driver-kit/hostkey.py. The helper alone reads the key, from the user's system keychain or from the environment variable the user set, and sends it only over HTTPS to the address registered for that host inkernel/driver-kit/hosts.json. The driver never names, reads, receives or prints the key, and never chooses the address. OpenWiz never stores a key.
In the same section, under the login line, replace the sentence "When the host takes an API key, the README also names the environment variable the user sets for it." with: "When the host takes an API key, the README also names the environment variable the user may set for it and the keychain entry the helper reads (N4)."
2. The helper, kernel/driver-kit/hostkey.py. It uses only Python's standard library, on the kit's platforms.
-
Input: one JSON object on stdin, with exactly
host,method(GET, POST or DELETE),path, and an optionalbody(an object). -
Answer: one JSON object on stdout, with exactly
status(the HTTP status) andbody(the parsed JSON, ornull). On a refusal or failure it exits 1 with driver v1's D3 error shape. -
Key lookup:
- the registered environment variable, if it's set and non-empty;
- otherwise the keychain entry:
security find-generic-password -s <entry> -won macOS,secret-tool lookup service <entry>on Linux.
It reads the keychain's output from a pipe, and never puts the key on a command line.
-
Never: it never prints, logs or echoes the key. The key is in no error text, no answer and no child process's arguments or environment. It never caches the key to disk. A missing key is an error naming the variable and the entry, never a value.
3. The registry, kernel/driver-kit/hosts.json. One object per host, with exactly:
origin(anhttps://origin, no path);variable(the environment variable name);keychain(the entry name);header(authorization-bearer).
The first entry is Devin: https://api.devin.ai, DEVIN_API_KEY, openwiz-devin. Add its schema to the kit's tests.
4. The address restriction. The helper refuses all of the following before any network call:
- a
hostnot in the registry; - a
paththat isn't absolute; - a path that contains
//,..,\,@,#, a scheme, a host, a port, user info or a control character; - a
methodoutside the three.
It never follows a redirect: a 3xx comes back as its status, with no request made to the new address. It verifies TLS with the system defaults.
The kit's tests may point a registered host at a loopback fake through OPENWIZ_HOSTKEY_TEST_ORIGIN. That override is honoured only for http://127.0.0.1:<port>; for any other value the helper refuses to run.
5. The kit's check, with no sixth check. When the driver's README names a registered host, the kit's token check also does the following:
- plants a random canary key in the host's variable;
- starts a loopback fake host, and runs start, wake and stop against it;
- passes only when the canary reached the fake host only in the helper's
Authorizationheader; - passes only when the canary never appears in the driver's output, on any process's command line, or under any variable other than the host's own;
- passes only when no file of the driver names the host's variable or calls
securityorsecret-tool.
Fixtures. Planted drivers under fixtures/planted/. Each must fail with its own named line:
- reads the key itself;
- passes the key in an argument;
- asks the helper for an unregistered host;
- asks for a path with a host in it.
Also a fake host that answers a redirect: the helper must not follow it.
The README of the kit says how a key host works, in two short paragraphs.
Owned paths
kernel/driver.v1.md(only section 2: the new N4 and the login-line sentence)kernel/driver-kit/hostkey.py(new)kernel/driver-kit/hosts.json(new)kernel/driver-kit/test_hostkey.py(new)kernel/driver-kit/kit.pykernel/driver-kit/test_kit.pykernel/driver-kit/README.mdkernel/driver-kit/fixtures/kernel/driver-kit/evidence/.github/workflows/ci.yml(shared: the helper's one test line)
Relies on: nothing
Links
none
Acceptance criteria
- N4 and the login-line sentence are in
kernel/driver.v1.mdword for word, and N1 to N3 are unchanged - Every refusal in parts 2 and 4 has a test that fails first (red log in
evidence/) - The four planted drivers and the redirect fake fail the kit with their own lines, and the template still passes 5 of 5
- A fake key host driver that uses only the helper passes 5 of 5, with the canary reaching the fake host only in the header
- The key never appears in any output, argument, error, log or file the helper or kit writes
- Review: a full review, security included
Proof
P1 (helper and rule): test_hostkey.py and test_kit.py, red first in kernel/driver-kit/evidence/. A full security review.
Activity
jparker2006 commentedon Nov 22, 2026
launch-fleet: start withdrawn
jparker2006 commentedon Nov 22, 2026
launch-fleet: start checked, branch room/2379-key-helper
Started by hand on the J87 planner's go (2026-11-22):
fleet.sh claimfailed only with "can't read REST issue facts for the GitHub query Nodes". That error comes from an unrelated cross-repository pull request (openwizdev/WizSkills#275) whose second page of checks is read from openwizdev/OpenWiz. Start conditions read at 19:58Z: open; labelled ready-for-agent only, not held; no blocker; no other live claim, builder, branch or pull request; plan approval 7084605332 (revision 1) current, andfleet.sh spec 2378printedstart #2379at 19:54Z. The owned-path clash with #2075 was cleared (7084757958).jparker2006 commentedon Nov 22, 2026
agent: builder
state: done
harness: Claude Code
model: Opus 5.5
skills: build-ticket@0.2.1
step: Fixed R3, R4, R5, R7, R16 and R17 and loosened the registry test at 2292b17 with CI green; waiting for the final check.
time: 2026-11-22T23:39:23Z
pr: #2395
jparker2006 commentedon Nov 22, 2026
F4 supporting edit granted (planner), for #2379:
changes/closedwiz-2379.mdReason:
changes/2379.mdalready held a line moved over from ClosedWiz. Aschanges/README.mdrequires, that line moves byte for byte to its ownclosedwiz-file, so this ticket's changelog line can takechanges/2379.md. It is a mechanical rename, with no new content.jparker2006 commentedon Nov 22, 2026
Builder question: one supporting-edit grant needed for #2395
CI's
owned-pathscheck refuses one file:changes/closedwiz-2379.md. Every other check result is normal.Why the file exists:
changes/2379.mdonmainalready holds a line moved from ClosedWiz #2379. It is listed intools/release/moved.jsonand has no OpenWiz ticket. This ticket is a product change, so it needs its ownchanges/2379.md.changes/README.md("Moved files") says that on a collision only the moved file is renamed, tochanges/closedwiz-<N>.md, byte for byte.tools/release/entry.pyenforces this: ifchanges/2379.mdchanges while nochanges/closedwiz-2379.mdexists, the release entry fails ("rename the moved line changes/closedwiz-2379.md, or record its new bytes in the moved-number map").Options:
changes/closedwiz-2379.md: the moved line, unchanged, at its renamed path. Kind: changelog, supportingchanges/2379.md(standing rule 2) for the product change inkernel/driver-kit/hostkey.pyandkernel/driver.v1.md.no-changeloglabel. This is wrong: the change is a product change, whichchanges/README.mdsays can't use the label.tools/release/moved.jsoninstead. This is worse: it overwrites a moved record, and that file isn't owned here either.My pick: 1. I've changed nothing else, and I won't push until a grant or another answer comes.
jparker2006 commentedon Nov 22, 2026
launch-fleet: granted supporting-edit:
changes/closedwiz-2379.md, the byte-for-byte movechanges/README.mdrequires (grant 7085386842). That answers the builder's question 7085396120.jparker2006 commentedon Nov 22, 2026
agent: reviewer
state: done
harness: Codex
model: Sol 6.2 Medium
skills: review-ticket@0.4.0
step: Posted CHANGES after the re-check of the pinned head
time: 2026-11-22T22:30:05Z
pr: #2395
16 remaining items
#2379: red: the third round's kit tests for R3, R4 and R17
#2379: R3, R4, R5, R17: the active canary is redacted from path diagn…
#2379: green: the third fix round; the hidden-process retry applies o…
#2379: red: a refused process costs a retry once, and another user's …
#2379: green: a hidden process costs its retry once, and another user…
#2379: red: a hidden child that outlives its driver is missed (CI at b…
#2379: green: a hidden process in the kit's own process group fails t…
#2379: red: a hidden process older than the kit costs no retry and ra…
#2379: green: only a process newer than the kit counts as hiding, so …
jparker2006 commentedon Nov 23, 2026
launch-fleet: archived