Motivation
Currently, LocalExecutor (coworker/tools/shell.py) inherits the entire os.environ from the parent process. If a developer launches OpenWorker in a terminal session where cloud keys or personal access tokens are exported (AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN, *_API_KEY), any command executed by the agent (or a build script triggered in the workspace) inherits ambient access to those secrets.
Proposed Solution
- Introduce an environment variable filter in
coworker/tools/shell.py:
- By default, scrub known high-entropy and credential environment variable patterns (
AWS_*, *_API_KEY, *_SECRET_*, *_TOKEN) from the child shell process.
- Provide an explicit allowlist in
config.toml:
[shell]
allowed_env = ["AWS_PROFILE", "PATH"]
- Retain only essential system environment variables (
PATH, HOME, USER, SHELL, LANG, TERM, and standard Python venv variables).
Implementation Scope & Alignment
- Scope: ~60–80 lines in
coworker/tools/shell.py and coworker/config.py.
- Zero Breaking Changes: Transparent to standard developer workflows.
- Alignment: Directly reinforces OpenWorker's primary value proposition of defender-grade security.
Motivation
Currently,
LocalExecutor(coworker/tools/shell.py) inherits the entireos.environfrom the parent process. If a developer launches OpenWorker in a terminal session where cloud keys or personal access tokens are exported (AWS_SECRET_ACCESS_KEY,GITHUB_TOKEN,*_API_KEY), any command executed by the agent (or a build script triggered in the workspace) inherits ambient access to those secrets.Proposed Solution
coworker/tools/shell.py:AWS_*,*_API_KEY,*_SECRET_*,*_TOKEN) from the child shell process.config.toml:PATH,HOME,USER,SHELL,LANG,TERM, and standard Python venv variables).Implementation Scope & Alignment
coworker/tools/shell.pyandcoworker/config.py.