Enforce AWF domain policy on Codex hosted web search - #8945
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical image-packaging and URL-policy bypass issues remain, along with request-validation and schema inconsistencies.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Adds config-driven Codex hosted-web policy enforcement for OpenAI Responses tools and /v1/alpha/search.
Changes:
- Adds shared policy configuration, normalization, schemas, and documentation.
- Enforces domain filters, URL hosts, access modes, and usage limits.
- Adds unit and proxy integration coverage.
| File | Description |
|---|---|
src/types/api-proxy-diagnostics-options.ts |
Adds Codex policy typing. |
src/services/api-proxy-env-config.ts |
Serializes normalized policy. |
src/hosted-web-policy.ts |
Provides shared policy validation. |
src/config-mapper.ts |
Maps Codex configuration. |
src/config-file.ts |
Adds Codex configuration shape. |
src/commands/build-config.ts |
Includes Codex policy in runtime configuration. |
src/codex-hosted-web-policy.ts |
Adds Codex normalization. |
src/codex-hosted-web-policy.test.ts |
Tests configuration and environment behavior. |
src/claude-hosted-web-policy.ts |
Uses shared normalization. |
src/awf-config-schema.json |
Adds runtime schema support. |
README.md |
Documents hosted-web policy support. |
docs/awf-config.schema.json |
Updates the published schema. |
docs/awf-config-spec.md |
Defines Codex policy behavior. |
docs/api-proxy-sidecar.md |
Documents sidecar enforcement. |
containers/api-proxy/server.models.test.js |
Tests transform context propagation. |
containers/api-proxy/proxy-utils.js |
Forwards context through transforms. |
containers/api-proxy/providers/openai.js |
Installs Codex enforcement. |
containers/api-proxy/hosted-web-policy.js |
Adds shared sidecar policy utilities. |
containers/api-proxy/codex-hosted-web.test.js |
Tests enforcement logic. |
containers/api-proxy/codex-hosted-web.server.test.js |
Tests proxy integration. |
containers/api-proxy/codex-hosted-web.js |
Implements Codex policy enforcement. |
containers/api-proxy/claude-hosted-web.js |
Uses shared sidecar utilities. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -1,5 +1,7 @@ | |||
| 'use strict'; | |||
|
|
|||
| const { isValidDomain, parseHostedWebPolicy } = require('./hosted-web-policy'); | |||
| } | ||
|
|
||
| function checkLiteralUrl(value, filters) { | ||
| if (typeof value !== 'string' || !value.includes('://')) return; |
| 'Codex standalone hosted search cannot enforce the configured maxUses limit.', | ||
| ); | ||
| } | ||
| if (!body || typeof body !== 'object' || Array.isArray(body)) { |
| ] | ||
| }, | ||
| "codex": { | ||
| "$ref": "#/properties/apiProxy/properties/hostedWeb/properties/claude", |
|
@copilot address review feedback |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit a432154 |
|
@copilot fix the build and lint ci check errors https://github.com/github/gh-aw-firewall/actions/runs/35945075766/job/107461593961?pr=8945 |
Fixed in the latest commit. The API-proxy test failure was caused by |
|
Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed. Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"
- "github.com"See Network Configuration for more information.
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
[!TIP] tools:
github:
mode: gh-proxySee GitHub Tools for more information on To allow these domains, add them to the network:
allowed:
- defaults
- "api.github.com"
- "example.com"See Network Configuration for more information.
|
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... Warning Firewall blocked 11 domainsThe following domains were blocked by the firewall during workflow execution:
[!TIP] tools:
github:
mode: gh-proxySee GitHub Tools for more information on To allow these domains, add them to the network:
allowed:
- defaults
- "accounts.google.com"
- "api.github.com"
- "clients2.google.com"
- "collector.github.com"
- "contentautofill.googleapis.com"
- "github.com"
- "github.githubassets.com"
- "msfeed25.pkgs.visualstudio.com"
- "update.googleapis.com"
- "www.google.com"
- "www.gstatic.com"See Network Configuration for more information.
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "o205451.ingest.us.sentry.io"See Network Configuration for more information.
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
❌ Security Guard failed. Please review the logs for details.
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
Smoke Test: Cloud Hypervisor + Copilot
Overall: PASS - firewall correctly allowed GitHub and blocked example.com. Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"
- "github.com"See Network Configuration for more information.
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable (HTTP 200) Overall: PASS Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
[!TIP] tools:
github:
mode: gh-proxySee GitHub Tools for more information on To allow these domains, add them to the network:
allowed:
- defaults
- "api.github.com"
- "example.com"See Network Configuration for more information.
|
smoke-copilot-byok: PASS ✅
Running in direct BYOK mode via api-proxy sidecar.
|
|
Smoke Test: Copilot Engine —
Overall: PASS
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
|
Services Connectivity Smoke Test
Overall: PASS
|
Gemini Engine Validation Smoke Test Results
Overall Status: PASS Warning Firewall blocked 2 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "github.com"
- "play.googleapis.com"See Network Configuration for more information.
|
Chroot Version Comparison Results
|
📡 Smoke Test Results: API Proxy OTel Tracing
Overall: all 5 scenarios pass. One minor finding: the workflow step "Run api-proxy OTEL tests" silently produces no real signal due to an outdated Jest CLI flag — worth updating to Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "o205451.ingest.us.sentry.io"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Note: Java's initial All other ecosystems (Bun, C++, Deno, .NET, Go, Node.js, Rust) built and passed on the first attempt with no errors. Warning Firewall blocked 8 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.nuget.org"
- "bun.sh"
- "dc.services.visualstudio.com"
- "deno.land"
- "dl.deno.land"
- "github.com"
- "releaseassets.githubusercontent.com"
- "repo.maven.apache.org"See Network Configuration for more information.
|


Codex hosted search runs outside AWF’s network boundary, bypassing Squid domain enforcement. This adds fail-closed policy enforcement for OpenAI Responses web-search tools and
/v1/alpha/search.Configuration
apiProxy.hostedWeb.codexcontract.Proxy enforcement
max_uses.Security
Documentation