feat: Add support for environment protection (scrubbing) (#327)

* feat: Add support for environment variable protection for sandbox

* chore: Update dangerous env var list

* fix: Split profiles for improved environment protection

* fix: pipx sandbox profile separation

* chore: Show sandbox scrub info on error exit

* fix: Code review fixes

* test: Add e2e for sandbox environment scrubbing
This commit is contained in:
Abhisek Datta
2026-06-11 11:40:33 +05:30
committed by GitHub
parent 7620097613
commit c7244f921a
39 changed files with 1385 additions and 49 deletions
+15 -11
View File
@@ -111,14 +111,16 @@ sandbox:
# Per-package-manager sandbox policies
# Each package manager can have its own policy to account for unique security characteristics
policies:
# npm ecosystem. npm-restrictive is a built-in profile.
# npm ecosystem. npm-restrictive is the shared base profile; each package
# manager maps to a leaf profile that re-allows only its own environment
# variables.
npm:
enabled: true
profile: npm-restrictive # Built-in profile, template name, or path to custom YAML
profile: npm # Built-in profile, template name, or path to custom YAML
pnpm:
enabled: true
profile: pnpm-restrictive
profile: pnpm
npx:
enabled: true
@@ -130,32 +132,34 @@ sandbox:
yarn:
enabled: true
profile: npm-restrictive
profile: yarn
bun:
enabled: true
profile: npm-restrictive
profile: bun
# PyPI ecosystem. pypi-restrictive is a built-in profile.
# PyPI ecosystem. pypi-restrictive is the shared base profile; each
# package manager maps to a leaf profile that re-allows only its own
# environment variables.
pip:
enabled: true
profile: pypi-restrictive
profile: pip
pip3:
enabled: true
profile: pypi-restrictive
profile: pip
pipx:
enabled: true
profile: pypi-restrictive
profile: pipx
poetry:
enabled: true
profile: pypi-restrictive
profile: poetry
uv:
enabled: true
profile: pypi-restrictive
profile: uv
# Dependency cooldown blocks installation of package versions published within
# a configurable time window.