Severity: High
Evidence:
scripts/setup.py:46-51 uses input() for prompts, so values typed for secret prompts are echoed by the terminal.
scripts/setup.py:178-186 asks for OPENAI_API_KEY, ANTHROPIC_API_KEY, and GEMINI_API_KEY values through that echoed prompt path.
scripts/setup.py:60-89 writes KEY=value to .env, then prints the full Set {key}={value} string on stdout.
.env.example:33-39 documents those values as API keys.
Reproduction:
- Run
python3 scripts/setup.py.
- Choose provider
openai, anthropic, or gemini.
- Enter any token-like value, for example
sk-test-redacted.
- Observe that the value is visible while typing and then printed again as
Set OPENAI_API_KEY=sk-test-redacted.
Impact:
API keys are exposed in terminal scrollback, shell/session recording, CI logs if setup is scripted, and AI-agent transcripts. This is especially risky for a repo designed to be operated by coding agents.
Smallest credible fix:
- Use
getpass.getpass() for secret prompts.
- Treat keys matching
*_API_KEY, *_TOKEN, *_PASSWORD, and similar names as sensitive in _patch_env() and print only a masked confirmation such as Set OPENAI_API_KEY=<redacted>.
- Avoid echoing existing secret values during reconfiguration.
- Add a small test around
_patch_env() output redaction for sensitive keys.
Severity: High
Evidence:
scripts/setup.py:46-51usesinput()for prompts, so values typed for secret prompts are echoed by the terminal.scripts/setup.py:178-186asks forOPENAI_API_KEY,ANTHROPIC_API_KEY, andGEMINI_API_KEYvalues through that echoed prompt path.scripts/setup.py:60-89writesKEY=valueto.env, then prints the fullSet {key}={value}string on stdout..env.example:33-39documents those values as API keys.Reproduction:
python3 scripts/setup.py.openai,anthropic, orgemini.sk-test-redacted.Set OPENAI_API_KEY=sk-test-redacted.Impact:
API keys are exposed in terminal scrollback, shell/session recording, CI logs if setup is scripted, and AI-agent transcripts. This is especially risky for a repo designed to be operated by coding agents.
Smallest credible fix:
getpass.getpass()for secret prompts.*_API_KEY,*_TOKEN,*_PASSWORD, and similar names as sensitive in_patch_env()and print only a masked confirmation such asSet OPENAI_API_KEY=<redacted>._patch_env()output redaction for sensitive keys.