feat(tool-sandbox): caller-declared env pass-through via export_env - #1440
Conversation
PR Review SummarySize
Affected crates
Blast radius — BroadThis PR touches: source code,documentation,configuration / policy files Updated automatically on each push to this PR. |
7482491 to
4eacce8
Compare
2ce72de to
cea7072
Compare
cea7072 to
529c0b1
Compare
529c0b1 to
7687b6b
Compare
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
hey @kipz , just a couple of fix ups The new While there worth getting the validation to also reject patterns containing repeated trailing wildcards. For example, |
5bffc69 to
c1b327d
Compare
|
Makes sense @lukehinds - thanks! All done. |
…-through via export_env
cec9c39 to
4ce3c94
Compare
4ce3c94 to
8144357
Compare
8144357 to
ef281a9
Compare
ef281a9 to
a931f5d
Compare
a931f5d to
f9a77e8
Compare
…-through via export_env
f9a77e8 to
7c77d60
Compare
A command's `export_env` (or the top-level `session_export_env` when the resolved caller is the session) lists env vars the caller forwards verbatim to the commands it invokes, bypassing `allow_vars` and the dangerous-var blocklist. This is the escape hatch for tools that must pass an interpreter variable such as NODE_OPTIONS or PYTHONPATH to what they launch. Guardrails: `PATH` and `NONO_*` are never forwarded, 1Password credentials are never forwarded by any pattern, and `LD_*`/`DYLD_*` require an exact-name pattern so a bare `*` cannot preload code into a credential-bearing child. Patterns are exact names, a trailing-`*` prefix, or a bare `*`; multiple wildcards are rejected at validation rather than silently never matching. Signed-off-by: James Carnegie <me@kipz.org>
|
@lukehinds all three classes are now enforced, plus docs and the missing test coverage. Actual secrets — always excluded, not forwardable by any pattern. Loader injection — exact name only, as you suggested. Interpreter/shell-scoped — unchanged. Docs are in: Since your review I've also closed two coverage gaps a second review pass flagged:
On trimming: Posted by an agent on behalf of @kipz. |
Linked Issue
Closes #1439
Summary
Caller-declared env pass-through: per-command
export_env+ top-levelsession_export_env. A command's named vars are copied verbatim to commands it invokes, bypassingallow_varsfiltering and the dangerous-var blocklist. Patterns: exact,PREFIX_*,*.PATH/NONO_*always excluded.Agent Disclosure (if applicable)
Authored by an AI agent (code, tests, PR, issue). No
unwrap/expect/panicin new non-test code; covered by tests.Test Plan
make cipasses (clippy-D warnings, fmt, tests, doc lint).PREFIX_*and*matching;PATH/NONO_*excluded under*; reserved/malformed patterns rejected.session_export_envand a mediated command'sexport_enveach deliver a named var downstream that default filtering would drop.Checklist
CHANGELOG.mdif neededAgent Compliance Check (Required for AI/Automated PRs)