Handle exec-server network policy requests in the client (#35359)

## What changed

- Add client-side handling for exec-server network policy requests, including request validation, per-process decision routing, and allow, deny, or ask responses.
- Bound concurrent callbacks and fail closed when requests are invalid, exceed capacity, time out, or outlive their process session.
- Replace the callback opt-in flag with a launch-level `policyDecisionTimeoutMs` value and include transport overhead in the executor timeout.
- Preserve callback admission limits across connection recovery and clean up policy state when process startup is abandoned or a session ends.

## Testing

- Cover decision forwarding, invalid and excess requests, cancellation during process cleanup, abandoned starts, timeout propagation, and launch-config serialization.

GitOrigin-RevId: 6ee2a0139e0f8170cf1a5cdd646bd811b7d3c1f6
This commit is contained in:
viyatb-oai authored and copyberry committed 2026-07-25 16:03:00 +00:00
1 parent 4c43465133
commit 3a08af44b2
12 files changed
+745 -54

No files matched your search

+4 -4
View File
@@ -24,6 +24,9 @@ pub struct RemoteNetworkProxyLaunchConfig {
pub environment_id: Option<String>,
#[serde(default)]
pub execution_id: Option<String>,
/// Controller-side policy decision budget. The executor adds transport overhead.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub policy_decision_timeout_ms: Option<u64>,
}
impl RemoteNetworkProxyLaunchConfig {
@@ -33,6 +36,7 @@ impl RemoteNetworkProxyLaunchConfig {
audit_metadata: NetworkProxyAuditMetadata::default(),
environment_id: None,
execution_id: None,
policy_decision_timeout_ms: None,
}
}
@@ -66,9 +70,6 @@ pub struct RemoteNetworkProxyConfig {
pub domains: Option<NetworkDomainPermissions>,
pub unix_sockets: Option<NetworkUnixSocketPermissions>,
pub allow_local_binding: bool,
/// Whether the executor sends domain policy decisions back to the client.
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub request_policy_decisions: bool,
}
impl RemoteNetworkProxyConfig {
@@ -91,7 +92,6 @@ impl RemoteNetworkProxyConfig {
domains: config.domains.clone(),
unix_sockets: config.unix_sockets.clone(),
allow_local_binding: config.allow_local_binding,
request_policy_decisions: false,
})
}