Skip to content

[Feature Request] Scrub ambient sensitive credentials from run_shell child environment #618

Description

@cagdasyurekli

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

  1. 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"]
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions