Repository navigation
Apply env_policy and env_inject to the agent under macOS wrap - #95
Merged
Merged
Conversation
The macOS wrap-init reply carried neither env_policy nor env_inject, and the macOS client applied neither. The agent got the caller's environment unchanged. The reply now carries both, and the client filters the inherited environment and lays env_inject over it, as on Linux. max_bytes, max_keys and block_iteration stay out of the wrap path on every platform, as pkg/types.EnvPolicyWire records (issue #379). scripts/test-macos-wrap-env.sh is the hardware test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of SECENG-308, phase 3 of
docs/plans/2026-10-29-macos-enforcement-gaps.md.The macOS wrap-init reply carried no
env_policyand noenv_inject. The macOS client applied neither, so the agent got the caller's environment unchanged.What changed
wrap-initnow sendsEnvInjectandEnvPolicy, as Linux does.env_injectover it, in the same order as Linux.max_bytes,max_keysandblock_iterationstay out of the wrap path on every platform.pkg/types.EnvPolicyWirerecords why (issue #379). The plan named them, but this PR leaves that decision as it is.Verification
TestPlatformSetupWrapAppliesEnvPolicyAndInjectpasses. It fails on the oldwrap_darwin.gowith all three checks.go test -tags nofuse ./internal/api/ ./internal/cli/passes. Lint reports 0 issues.scripts/test-macos-wrap-env.shpasses 2/2 withsandbox.wrap_env_policy.enabled: true. On build 1683, it failed becauseBASH_ENVkept the caller's value.test-macos-pids-max.sh2/2,test-macos-wrap-python.sh3/3 andtest-macos-wrap-session-reuse.sh4/4 pass on 1684.🤖 Generated with Claude Code