Repository navigation
0.1.2: hide the provider API key from the agent's shell - #3
Merged
Merged
Conversation
buildShellEnv copied process.env and the settings env into every bash call, so DEEPCODE_API_KEY (and the prefix-stripped API_KEY) were visible to the model. Anything it printed ended up in tool output, the JSON result and orchestrator logs. Strip them (vendor patch scrub-api-key). Also make the timeout test poll for the killed child instead of racing it. Co-Authored-By: Claude Sonnet 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.
The bash tool spawned its shell with
process.envplus the settings env, soDEEPCODE_API_KEY(and the prefix-strippedAPI_KEY) were visible to the model. Verified on the real API before the change:env | grep -c DEEPCODE_API_KEYrun by the agent returned 1. Anything it printed lands in tool output, the JSON result and orchestrator logs.scrub-api-key.patch:buildShellEnvdropsDEEPCODE_API_KEY,DEEPCODE_PLUS_API_KEYand the strippedAPI_KEY/PLUS_API_KEY. Other variables, including the user's own*_API_KEY, pass through.v0.1.2publishes through Trusted Publishing.This does not stop an agent with file access from reading
~/.config/tencent-dev/deepseek.env; for untrusted content keep using a container without the token.🤖 Generated with Claude Code