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
+10
View File
@@ -3,6 +3,7 @@ description: Restrictive sandbox policy for PyPI ecosystem (pip, poetry, uv)
package_managers:
- pip
- pip3
- pipx
- poetry
- uv
@@ -71,6 +72,15 @@ network:
deny_outbound:
- "*:*"
environment:
# This profile is the shared base for the PyPI ecosystem and deliberately
# allows no environment variables: everything in the built-in
# DANGEROUS_ENV_VARS list is scrubbed. Each package manager's leaf profile
# (pip, uv, poetry) re-allows only the variables that package manager needs.
# TWINE_* is allowed nowhere: twine is not a package manager PMG wraps, so
# its publishing credentials stay scrubbed during installs.
allow: []
process:
allow_exec:
- /usr/bin/python*