Repository navigation
Pass a long-term Claude token to sandboxed Claude on a descriptor (#504) - #505
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Verified: c775c35 · repo-suite: ok relaye2e/features 504.474s · devboxverify: SUMMARY pass=5 fail=0 blocked=0 notrun=2 (stack r504, api) · real-app: two sandboxed claude-code |
|
Real-app check: Relay.app built from c775c35 with claude_token_file set; two sandboxed claude-code |
|
Weakening reviewed: t.Skip in TestClaudeTokenUnreadableFileRefused fires only when the process can open a mode-000 file (root); a mode-000 file cannot prove an unreadable refusal there; non-root runs, which every suite run is, always assert |
|
Merged: merge-check passed approved, target, verified (c775c35), contract, evidence, owner, weakening (reviewed); ci NA. |
Closes #504
Relay can now hand a Claude long-term OAuth token to the sandboxed Claude it starts, so those sessions start logged in with no
/loginand the token never rides in an environment block.claude_token_file(top level ofsettings.json, absolute or~/), empty by default. Empty: every launch is unchanged.AuthorizeLaunch) and sends the bytes to relay-sessions in the launch request'sclaude_tokenfield. relay-sessions writes them into a pipe, closes the write end, and the shim (--pass-token) hands the read end to Claude on fd 5, withCLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR=5set after the env scrub. fd 3 and 4 are the shim's identity and status pipes, so 5 is the first number free in every launch shape.claudesessions and sandboxedclaude-codeterminals. Unsandboxed and SSH host launches never get the token; relay-sessions refuses one there.shelltemplate grants~read-write.sandbox_unavailable; the message names the path, never the content.Claude token file: <path>when it is set.relay status --jsonalso carries the path (same view). No presence gate: the setting changes only by editingsettings.json.Limit: the Claude process that holds the token, and the tools it runs, can read it.
What you'll notice: with
claude_token_fileset, sandboxed Claude sessions start logged in; the post-#503/loginstep goes away.Docs:
docs/session-host.md,docs/routes.md,docs/FEATURES.mdrowG1.45,docs/THREAT-MODEL.md,docs/architecture.md,docs/testing.md.Roll back: revert this PR's merge commit. Sandboxed Claude then needs the
/loginagain.Fix attempts: 1 (plus one comment/doc round from review). Tokens: about 0.8M across subagents.
Run report: barelyworkingcode/claude-process#57
Review: no blocking findings (default model, round 1; three comment/doc minors fixed in c775c35)
Break-and-restore: dropped the token-path deny in sandboxSpecForLaunch; TestClaudeTokenFileDeniedToSession (g1_claude_token_fd_test.go:345) and TestClaudeTokenFileDeniedToShellTerminal (:380) went red with exit 0; restored byte for byte (scratch worktree discarded)
🤖 Generated with Claude Code