Repository navigation
Keep generic CLI provider keys out of research sandboxes - #65
Merged
Merged
Conversation
The non-sealed cli research launch spread the whole host environment into bwrap, so any inherited provider key was readable from the agent's shell and /proc environ. - Add an optional researchProvider binding to cli.json; the host relay keeps the real key and the sandbox gets a disposable capability plus a relay /v1 base. Client paths are forwarded relative to the configured base. - Strip secret-named inherited variables, sealedRole keys and copies of the key; fail closed (math_cli_provider_relay_unsupported) for any other inherited credential that has a value. - Require web cli providers to declare a matching researchProvider. - Bind the Qwen and Aider presets; Aider no longer inherits ANTHROPIC_API_KEY. Gemini fails closed when GEMINI_API_KEY is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to #64. The generic
cliresearch harness (non-sealed path) passed the whole host environment into bwrap. Any key listed ininheritEnvironmentwas readable from the agent shell and/proc/$PPID/environ, and the sandbox has network access.Change
cli.jsongains an optionalresearchProvider: { wireApi, apiKeyEnvironment, baseUrlEnvironment }. Both names must be inherited, distinct and not set inenvironment(math_cli_research_provider_binding_invalid).prepareCliResearchRelaystarts a loopback relay that holds the key. The sandbox gets a 64-hex capability andhttp://127.0.0.1:<port>/v1; client paths are forwarded relative to the configured base (default OpenAI / Anthropic base per wire API).math_cli_provider_relay_unsupported. The launch asserts no arg or env value contains the key.researchProvidermatching their key/base environment (config validation andweb_cli_research_provider_unbound).ANTHROPIC_API_KEY.Behavior changes
GEMINI_API_KEYis set (no Gemini wire API in the relay)./procenviron, profile-stored logins, literal keys incli.json/configurationFiles.Verification
tsc --noEmitandbun run buildpass.envand/proc/$PPID/environinside the sandbox: this branchkey_in_sandbox=no, unbound config rejected; main 1742637key_in_sandbox=yes.🤖 Generated with Claude Code