Add network policy metadata to environment configuration (#39055)

## What changed

- Add `EnvironmentNetworkPolicy` as a serializable view of portable domain,
  Unix-socket, upstream-proxy, and local-binding restrictions without exposing
  controller-owned proxy runtime settings.
- Add an optional `network_policy` field to `EnvironmentConfig` and re-export
  the policy and related permission types through the core APIs.
- Reject owner-provided network policies during environment preview and
  readiness until runtime enforcement is implemented, while preserving the
  existing controller policy when the field is absent.

## Testing

- Cover rejection through both environment preview and readiness, including
  preservation of the existing environment selection.

GitOrigin-RevId: 80ad4cf4d4a45632daa7a823e6cf568eb0e8bb80
This commit is contained in:
sayan-oai
2026-08-17 18:57:32 +00:00
committed by copyberry
parent fe5889928c
commit 4a7b51c560
21 changed files with 144 additions and 0 deletions

View File

@@ -28,9 +28,15 @@ pub use codex_config::types::UriBasedFileOpener;
pub use codex_core::CodexAppsToolsCache;
pub use codex_core::CodexThread;
pub use codex_core::EnvironmentConfig;
pub use codex_core::EnvironmentNetworkPolicy;
pub use codex_core::ForkSnapshot;
pub use codex_core::LoadedAgentsMd;
pub use codex_core::McpManager;
pub use codex_core::NetworkDomainPermission;
pub use codex_core::NetworkDomainPermissionEntry;
pub use codex_core::NetworkDomainPermissions;
pub use codex_core::NetworkUnixSocketPermission;
pub use codex_core::NetworkUnixSocketPermissions;
pub use codex_core::NewThread;
pub use codex_core::NotSubmittedReason;
pub use codex_core::RecoverTurnRequest;
@@ -51,6 +57,7 @@ pub use codex_core::config::Constrained;
pub use codex_core::config::ExtraConfig;
pub use codex_core::config::GhostSnapshotConfig;
pub use codex_core::config::MultiAgentV2Config;
pub use codex_core::config::NetworkProxySpec;
pub use codex_core::config::Permissions;
pub use codex_core::config::TerminalResizeReflowConfig;
pub use codex_core::config::ThreadStoreConfig;