Skip to content

Separate direct model API egress from engine transport bundles - #78465

Merged
pelikhan merged 6 commits into
mainfrom
copilot/domains-audit-separate-direct-model-api-egress
Nov 17, 2026
Merged

pelikhan merged 6 commits into
mainfrom
copilot/domains-audit-separate-direct-model-api-egress

Conversation

@gh-aw-bot

@gh-aw-bot gh-aw-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • Transport bundles: Remove direct model API hosts from Copilot, Codex, Gemini, and Pi defaults.
  • Direct-provider opt-ins: Add those hosts to copilot-vendor, codex-vendor, and gemini-vendor. For Pi, use the matching vendor set; for Claude, allow api.anthropic.com explicitly.
  • Claude and detection: Stop implicitly allowing Anthropic API egress for Claude’s default target. Preserve ANTHROPIC_BASE_URL and engine.api-target behavior, and retain provider API transport for Codex external detection.
# Direct Gemini API access, in addition to the gateway transport
network:
  allowed:
    - gemini
    - gemini-vendor

<!-- START COPILOT CODING AGENT SUFFIX -->



✨ PR Review Safe Output Test - Run 43985503194

💥 [THE END] — Illustrated by Smoke Claude · claude · sonnet46 · ~69 AIC · ⌖ ~8 AIC · ⊞ 1K · ◷
Comment /smoke-claude to run again

gh-aw-bot and others added 2 commits November 16, 2026 21:45
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@gh-aw-bot gh-aw-bot changed the title [WIP] Separate direct model API egress from engine transport bundles Separate direct model API egress from engine transport bundles Nov 16, 2026
@github-actions
github-actions Bot requested an adaptive review from Copilot November 17, 2026 00:24

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 [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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/workflow/domains.go
// 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Comment thread pkg/workflow/domains.go Outdated
}

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`.
@pelikhan
pelikhan marked this pull request as ready for review November 17, 2026 01:03
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated by Ponytail Reviewer for #78465 · codex · routed: gpt61 medium · ~6 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Generated by PR Specification Reviewer for #78465 · copilot · gpt56 · ~5 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

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.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K · ◷

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

This PR makes significant changes to core business logic (>100 new lines in pkg/) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/78465-separate-direct-model-api-egress-from-transport-bundles.md — review and complete it before merging.

🔒 This PR cannot merge until an ADR is linked in the PR body.

📋 What to do next
  1. Review the draft ADR committed to your branch — it was generated from the PR diff

  2. Complete the missing sections — add context the AI couldn't infer, refine the decision rationale, and list real alternatives you considered

  3. Commit the finalized ADR to docs/adr/ on your branch

  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-78465: Separate Direct Model API Egress from Engine Transport Bundles (link unavailable: invalid HTTPS URL)

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 Reference

An ADR must contain these four sections to be considered complete:

  • Context — What is the problem? What forces are at play?
  • Decision — What did you decide? Why?
  • Alternatives Considered — What else could have been done?
  • Consequences — What are the trade-offs (positive and negative)?

All ADRs are stored in docs/adr/ as Markdown files numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: sonnet55 high · ~19 AIC · ⌖ ~2 AIC · ⊞ 8.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

  1. pkg/workflow/domains.go removes Pi provider-domain metadata from getPiDefaultDomains, 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.
  2. The changed docs/src/content/docs/reference/network.md now documents the new vendor split, but .github/aw/network.md remains stale: it still lists direct provider hosts in copilot, codex, gemini, and pi, describes implicit Anthropic access, and omits gemini-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

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-67801c27-e05a-4121-92b2-9802fea7883c","parents":[],"payload":{"id":"ldg-654e1285-9090-4ed4-bb32-7df18aeee18a","operation":"append","value":{"finding_count":0,"head_sha":"3d1e132f19a8540fc1217c42cbe50d4638a9f49e","outcome":"no_findings"}},"sha":"sha256:8350c71fd7522976eca3d79c180c3e438f0e9f67095ac2f531bf9907b7ba03b5","timestamp":"2026-11-17T01:12:06.648Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-09414776-8339-4440-a87f-f9a61d13d37d","parents":[],"payload":{"id":"ldg-5301ef1e-2bf6-422e-8561-3763cf919dbb","operation":"append","value":{"finding_count":2,"head_sha":"3d1e132f19a8540fc1217c42cbe50d4638a9f49e","outcome":"regression"}},"sha":"sha256:d18782a916330aea95ff0165f70c25e9c369f52821f3b06f14973fd7f526d985","timestamp":"2026-11-17T01:13:01.957Z","type":"ledger_append","version":1}
History

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-in fails. pkg/workflow/awf_helpers_test.go:1309 still expects gemini to grant generativelanguage.googleapis.com (wantDirect: true). This PR removes that grant, so the case needs wantDirect: false or a move to gemini-vendor.
  • Codex GitHub branch (codex_engine.go:475): re-adds api.githubcopilot.com, which contradicts the Copilot split.
  • Pi provider metadata (domains.go:162): removing pi-provider-domains goes 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 omits gemini-vendor. docs/.../network.md:181 says provider-scoped Pi models use the gateway, which the code no longer guarantees.
  • Stale reference: .github/workflows/weekly-network-domains-audit.md:85,98 still uses piProviderDomains.
  • Breaking change: users relying on copilot, codex, gemini, or pi for direct egress need *-vendor opt-ins. There is no CHANGELOG entry or codemod. Compiled .lock.yml files still carry the old hosts; run make recompile after the fixes.

Positive

  • ✅ The Claude removal looks safe. claude_harness.cjs sets ANTHROPIC_BASE_URL from the AWF /reflect endpoint when the proxy is on.
  • ✅ Custom ANTHROPIC_BASE_URL and engine.api-target behavior is preserved via mergeAPITargetDomains.

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

Comment thread pkg/workflow/codex_engine.go Outdated
// 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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

Comment thread pkg/workflow/domains.go
// 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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator Author

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/workflow/claude_engine.go:449): address unresolved feedback - Review comment
  3. Review (pkg/workflow/domains.go:112): address unresolved feedback - Review comment
  4. Review (pkg/workflow/domains.go:166): address unresolved feedback - Review comment
  5. Review (docs/src/content/docs/reference/network.md:170): address unresolved feedback - Review comment
  6. Review (pkg/workflow/codex_engine.go:475): address unresolved feedback - Review comment
  7. Review (pkg/workflow/domains.go:162): address unresolved feedback - Review comment
  8. Review (pkg/workflow/awf_config_test.go:1742): address unresolved feedback - Review comment

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"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

…-separate-direct-model-api-egress

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@pelikhan
pelikhan merged commit d5239e1 into main Nov 17, 2026
52 checks passed
@pelikhan
pelikhan deleted the copilot/domains-audit-separate-direct-model-api-egress branch November 17, 2026 03:01
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[domains-audit] Separate direct model API egress from engine transport bundles

4 participants