Repository navigation
Fix universal-consumer Copilot credential routing - #73578
Conversation
Keep provider credentials scoped to their upstream and introduce the OpenAI-compatible client placeholder only inside the AWF sandbox. Add regression coverage, regenerate affected workflows, and specify the CTR-017 boundary. Co-authored-by: Copilot App <[email protected]>
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ 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.
|
|
✅ 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.
|
This comment has been minimized.
This comment has been minimized.
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
Review: no actionable findings
The changed credential-routing logic is internally consistent: Copilot credentials stay provider-scoped, the client placeholder is introduced only inside AWF execution, and the added tests cover both credential modes and protected capture. No blocking correctness issue was identified from the capped diff. The grumpy-coder specialist pass was unavailable because its tool invocation was rejected; its output was discarded.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review to run again
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines): the pre-fetched gate summary reports 276 additions in the default business-logic directories. It is not labeled 📄 Draft ADR committed:
📋 What to do next
The draft is grounded in Once the ADR is linked in the PR body, this gate will re-run and verify that the implementation matches the decision. ❓ Why ADRs MatterADRs create a searchable, permanent record of why the codebase looks the way it does and make architectural trade-offs reviewable by future contributors. 📋 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.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd (plus /codebase-design for one minor note) — this is a solid, well-tested security fix. Approving.
📋 Key Themes & Highlights
Root cause & fix
- Correctly identifies the root cause: aliasing
COPILOT_GITHUB_TOKENasOPENAI_API_KEYin the shared universal-consumer provider profile let the client-sideOPENAI_API_KEYleak into the AWF startup environment, enabling an unintended upstream OpenAI adapter. - The fix removes the alias from
getUniversalLLMBackendProfileand instead introduces a non-secretCOPILOT_DUMMY_BYOKplaceholder only inside the sandbox command, after AWF credential discovery — mirroring the existing pattern already used inclaude_engine.go,codex_engine.go, andcopilot_engine_execution.go. Good consistency with established conventions (/codebase-design).
Test coverage (/tdd)
behavior_defined_engine_provider_test.go(176 new lines) covers harness vs. direct execution, protected session capture, sandbox-disabled paths, and compiled-YAML assertions that the secret key never appears in the runner step env.TestBehaviorDefinedEngine_CopilotAWFStartupEnvironmentis a strong regression test: it parses the generated shell command with the shell syntax parser, extracts the actual AWF invocation, and executes it against a fake startup function with synthetic credentials to prove the startup/client environment boundary holds at the shell level.universal_llm_consumer_engine_test.goadds isolation tests for both Copilot credential sources (secrets.COPILOT_GITHUB_TOKEN and copilot-requests: write -> github.token) and confirms non-Copilot providers are unaffected.
Minor note
- Left one non-blocking inline comment (
/codebase-design) onbehavior_defined_engine.goaboutresolveBackendbeing computed twice per execution path — low risk today since both calls share the same workflowData, but worth threading through as a single value if the function grows further.
Positive highlights
- ✅ Spec (CTR-017, Section 7.6) updated in the same change set with concrete evidence mapping to tests — good practice for a security-relevant routing change.
- ✅ 19 lock files regenerated and changeset/migration guidance included so operators know to recompile.
- ✅ Unrelated SplitN to Cut cleanup is small and safe, doesn't conflate with the credential fix.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · ~60 AIC · ⌖ ~15 AIC · ⊞ 10.7K
Comment /matt to run again
There was a problem hiding this comment.
🔵 Needs a closer look
The security-sensitive credential-routing change depends on AWF runtime behavior that simulated startup tests do not verify, so credential isolation and client compatibility across 19 workflows still require human validation.
No open issues 🎉
What changed in this PR
This PR updates gh-aw’s universal-consumer credential routing so Copilot tokens are not exposed through OpenAI credential aliases during AWF startup. OpenAI-compatible clients instead receive a non-secret placeholder inside the sandbox.
Changes:
- Removes the shared Copilot-to-OpenAI credential alias while preserving gateway URL routing.
- Adds provider, generated-YAML, and simulated startup regression coverage; regenerates 19 workflow locks.
- Documents the CTR-017 routing contract and adds patch-release guidance requiring deployed workflows to be recompiled.
| File | Description |
|---|---|
specs/compiler-threat-detection-spec.md |
Defines routing boundaries in version 1.0.80. |
specs/compiler-threat-detection-changelog.md |
Records the contract and migration requirements. |
pkg/workflow/universal_llm_consumer_engine.go |
Removes the Copilot credential’s OpenAI alias. |
pkg/workflow/universal_llm_consumer_engine_test.go |
Tests credential isolation and provider preservation. |
pkg/workflow/behavior_defined_engine.go |
Introduces the client placeholder inside AWF execution. |
pkg/workflow/behavior_defined_engine_provider_test.go |
Tests startup timing and generated credential placement. |
.github/workflows/smoke-pydantic.lock.yml |
Applies corrected routing to Pydantic smoke execution. |
.github/workflows/smoke-opencode.lock.yml |
Applies corrected routing to OpenCode smoke execution. |
.github/workflows/smoke-goose.lock.yml |
Applies corrected routing to Goose smoke execution. |
.github/workflows/smoke-factory.lock.yml |
Applies corrected routing to Factory smoke execution. |
.github/workflows/smoke-deepseek-harness.lock.yml |
Applies corrected routing to DeepSeek harness smoke execution. |
.github/workflows/smoke-crush.lock.yml |
Applies corrected routing to Crush smoke execution. |
.github/workflows/smoke-aider.lock.yml |
Applies corrected routing to Aider smoke execution. |
.github/workflows/engine-conformance-pydantic-ai.lock.yml |
Updates Pydantic AI conformance execution. |
.github/workflows/engine-conformance-opencode.lock.yml |
Updates OpenCode conformance execution. |
.github/workflows/engine-conformance-goose.lock.yml |
Updates Goose conformance execution. |
.github/workflows/engine-conformance-factory.lock.yml |
Updates Factory conformance execution. |
.github/workflows/engine-conformance-deepseek-harness.lock.yml |
Updates DeepSeek harness conformance execution. |
.github/workflows/engine-conformance-crush.lock.yml |
Updates Crush conformance execution. |
.github/workflows/engine-conformance-aider.lock.yml |
Updates Aider conformance execution. |
.github/workflows/daily-token-consumption-report.lock.yml |
Updates agent and evaluation credential routing. |
.github/workflows/daily-team-evolution-insights.lock.yml |
Updates daily Goose execution routing. |
.github/workflows/daily-security-red-team.lock.yml |
Updates agent and evaluation credential routing. |
.github/workflows/daily-go-test-stubs-aider.lock.yml |
Updates daily Aider test-stub execution routing. |
.github/workflows/daily-code-debt-aider.lock.yml |
Updates daily Aider code-debt execution routing. |
.github/aw/configure-agentic-engine.md |
Explains credential placement and recompilation. |
.changeset/patch-universal-copilot-credentials.md |
Adds patch-release and migration guidance. |
Review effort: Max (auto)
Resolve universal-consumer routing once per execution and share it across provider environment, firewall command, and secret filtering. Co-authored-by: Copilot App <[email protected]>
|
🎉 This pull request is included in a new release. Release: |
Universal-consumer engines using a Copilot model must not expose their Copilot credential through an OpenAI credential alias, which can enable an unintended upstream adapter during AWF startup.
Remove the shared profile's
OPENAI_API_KEYalias and supply OpenAI-compatible clients with a non-secret placeholder only inside the AWF sandbox command, after credential discovery. Preserve Copilot gateway URL aliases, other provider profiles, and direct/harness execution, including protected session capture.Focused provider, engine, generated-lock, and formal conformance tests pass, along with scoped lint/build/schema checks and the full 353-workflow drift check. No live credential requests or workflow dispatches were performed. The simulated startup test does not constitute end-to-end AWF verification.
Upstream partial-key redaction, explicit author-owned credential overrides, and previously uploaded artifacts are outside this change.