Enable network policy callbacks for remote exec (#35652)

## What changed

- Forward remote managed-network policy requests to the controller-side decider when Guardian review is enabled.
- Bound callbacks using the configured permission-hook and Guardian review timeouts, restore trusted execution attribution, and recheck live baseline policy before requesting a decision.
- Cancel pending decisions when the process or execution scope ends, and propagate EOF across the sandbox proxy bridge with half-closes.

## Testing

- Cover callback enablement, strict allowlist behavior, live policy updates, trusted attribution, and execution-scope cancellation.

GitOrigin-RevId: 83b47657c8c4546dfe98eec8b272833e96a46b7e
This commit is contained in:
viyatb-oai
2026-07-27 18:07:31 +00:00
committed by copyberry
parent 976129f097
commit 462ed19a05
13 changed files with 398 additions and 52 deletions
@@ -4,6 +4,8 @@ pub(super) struct ExecutionScope {
pub(super) environment_id: String,
pub(super) execution_id: String,
pub(super) attribution_token: String,
// Dropping the execution scope closes this channel and cancels remote reviews.
pub(super) lifetime_tx: tokio::sync::watch::Sender<()>,
state: Arc<NetworkProxyState>,
}
@@ -28,11 +30,13 @@ impl NetworkProxy {
self.state
.register_execution(&attribution_token, environment_id, execution_id);
let (lifetime_tx, _) = tokio::sync::watch::channel(());
let mut proxy = self.clone();
proxy.execution_scope = Some(Arc::new(ExecutionScope {
environment_id: environment_id.to_string(),
execution_id: execution_id.to_string(),
attribution_token,
lifetime_tx,
state: Arc::clone(&self.state),
}));
Ok(proxy)