Skip to content

Preserve provider filtering when Modal networking is disabled - #2585

Merged
xeophon merged 1 commit into
mainfrom
fix/modal-provider-network-policy
Sep 11, 2026
Merged

Preserve provider filtering when Modal networking is disabled#2585
xeophon merged 1 commit into
mainfrom
fix/modal-provider-network-policy

Conversation

@xeophon

@xeophon xeophon commented Sep 11, 2026

Copy link
Copy Markdown
Member

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. ModalConfig is a NetworkPolicyConfig, so the previous isinstance(runtime_config, NetworkPolicyConfig) branch reused the Modal config as the session policy and kept the default allow=["*"] even when network_access=false, while the sandbox blocked egress.

Rollout session policy selection now checks Modal first: network_access=false becomes NetworkPolicyConfig(allow=[]) so hosted web search and remote fetches stay filtered at the framework layer. Explicit NetworkPolicyConfig values are unchanged; other runtime configs still fall back to NetworkPolicyConfig().

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 disabled

Changes the session network policy construction in rollout.py. The no-network ModalConfig case still creates an empty allow-list policy, existing NetworkPolicyConfig instances pass through unchanged, and all other cases now rely on NetworkPolicyConfig constructor defaults instead of an explicit wildcard allow-list.

  • Risk: RolloutSession now receives a policy based on NetworkPolicyConfig constructor defaults for cases not already a NetworkPolicyConfig instance (including network-enabled ModalConfig values); the exact default values are not visible in this diff and may differ from the previous wildcard behavior.

Macroscope summarized a366f87.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@macroscopeapp

macroscopeapp Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@xeophon
xeophon requested a review from snimu September 11, 2026 11:04
@xeophon
xeophon merged commit a32cc09 into main Sep 11, 2026
13 of 14 checks passed
@xeophon
xeophon deleted the fix/modal-provider-network-policy branch September 11, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants