Skip to content

fix: scrub provider credentials from child command env - #5692

Open
FOWEPJF255 wants to merge 1 commit into
Aider-AI:mainfrom
FOWEPJF255:fix/scrub-provider-env-5658
Open

fix: scrub provider credentials from child command env#5692
FOWEPJF255 wants to merge 1 commit into
Aider-AI:mainfrom
FOWEPJF255:fix/scrub-provider-env-5658

Conversation

@FOWEPJF255

Copy link
Copy Markdown

Summary

  • Add child_process_environ() that copies the process environment and drops common model-provider credential keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, AWS secret keys, etc.).
  • Pass the scrubbed env into run_cmd_subprocess / run_cmd_pexpect and /git.
  • Unit tests for scrubbing and a presence-only subprocess check that the child does not see OPENAI_API_KEY.

Addresses #5658.

Test plan

  • pytest tests/basic/test_run_cmd.py (3 passed locally)
  • Maintainer CI
  • Optional: start aider with OPENAI_API_KEY=aider-provider-sentinel and /run a presence check as described in the issue

Avoid leaking OPENAI_API_KEY and other provider secrets into /run,
/test, lint, and /git subprocesses (Aider-AI#5658).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant