Repository navigation
feat(cli): agent run reads the scope token from a descriptor or a private file - #155
Conversation
…vate file agent run could only receive a scope token it was handed through an environment variable, and the OS keeps reporting a process's starting environment for its whole life (/proc/<pid>/environ, KERN_PROCARGS2), where same-user processes can often read it even when they can't read the launcher's files or memory. Add --scope-token-fd (Unix: read from an inherited descriptor, up to a newline or EOF, 128 bytes at most, closed before the command starts) and --scope-token-file (one read of an owner-only regular file, not a symlink, still the inspected file after open). They are exclusive with --scope and with an exported --scope-token-env variable; the existing routes and the child environment are unchanged. mcp stdio --remote --scope-token-file shares the same reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015f6iGxVJzudUSNWEjQvemb
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
harshsaver
left a comment
There was a problem hiding this comment.
🤖 Agentbox PR audit: changes requested
What needs to change
Please apply the fix plan above.
n/a
What this PR changes
- What it does: Lets a launching tool supply the scope credential through a pipe on Unix or a private file, keeping it out of the agent launcher's starting environment. The pipe is closed before the agent's command starts.
- What changes in the product: Nothing visible for existing users unless they choose the new options. Missing-credential errors list the new choices, and the remote bridge checks credential files more carefully.
- Why it exists: A process's starting environment can remain readable to other programs even after it removes a variable. These alternatives reduce exposure of a credential that can register agents, connect peers and resolve escalations.
- Why merge (or why not yet): The implementation is small and shares existing validation. One invalid descriptor value is silently ignored, allowing a launch with another credential source. The proposed fix addresses that without changing normal launches.
- What to expect after merging: Launching tools can adopt either option without protocol changes. Windows operators remain responsible for restricting access to credential files. The child's own agent credential still travels through its environment; changing that remains separate work. Harsh may also want to decide separately whether the environment route for
agent runshould be retired now that the threat model discourages it.
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 5 turns, commit 8e6f2f7)
PR audit: #155 — feat(cli): agent run reads the scope token from a descriptor or a private file
Head: 8e6f2f7
Sign-off
- Claude (fable, xhigh): ✅ satisfied — blocking finding, fix plan and Codex's corrected before/after test table all verified against the code and Go 1.27 source; decision fix stands with no further changes.
- Codex (gpt-6-astra, xhigh): ❌ not satisfied — the implementation fix is sound, but its required before/after test results were incorrect; the corrected validation plan needs re-checking.
Decision
fix — distinguish an explicitly supplied --scope-token-fd from its default so an invalid value is refused instead of silently falling back to another credential source; no additional blocking code defects found.
What changes (plain language)
- What it does: Lets a launching tool supply the scope credential through a pipe on Unix or a private file, keeping it out of the agent launcher's starting environment. The pipe is closed before the agent's command starts.
- What changes in the product: Nothing visible for existing users unless they choose the new options. Missing-credential errors list the new choices, and the remote bridge checks credential files more carefully.
- Why it exists: A process's starting environment can remain readable to other programs even after it removes a variable. These alternatives reduce exposure of a credential that can register agents, connect peers and resolve escalations.
- Why merge (or why not yet): The implementation is small and shares existing validation. One invalid descriptor value is silently ignored, allowing a launch with another credential source. The proposed fix addresses that without changing normal launches.
- What to expect after merging: Launching tools can adopt either option without protocol changes. Windows operators remain responsible for restricting access to credential files. The child's own agent credential still travels through its environment; changing that remains separate work. Harsh may also want to decide separately whether the environment route for
agent runshould be retired now that the threat model discourages it.
Findings
Blocking
- An explicit
--scope-token-fd=-1(or--scope-token-fd -1) is treated as “flag not given” and silently falls back to another credential source.cmd/october-bus/main.go:881uses-1as the default, andmain.go:904,main.go:912andmain.go:931infer presence by comparing the value with that default. Go's flag parser accepts both spellings: for-flag valueit consumes the next argument even when it starts with a dash (Go 1.27src/flag/flag.go:1130-1134), and-1parses as an integer. WithOCTOBER_BUS_SCOPE_TOKENexported, the invocation skips descriptor validation and the mixed-environment refusal, then launches using the environment token (main.go:958,main.go:989). Combined with--scopeor--scope-token-file, the descriptor flag is silently ignored instead of producing the mixed-source error. With no other source, the user receives a missing-source error despite supplying the descriptor flag. This is a contract and misconfiguration-hiding defect, not privilege escalation: it uses authority already available to the launcher. It contradicts the advertised exclusivity (adapters/README.md:57) and descriptor minimum (cmd/october-bus/scope_token.go:82). The existing negative-descriptor test calls the reader directly (scope_token_unix_test.go:134), bypassing the faulty CLI selection. Record presence withflags.Visit, followingcmd/october-bus-conformance/main.go:73-78.
Non-blocking
-
CI is awaiting maintainer approval. The status rollup is empty, and workflow run
39414106980states "This workflow is awaiting approval from a maintainer in #155" with status "Action required" (independently confirmed by both auditors). Harsh should approve the workflow for the final revision and require the configured checks to pass, including the ubuntu/macos/windows runtime matrix and the ubuntu race run (.github/workflows/ci.yml:18,ci.yml:26-29). The author reports macOS execution and Linux/Windows cross-compilation and vet checks, not Linux/Windows test execution. Workflow run -
Windows file privacy is an operator responsibility.
cmd/october-bus/scope_token.go:35skips Unix permission checks on Windows and does not inspect Windows access-control lists, matching the previous remote-file behavior. The supplied path need not be in the user's profile.docs/threat-model.md:46documents the limitation;main.go:880andadapters/README.md:57would be clearer with the same qualification. -
Flag help omits the Unix-only qualification.
cmd/october-bus/main.go:881and the usage atmain.go:44do not identify the descriptor option as Unix-only.adapters/README.md:57does, andcmd/october-bus/scope_token.go:78provides a clear Windows error. Cosmetic. -
An explicit empty
--scope-token-file=is treated as unset.cmd/october-bus/main.go:904andmain.go:925follow the CLI's existing empty-string convention for options such as--scope. Empty paths can arise accidentally, including through empty variable expansion. With the environment credential unset (the normal state for a file-route launcher) the result is the missing-source error, which names the file option. This audit retains the existing string-option convention rather than expanding the descriptor fix into a broader CLI behavior change. -
Descriptor reads require a newline or EOF.
cmd/october-bus/scope_token.go:90can wait indefinitely when a writer sends a token without a newline and keeps the pipe open. This follows the documented framing contract (adapters/README.md:57); the caller should write a newline or close its end. A timeout is not required for this change. -
The environment route remains available.
cmd/october-bus/main.go:879retains it whiledocs/threat-model.md:44recommends the alternatives. Issue #154 proposes retaining it, and other commands still use environment credentials (main.go:555,main.go:617). That is not universal: local linking already reads the saved credential (cmd/october-bus/admin_operations.go:143). No compatibility framework or migration was added. Retiring the environment route can be considered separately. -
Inherited agent authority is handled differently from local-scope mode.
cmd/october-bus/main.go:917rejects an inherited agent token with--scope; the file and descriptor branches do not, mirroring the environment route.main.go:987replaces that token in the child's environment. No new credential-selection defect was found here. -
Remote-bridge validation is stricter, but replacement protection is platform-dependent.
cmd/october-bus/remote_scope.go:23shares the bounded reader and canonical validator atcmd/october-bus/mcp_connection.go:85. Minted scope credentials already satisfy it (bus/store.go:152,bus/store.go:208,bus/scope_admin.go:34). The comparison atscope_token.go:58catches replacement between inspection and opening on Unix; it does not freeze file contents during reading. On Windows, Go 1.27's ordinaryLstatfast path saves the pathname and loads the file identity only whenSameFileruns (os/stat_windows.go:34-47,os/types_windows.go:287,os/types_windows.go:353), so a swap between inspection and opening is not detected there. This does not undo the environment-disclosure improvement or regress the previous Windows reader; trusted storage remains necessary. -
Tests are substantial but not exhaustive. Besides the blocking CLI gap, there is no explicit successful EOF-without-newline descriptor case, Windows CLI descriptor-rejection test, or deterministic replacement-race test (
cmd/october-bus/scope_token_test.go:50,scope_token_unix_test.go:132). None independently blocks the change. -
The launch-record test reports early failures slowly.
cmd/october-bus/scope_token_launch_test.go:93polls until registration or the 30-second deadline without checking whether the wrapper has exited, then reports stderr atscope_token_launch_test.go:103. The control launch skips the test when the OS refuses the launch-record probe (scope_token_launch_test.go:108). This is a diagnostics limitation.
Fix plan
The implementation and test edits below are unchanged since turn 3; the expected results and validation instructions were corrected in turn 4 and verified in turn 5. Approximately 15 changed lines, comfortably below 50. maintainerCanModify is confirmed true; no edits were applied during the audit.
-
cmd/october-bus/main.go— insert after theflags.Parseerror check, beforecommandArgs := flags.Args():// flag.Visit tells an explicit --scope-token-fd apart from its default, so // an invalid number such as -1 is refused rather than silently routed to // another credential source. scopeTokenFDSet := false flags.Visit(func(value *flag.Flag) { scopeTokenFDSet = scopeTokenFDSet || value.Name == "scope-token-fd" })
Replace the three presence checks:
- At line 904, use
[]bool{*localScope != "", *scopeTokenFile != "", scopeTokenFDSet}. - At line 912, use
if (*scopeTokenFile != "" || scopeTokenFDSet) && scopeToken != "" {. - At line 931, use
case scopeTokenFDSet:.
Leave the flag default and
readScopeTokenFDunchanged. The reader continues to enforce platform and range restrictions; source conflicts still fail before any descriptor is touched. - At line 904, use
-
cmd/october-bus/scope_token_test.go, inTestAgentRunReadsScopeTokenFromPrivateFile:After the mixed file/local-scope assertion at line 112, add:
err = runAgent(args("--scope-token-file", path, "--scope-token-fd=-1")) require(t, err != nil && strings.Contains(err.Error(), "use only one of"), "an explicit --scope-token-fd=-1 was ignored beside a file: %v", err)
After the environment-conflict assertion at line 115, while the environment token remains set (line 116 clears it), add:
err = runAgent(args("--scope-token-fd=-1")) require(t, err != nil && strings.Contains(err.Error(), "unset OCTOBER_BUS_SCOPE_TOKEN"), "an explicit --scope-token-fd=-1 fell back to the environment token: %v", err)
-
cmd/october-bus/scope_token_unix_test.go, append these rows to the table inTestAgentRunRefusesMixedScopeTokenSources(after line 114):{args: []string{"--scope-token-fd", "-1"}, want: "3 or more"}, {args: []string{"--scope-token-fd", "0"}, want: "3 or more"},The preceding rows clear their environment variables at line 123. After the fix, both new cases reach the reader and return before
os.NewFile, preserving stdin and the existing test pipe, so the final "descriptor unread" assertion at lines 127-129 still holds. -
Validate the correct before/after behavior:
Added case Original head, when reached After the fix Valid file plus --scope-token-fd=-1Uses the file and performs the normal launch; no mixed-source error “use only one of” Exported token plus --scope-token-fd=-1Uses the environment token and performs the normal launch; no environment-conflict error “unset OCTOBER_BUS_SCOPE_TOKEN” --scope-token-fd -1, no other sourceMissing-source error “3 or more” --scope-token-fd 0, no other sourceAlready returns “3 or more” Still returns “3 or more” The three
-1cases are regression assertions; the0case preserves existing behavior. With the tests added before the implementation change, the two affected test functions should fail on their first new-1assertion.requirecallst.Fatalf(cmd/october-bus/assert_test.go:12-17), so later assertions are not all observable in that run. After the implementation change, both test functions should pass, including all four new checks. Do not require four pre-fix failures: the descriptor-0 assertion already passes on the original head.
Message to the developer
Please apply the fix plan above.
n/a
Questions for Harsh
n/a
Verification
- Static review only throughout the audit. No contributor code, installs, tests, builds, vet commands or repository scripts were executed. No GitHub mutations or checkout modifications were made.
- Repository state: HEAD
8e6f2f7c1e14cf9f5144e435315a57e1174ced8e, clean working tree, cleangit diff --check. The complete ten-file diff and surrounding implementation were reviewed in turns 1 and 2; later turns concentrated on the proposed edits, test fixtures and disputed claims. - PR context:
gh pr view --jsonconfirmed unchanged head, empty discussion comments and status rollup,REVIEW_REQUIRED,maintainerCanModify: true,isCrossRepository: true, and the Copilot quota notice. Workflow run39414106980reads "This workflow is awaiting approval from a maintainer in #155", status "Action required" (checked by both auditors). - Source-selection fix: Re-read
main.go:872-960, the reader, both affected test functions (scope_token_test.go:100-122,scope_token_unix_test.go:97-130) and theflags.Visitprecedent atcmd/october-bus-conformance/main.go:73-78. The proposed boolean accumulates presence correctly and replaces all three sentinel comparisons; every existing test that passes a real descriptor still counts as set. - Flag semantics: Go 1.27
src/flag/flag.go: integer parsing at line 163, explicit-flag enumeration (Visit) at line 470, next-argument consumption regardless of a leading dash at lines 1130-1134, and recording at line 1145. Both=-1and space-separated-1are parsed and recorded as supplied flags. - Before/after test predictions (turn 5 re-check): descriptor
0already satisfies0 != -1atmain.go:931, reachesreadScopeTokenFDand is rejected atscope_token.go:82-84. The file and environment fixtures provide a valid address and credential, so their pre-fix-1paths register and launch normally (the fixture at line 112 runs before the environment token is set at line 113). The standalone-1case hitsmain.go:937-938before address resolution. Static control-flow conclusions, not executed reproductions. - Descriptor handling: 129-byte
io.LimitReaderunderbufio.Reader.ReadSlice('\n')returns data plusio.EOFwithout a delimiter and can never hitErrBufferFull; a 129-byte line is rejected; the descriptor is closed bydeferon every path beforeexec.Cmd.Start.os.NewFile,ReadSliceandexec.Cmd.ExtraFilesbehaviour confirmed on pkg.go.dev; the test clears close-on-exec atscope_token_unix_test.go:41-43, making the closure check meaningful. - File handling: Lstat, private-mode check, open, fstat,
os.SameFile, re-check, bounded read, canonical parse, same shape asmcp_connection.go:102-119; error strings for the permission and malformed cases unchanged. Go 1.27 WindowsLstat/SameFileimplementation inspected (os/stat_windows.go:34-47,os/types_windows.go:287,os/types_windows.go:353); replacement detection before open is effectively Unix-only. - Library APIs and token shape: pkg.go.dev for
golang.org/x/sys@v0.49.0/unix(darwin) confirmsSysctlRaw(name string, args ...int) ([]byte, error),FcntlInt(fd uintptr, cmd, arg int) (int, error)andF_SETFD;golang.org/x/sysis already a direct dependency. Scope creation and rotation mintrandomValue(32)credentials (32 random bytes, unpadded base64url, 43 chars); the test token atscope_token_unix_test.go:133is canonical. - Tests: imports used, no shadowing errors, the
os.Exithelper-process pattern matchesmain_test.go:24-40andhook_test.go:312-314, child audits report presence by SHA-256 digest only, and the launch-record control proves the probe reads something before asserting absence. Linux/proc/<pid>/environis the initial environment behind a ptrace permission check, satisfied by the parent-of-child relationship under the default Yama scope; the test skips otherwise. - Required final checks: apply the listed tests and implementation change, verify the before/after behavior in the fix-plan table, then approve and run the configured CI workflow on the revised head. Require the Linux, macOS and Windows runtime checks and the ubuntu race run to pass. Contributor-reported results remain independently unverified.
Audit log
- Turn 1 (Claude (fable, xhigh)): Read PR body, issue #154, full diff and surrounding code; verified x/sys, bufio, os and exec APIs on pkg.go.dev; checked token minting shape; found no blocking issues; recorded seven non-blocking notes (CI not run on fork PR, env route kept, help-text nit, no fd timeout, agent-token consistency nit, stricter remote validation, slow test failure mode). Decision: merge.
- Turn 2 (Codex (gpt-6-astra, xhigh)): Independently reviewed the full diff, surrounding credential and session code, tests, PR context and library behavior. Found that explicit
--scope-token-fd=-1bypasses source selection and can silently use environment authority; changed the decision to fix with a small presence-tracking change and regression tests. Qualified Windows privacy, CI-gate assumptions, replacement protection and test-coverage claims. No contributor code executed. - Turn 3 (Claude (fable, xhigh)): Re-verified the blocking finding against
main.go:904/912/931and Go 1.27flag.go:1130-1134, 1145, 470-474(both--scope-token-fd -1and=-1parse and count as set forVisit); confirmed theVisitprecedent atcmd/october-bus-conformance/main.go:73-78and that maintainers can push to the fork branch; agreed with fix and rewrote the fix plan as exact edits (about 12 lines, four new assertions); refined the blocking impact wording (launcher's own token, misconfiguration hidden, not escalation); updated the CI note with the checks-page evidence; added the--scope-token-file=convention note; corrected two launch-test line references. - Turn 4 (Codex (gpt-6-astra, xhigh)): Verified the exact implementation and test edits; retained the blocking finding and fix decision. Corrected the fix plan's validation requirements: descriptor 0 already passes, the file/environment
-1cases launch normally before the fix, and fatal assertions prevent observing every case in one failing run. Confirmed workflow approval is pending; qualified Windows replacement protection and corrected unsupported claims about accidental empty paths and universal environment-token use. No contributor code executed. - Turn 5 (Claude (fable, xhigh)): Verified every turn-4 correction: the before/after table against
main.go:904-938and the fixtures atscope_token_test.go:111-116;requireast.Fatalfatassert_test.go:12-17; WindowsLstat/SameFilelazy file-ID loading in Go 1.27 source; workflow run 39414106980 awaiting maintainer approval;linkusing the saved local credential atadmin_operations.go:143. Accepted all of them; no changes to the decision, blocking finding or fix plan; tightened wording in the CI, empty-path and Windows notes and the fix-plan line references.
Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.
Carry the scope-token file/descriptor launch path across the october-bus -> agentintercom rename, including the review fix that tracks --scope-token-fd presence with flag.Visit so an explicit invalid value is refused instead of silently falling back to another credential source.
|
Applied the review fix on this branch: agent run now tracks --scope-token-fd presence with flag.Visit, so an explicit invalid value like -1 is refused instead of silently falling back to another credential source, with four new regression assertions (verified they fail without the fix). Also merged current main across the october-bus to agentintercom rename, carrying the file/descriptor launch path, its tests, and the docs additions forward. gofmt, go vet, and the full cmd/agentintercom race suite pass on the merged tree. Ready for re-review; CI still needs a maintainer approval run for this fork. |
Resolved: the audit of b8368ea found the requested changes in place.
🤖 Agentbox PR audit: ready to mergeWhat this PR changes
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 2 turns, commit b8368ea)PR audit: #155 — feat(cli):
|
harshsaver
left a comment
There was a problem hiding this comment.
Approved after the Claude x Codex audit agreed it is ready (audited head b8368ea, current; CI green).
harshsaver
left a comment
There was a problem hiding this comment.
Approved after the Claude×Codex audit agreed it is ready (audited head b8368ea; this head only adds a merge of main).
harshsaver
left a comment
There was a problem hiding this comment.
Approved after the Claude×Codex audit agreed it is ready (audited head b8368ea; this head only adds a merge of main).
Refs #154.
Summary
october-bus agent rungains two ways to receive the scope token without it ever being in the launcher's environment:--scope-token-fd <n>(Unix): reads the token from an inherited descriptor (3 or more, typically the read end of a pipe), up to the first newline or end of file. It closes the descriptor before the managed command starts.--scope-token-file <path>: reads the token once from an owner-only regular file. It uses the same checks as the existingmcp stdio --scope-token-file.--scope-token-envand the defaultOCTOBER_BUS_SCOPE_TOKENbehave exactly as before.Motivation
A launcher that holds a scope token today has two routes:
agent run --scope <id>. This requires local discovery and the protected scope cache, and it refuses--address.The environment is a poor place for a secret that lives as long as the agent:
agent runalready strips the variable from its child. But the operating system keeps reporting the environment the launcher was started with for the launcher's whole life:/proc/<pid>/environon Linux,KERN_PROCARGS2on macOS. Neither Go'sos.Unsetenvnor libc'sunsetenvchanges that record.KERN_PROCARGS2. No sandbox rule stops it for a same-user process with a readable record (measured).ps ewwoutput.October Bus already keeps tokens out of process arguments, and the threat model asks hosts not to place scope credentials where they spread. This closes the matching gap for the environment on the launcher that holds the most authority. The managed child receives only its execution-bound agent token, as before.
Threat
agent runprocess's launch record seesOCTOBER_BUS_SCOPE_TOKEN(or the--scope-token-envvariable) for as long as the agent runs. That is scope authority: it can register agents, link peers and resolve escalations.--scope-token-fdthe token is never in the launcher's environment, arguments or on disk. With--scope-token-fileit is in a private file the launcher's caller controls.Not addressed here, and unchanged:
Design
--scope,--scope-token-fileand--scope-token-fdare mutually exclusive.--scope-token-envvariable is set. That mirrors--scope's existing refusal of mixed authority, and it surfaces a token still being exported by mistake.--scope-token-fd--scope-token-filevalidExecutionTokencheck. The canonical check also refuses a value with a line break inside it, whichbase64.RawURLEncodingwould otherwise skip over.--address, thenOCTOBER_BUS_ADDRESS, then local discovery.--scope-token-env,OCTOBER_BUS_SCOPE_TOKENandOCTOBER_BUS_ADMIN_TOKENare still stripped, and the child still getsOCTOBER_BUS_ADDRESS,_MCP_URL,_AGENT_ID,_EXECUTION_IDand_AGENT_TOKEN.remoteScopeClient(mcp stdio --remote --scope-token-file) now uses the same reader asagent run, so the two cannot drift apart.Example, with nothing in the environment, arguments or on disk:
From a program: create a pipe, map its read end to descriptor 3 in the child, write the token and a newline, then close the write end.
Compatibility
--scope-token-env, its default and--scopebehave as before.use --scope <local-scope-id>, --scope-token-file, --scope-token-fd, or provide OCTOBER_BUS_SCOPE_TOKEN.mcp stdio --remote --scope-token-filegets two stricter checks: it refuses a token file swapped between the check and the open, and it refuses a non-canonical token, for example one with an embedded line break. Every token the runtime mints (randomValue(32)) is canonical, so valid files are unaffected.Tests
New tests:
cmd/october-bus/scope_token_test.go(all OSes)TestReadScopeTokenFileRequiresPrivateRegularFile: empty, malformed, embedded line break, oversized, missing, a directory, group- or world-readable, and a symlink are all refused, and no error contains the token.TestAgentRunReadsScopeTokenFromPrivateFile: registers and retires through a file token. The managed child has no privileged variable and no variable containing the token (the child is given only its SHA-256). It refuses--scopetogether with a file, an exported token beside a file, and a shared file.cmd/october-bus/scope_token_unix_test.goTestAgentRunReadsScopeTokenFromDescriptor: registers and retires through a pipe token. The managed child did not inherit the descriptor (checked by device and inode, not just number), andagent runclosed its own copy.TestAgentRunRefusesMixedScopeTokenSources: covers every combination. A refused launch leaves the descriptor unread.TestReadScopeTokenFDBoundsAndCloses: descriptors 0 to 2 are refused and stdin stays open. Empty, malformed and oversized input is refused and the descriptor is closed. A newline-terminated token is returned without waiting for end of file.cmd/october-bus/scope_token_launch_test.go(Linux and macOS)TestAgentRunLaunchRecordHoldsNoDescriptorScopeTokenreads the real launch record of a separateagent runprocess, from/proc/<pid>/{cmdline,environ}orKERN_PROCARGS2, while its command runs. The control is an environment-launchedagent run, whose record does show the token, so the check is known to read something. The--scope-token-fdlaunch's record does not.Two small helpers read the launch record on each OS:
launch_record_darwin_test.goandlaunch_record_linux_test.go.Results on macOS 26 (arm64), Go 1.27.0, with every bus folder,
HOMEandTMPDIRredirected to a scratch directory:go vet ./...passes, and so doesGOOS=linuxandGOOS=windowsgo vet ./cmd/october-bus/.go test -race -count=1 ./...passes in all 10 packages;cmd/october-bustakes 67s.TestScopeTokenFDChild("inherited") andTestReadScopeTokenFDBoundsAndCloses("left open"). Leaking the token into the child under another variable name fails the child audit in both the file and descriptor tests.agent runrecord shows it. With--scope-token-fd 3it does not, the agent registers and retires, and the daemon stops cleanly.Docs
adapters/README.md: under "Existing managed launchers", a paragraph on the two flags.docs/threat-model.md: the credential-disclosure row, plus a paragraph on why the environment is a wider disclosure channel than it looks.Proposed release note
There is no CHANGELOG file, so this is a line for the next release notes:
Follow-up (not in this PR)
The execution token without the environment. The managed child still receives
OCTOBER_BUS_AGENT_TOKENin its environment, so its launch record exposes that execution's authority. The bridge can already read a managed connection file (mcp stdio --connection-file,OCTOBER_BUS_CONNECTION_FILE).An opt-in
agent run --connection-dir <private-dir>could:endpoint,scopeId,agentId,executionId,agentToken,expiresAt) into an owner-only directory;OCTOBER_BUS_CONNECTION_FILEinstead ofOCTOBER_BUS_ADDRESSandOCTOBER_BUS_AGENT_TOKEN;expiresAton each heartbeat;It changes what the child sees, which matters to children that read
OCTOBER_BUS_AGENT_TOKENdirectly or runmessage receipt, so it deserves an issue first.🤖 Generated with Claude Code
https://claude.ai/code/session_015f6iGxVJzudUSNWEjQvemb