Problem
OpenCode's shell tool inherits the user's full environment, including API keys, tokens, and credentials. These can be accidentally leaked in logs, tool outputs, or error messages.
Proposed Solution
Add an optional shellAudit() function that detects and redacts 8 types of credential patterns from the shell environment before execution.
Evidence
- Implementation: ~40 lines TypeScript
- Tests: 6 cases covering all 8 patterns + 2 edge cases
- Zero breaking changes, zero new dependencies
- Tested on dev branch
Checklist
Problem
OpenCode's shell tool inherits the user's full environment, including API keys, tokens, and credentials. These can be accidentally leaked in logs, tool outputs, or error messages.
Proposed Solution
Add an optional
shellAudit()function that detects and redacts 8 types of credential patterns from the shell environment before execution.Evidence
Checklist