Repository navigation
Separate direct model API egress from engine transport bundles - #78465
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
💥 [THE END] — Illustrated by Smoke Claude · claude · sonnet46 · ~69 AIC · ⌖ ~8 AIC · ⊞ 1K
Comment /smoke-claude to run again
| @@ -450,12 +449,6 @@ func (e *ClaudeEngine) claudeAllowedDomains(data *WorkflowData) string { | |||
| if !data.CachedAllowedDomainsComputed { | |||
There was a problem hiding this comment.
The removal of the direct Anthropic API domain injection here centralizes domain configuration nicely. Consider adding a comment explaining that mergeAPITargetDomains now handles this case — it would help future readers understand why the explicit api.anthropic.com injection was removed.
| // CodexDefaultDomains retain gateway/GitHub transport and the concrete OpenAI API host. | ||
| // Optional authentication/telemetry hosts require an explicit codex-vendor opt-in. | ||
| // CodexDefaultDomains contain the gateway/GitHub transport baseline. Direct OpenAI API and | ||
| // optional authentication/telemetry hosts require an explicit `codex-vendor` opt-in. |
There was a problem hiding this comment.
Good simplification of the CopilotDefaultDomains comment — the new version is more concise. The key behavioral invariant (agents route through the AWF api-proxy) is preserved. The updated wording makes it clearer that vendor hosts are opt-in by default.
There was a problem hiding this comment.
🟡 Changes recommended
The change drops required Pi provider-domain metadata and leaves agent-facing network documentation inconsistent with the new bundle behavior.
2 open issues
What changed in this PR
This PR separates direct model-provider access from gateway/GitHub transport bundles in gh-aw’s firewall policy, addressing #78353.
Changes:
- Moves direct Copilot, OpenAI, and Gemini API hosts into explicit vendor opt-ins.
- Removes Claude’s implicit Anthropic API grant while preserving Codex detection transport.
- Updates network migration guidance and tests for transport-only and direct-access policies.
| File | Description |
|---|---|
pkg/workflow/pi_engine_config_test.go |
Tests Pi defaults and direct-provider opt-ins. |
pkg/workflow/http_mcp_domains_test.go |
Aligns MCP and Playwright assertions with transport-only bundles. |
pkg/workflow/domains.go |
Updates engine-domain resolution and vendor identifiers. |
pkg/workflow/domains_test.go |
Updates transport and explicit vendor-access assertions. |
pkg/workflow/domains_protocol_test.go |
Clarifies the Claude direct-access test comment. |
pkg/workflow/domains_package_registry_test.go |
Checks gateway retention and direct API exclusion. |
pkg/workflow/data/ecosystem_domains.json |
Separates vendor API hosts from engine transport sets. |
pkg/workflow/codex_engine.go |
Retains provider API transport for external detection. |
pkg/workflow/claude_engine.go |
Removes the implicit Anthropic API allowance. |
pkg/workflow/claude_engine_test.go |
Covers explicit Anthropic access and target handling. |
pkg/workflow/awf_config_test.go |
Checks emitted firewall policy retains gateway access without direct APIs. |
docs/src/content/docs/reference/network.md |
Documents revised bundles and direct-access migration. |
Review effort: Max (adaptive)
| } | ||
|
|
||
| return domains, nil | ||
| return copyEngineDefaultDomainSet(PiBaseDefaultDomains), nil |
| ## Engine Domain Sets | ||
|
|
||
| Engine domain sets are named allowlist bundles for engine CLI authentication and direct provider transport. They are **not** added automatically. Add the matching identifier to `network.allowed` only when the agent needs direct egress to that engine's domains; agent inference normally runs through the AWF API proxy. | ||
| Engine domain sets are named allowlist bundles for gateway/GitHub transport. They are **not** added automatically. Agent inference normally runs through the AWF API proxy, so direct provider API hosts are granted separately. Workflows that previously relied on an engine set for direct API egress must add the corresponding vendor set or literal domain to `network.allowed`. |
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Specification Reviewer completed successfully!
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
This comment has been minimized.
This comment has been minimized.
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
Reviewed the current diff and found no actionable correctness, performance, or maintainability issues on changed lines. The grumpy-coder specialist pass was unavailable because its file-read invocation was rejected; I completed an independent review of the capped diff and relevant source context. Existing review comments were considered to avoid duplication. No inline comments requested.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines in 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
There was a problem hiding this comment.
Reviewed PR head 3d1e132f19a8540fc1217c42cbe50d4638a9f49e against Security Architecture Specification v1.1.10, especially NI-01, NI-04, NI-06, NI-12, and the changed network reference.
Blocking findings (also deduplicated against existing review comments):
pkg/workflow/domains.goremoves Pi provider-domain metadata fromgetPiDefaultDomains, so provider-prefixed models no longer expose their provider endpoint metadata even when the corresponding vendor ecosystem is explicitly selected. Preserve the metadata/selection behavior independently from default firewall grants; direct egress must remain opt-in.- The changed
docs/src/content/docs/reference/network.mdnow documents the new vendor split, but.github/aw/network.mdremains stale: it still lists direct provider hosts incopilot,codex,gemini, andpi, describes implicit Anthropic access, and omitsgemini-vendor. Synchronize the author-facing contract or update the source used to generate it.
No specification synchronization proposal is eligible: the formal security specification does not define these provider-specific bundle memberships, and changing it would not resolve the implementation/documentation inconsistencies. Coverage was static only; no tests or conformance scripts were run per review policy.
Generated by PR Specification Reviewer for #78465 · copilot · gpt50 · ~5 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review-specs to run again
Comment MemoryPeek at saved memory (review-history)History |
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd, /codebase-design, and /grill-with-docs. Requesting changes: one test fails, and the Codex and Pi changes need reconciling with #78353.
📋 Key Themes and Findings
Blocking
- Failing test:
TestGeminiProxyTargetDoesNotGrantAgentEgress/gemini_opt-infails.pkg/workflow/awf_helpers_test.go:1309still expectsgeminito grantgenerativelanguage.googleapis.com(wantDirect: true). This PR removes that grant, so the case needswantDirect: falseor a move togemini-vendor. - Codex GitHub branch (
codex_engine.go:475): re-addsapi.githubcopilot.com, which contradicts the Copilot split. - Pi provider metadata (
domains.go:162): removingpi-provider-domainsgoes against #78353. Confirm the intent.
Should fix
- Misplaced doc comment (
awf_config_test.go:1742) now sits above the wrong test. - Stale docs:
.github/aw/network.md(lines 88-118) still lists the old vendor hosts and omitsgemini-vendor.docs/.../network.md:181says provider-scoped Pi models use the gateway, which the code no longer guarantees. - Stale reference:
.github/workflows/weekly-network-domains-audit.md:85,98still usespiProviderDomains. - Breaking change: users relying on
copilot,codex,gemini, orpifor direct egress need*-vendoropt-ins. There is no CHANGELOG entry or codemod. Compiled.lock.ymlfiles still carry the old hosts; runmake recompileafter the fixes.
Positive
- ✅ The Claude removal looks safe.
claude_harness.cjssetsANTHROPIC_BASE_URLfrom the AWF/reflectendpoint when the proxy is on. - ✅ Custom
ANTHROPIC_BASE_URLandengine.api-targetbehavior is preserved viamergeAPITargetDomains.
Scope: targeted tests only. I did not run the full pkg/workflow suite.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| // GitHub-hosted inference does not need direct OpenAI API access. | ||
| defaults = slices.DeleteFunc(defaults, func(domain string) bool { return domain == "api.openai.com" }) | ||
| defaults = append(defaults, CopilotDefaultDomains...) | ||
| defaults = append(defaults, "api.githubcopilot.com") |
There was a problem hiding this comment.
[/codebase-design] The GitHub branch re-adds api.githubcopilot.com after CopilotDefaultDomains, which this PR removes from the Copilot transport set. That reintroduces direct GitHub inference egress for Codex with no opt-in, and the diff does not explain why.
💡 Suggested fix
Either drop the extra append so Codex matches the Copilot split, or add a comment and a test explaining why Codex needs this host. Keep the transport baseline and the direct-API opt-in separate.
@copilot please address this.
| // getPiDefaultDomains returns Pi's gateway/GitHub transport baseline. Provider API | ||
| // domains are not added because model inference uses the AWF LLM gateway. | ||
| // Returns an error if the model string is malformed (e.g. a leading slash). | ||
| func getPiDefaultDomains(model string) ([]string, error) { |
There was a problem hiding this comment.
[/grill-with-docs] Removing pi-provider-domains and PiProviderDomains conflicts with #78353, which says provider metadata should not be removed just because it names upstreams. Pi users with provider-scoped models now get no provider API host.
💡 Suggested fix
Confirm the removal is intended and document it in the migration notes. Otherwise keep the metadata and gate the provider grant behind an explicit opt-in, as the issue asks.
@copilot please address this.
|
|
||
| // TestBuildAWFConfigJSON_APIProxyCACert verifies that sandbox.agent.ca-cert is | ||
| // mapped to apiProxy.caCert and gated to AWF versions that support the field. | ||
| func TestBuildAWFConfigJSON_ProxiedEngineTransportDoesNotGrantDirectModelAPI(t *testing.T) { |
There was a problem hiding this comment.
[/tdd] The doc comment for TestBuildAWFConfigJSON_APIProxyCACert (lines 1740-1741) now sits above this new test, so it documents the wrong function. Move the new test above that comment, or move the comment back to its function.
@copilot please address this.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "7ae757f1d83dc066efcc5dd5bd2eb46a4409e721",
"kind": "requested",
"schema_version": "1",
"state": "1e140810e62d8399e19f44529d2b32e83469cd9e896b6512298bb882b16897df",
"work": [
"059a252e7cf92e2f7fc9857b4f4502b451c34f0d857be1515d7e537ad2c8bb6b",
"4c8382518720a80c8300af128306d68248ea0e5370065851170af2c6f055981e",
"8bf972c821d1a14d1cc57245ffd9829e7fc6e8a9c8e9507a3318697a09213b05",
"a2880a0daaff23ec3a073812829e577dc70b9909cadd404fa446b06caf845189",
"a5f79d57b50015681d770f0c0329d3005ff99913b6ba05ba3457024eda455fc3",
"f92a787d74adfcf428e6bf3b32fef962903c0db714b5ec2b9115f6adf2991688",
"fa598c416d67d8b003e84389fb911ba981eb5136a783e7d3f14717fe1bf9903d"
],
"workflow": "pr-sous-chef"
}
|
…-separate-direct-model-api-egress Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
🎉 This pull request is included in a new release. Release: |


Engine transport bundles included direct vendor API hosts even though normal inference uses the AWF API proxy. Separate gateway/GitHub transport from intentional direct-provider egress while preserving proxy upstreams and custom-target behavior.
copilot-vendor,codex-vendor, andgemini-vendor. For Pi, use the matching vendor set; for Claude, allowapi.anthropic.comexplicitly.ANTHROPIC_BASE_URLandengine.api-targetbehavior, and retain provider API transport for Codex external detection.<!-- START COPILOT CODING AGENT SUFFIX -->
✨ PR Review Safe Output Test - Run 43985503194