Preserve provider filtering when Modal networking is disabled - #2585
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This one-file fix changes execution-time network policy so Modal rollouts with networking disabled also filter provider-side web and resource capabilities. Because it alters a production access-control boundary, human review is warranted despite the narrow scope. You can add or adjust custom eligibility rules. Learn more. |
snimu
approved these changes
Sep 11, 2026
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.
Keep provider-side network filtering enabled when a Modal runtime is configured with
network_access=false.Prioritize Modal's disabled-network setting when selecting the rollout's interception policy. This maps it to a framework-only policy, so hosted web search and remote resource fetching remain filtered. Other configurations continue to use their existing allow/block policies.
Follow-up to #2579.
Note
Medium Risk
Changes execution-time network policy for Modal rollouts and affects egress filtering behavior, though the change narrows access when networking is explicitly disabled.
Overview
Fixes rollout interception when Modal has networking disabled.
ModalConfigis aNetworkPolicyConfig, so the previousisinstance(runtime_config, NetworkPolicyConfig)branch reused the Modal config as the session policy and kept the defaultallow=["*"]even whennetwork_access=false, while the sandbox blocked egress.Rollout session policy selection now checks Modal first:
network_access=falsebecomesNetworkPolicyConfig(allow=[])so hosted web search and remote fetches stay filtered at the framework layer. ExplicitNetworkPolicyConfigvalues are unchanged; other runtime configs still fall back toNetworkPolicyConfig().Reviewed by Cursor Bugbot for commit a366f87. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve provider filtering in
Rollout.__init__when Modal networking is disabledChanges the session network policy construction in rollout.py. The no-network
ModalConfigcase still creates an empty allow-list policy, existingNetworkPolicyConfiginstances pass through unchanged, and all other cases now rely onNetworkPolicyConfigconstructor defaults instead of an explicit wildcard allow-list.RolloutSessionnow receives a policy based onNetworkPolicyConfigconstructor defaults for cases not already aNetworkPolicyConfiginstance (including network-enabledModalConfigvalues); the exact default values are not visible in this diff and may differ from the previous wildcard behavior.Macroscope summarized a366f87.