Skip to content

Harden OpenAI WIF version, detection, and egress handling - #76427

Merged
pelikhan merged 7 commits into
mainfrom
copilot/openai-wif-follow-up
Nov 10, 2026
Merged

pelikhan merged 7 commits into
mainfrom
copilot/openai-wif-follow-up

Conversation

Copilot AI commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

OpenAI WIF requires a released AWF proxy with native support, and detector overrides could inherit OIDC configuration without the permission to mint a token. The change also narrows token-exchange egress and clarifies that evals use a separate authentication path.

  • Version gate: Require AWF v0.29.11+ and, when overridden, an API-proxy image with a semantic-version tag of v0.29.11+. The default AWF pin is v0.29.11.
  • Detection permissions: Preserve id-token: write when a same-engine detector override inherits OIDC auth.
  • Egress: Stop automatically adding auth.openai.com to agent and detector allowlists; the proxy handles token exchange.
  • Evals: Document that engine.auth WIF does not apply to evals. OpenAI evals still require CODEX_API_KEY or OPENAI_API_KEY; eval-specific WIF support is not included.
permissions:
  contents: read
  id-token: write
engine:
  id: codex
  auth:
    type: github-oidc
    provider: openai
    identity-provider-id: ${{ vars.OPENAI_IDENTITY_PROVIDER_ID }}
    service-account-id: ${{ vars.OPENAI_SERVICE_ACCOUNT_ID }}
    audience: https://api.openai.com/v1

A live token-exchange trial is not included.

Copilot AI changed the title [WIP] Address OpenAI WIF release pin and permissions Harden OpenAI WIF version, detection, and egress handling Nov 10, 2026
Copilot AI requested a review from pelikhan November 10, 2026 06:58
@github-actions

Copy link
Copy Markdown
Contributor

Category: bug | Risk: high | Score: 68/100 (impact 35 + urgency 20 + quality 13) | Recommended action: fast_track | Notes: hardens OpenAI WIF version, detection, and egress logic; high-risk auth/runtime behavior and the most urgent patch in this batch.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~9 AIC · ⌖ ~2 AIC · ⊞ 15.8K · ◷

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Category: bug | Risk: high | Score: 68/100 (impact 35 + urgency 20 + quality 13) | Recommended action: fast_track | Notes: hardens OpenAI WIF version, detection, and egress logic; high-risk auth/runtime behavior and the most urgent patch in this batch.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~9 AIC · ⌖ ~2 AIC · ⊞ 15.8K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

Category: bug | Risk: high | Score: 68/100 (impact 35 + urgency 20 + quality 13) | Recommended action: fast_track | Notes: hardens OpenAI WIF version, detection, and egress logic; high-risk auth/runtime behavior.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~9 AIC · ⌖ ~2 AIC · ⊞ 15.8K · ◷

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Category: bug | Risk: high | Score: 68/100 (impact 35 + urgency 20 + quality 13) | Recommended action: fast_track | Notes: hardens OpenAI WIF version, detection, and egress logic; high-risk auth/runtime behavior.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~9 AIC · ⌖ ~2 AIC · ⊞ 15.8K · ◷

@pelikhan
pelikhan marked this pull request as ready for review November 10, 2026 14:26
Copilot AI adaptive review requested due to automatic review settings November 10, 2026 14:26
@github-actions

github-actions Bot commented Nov 10, 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.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #76427

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 10, 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

@github-actions

github-actions Bot commented Nov 10, 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.

Generated from PR Code Quality Reviewer · gpt56 · ~5 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification 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 from PR Specification Reviewer · gpt56 · ~2 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #76427

@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.

What this change does: It checks that OpenAI WIF uses a supported firewall and proxy version, preserves detector token permissions, and narrows network access. It also documents the separate eval authentication path.

Should fix:

  1. Reuse the image tag parser

    • What this is: The validator extracts the tag from a proxy image reference.
    • Problem: imageReferenceTag in pkg/workflow/model_routing.go already handles the same references.
    • Fix: Call that helper and delete awfImageTag.
    • If we skip it: Two parsers must be maintained for the same image format.

Checked the changed lines and connected code, assuming normal compilation of individual workflows.

Verdict: Ship.
Lean: -9 lines possible.

Generated by ✂️ Ponytail Reviewer for #76427 · codex · routed: gpt61 medium · ~6 AIC · ⌖ ~1 AIC · ⊞ 181
Comment /ponytail to run again

Comment thread pkg/workflow/compiler_validators.go Resolved
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

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

📄 Draft ADR committed: docs/adr/76427-openai-wif-version-gate-proxy-egress.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. Resolve the [TODO: verify] items — the deciders, and the rationale for the detector-override alternative

  3. Reconcile with ADR-70619 — it requires the codex-vendor opt-in for auth.openai.com, while this PR documents that WIF does not need that opt-in

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

    ADR: ADR-76427: Gate OpenAI WIF on AWF Version and Keep Token Egress in the Proxy (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.

🔍 Gate evidence
  • Trigger: no implementation label, but 126 added lines in business-logic directories (pkg/), above the 100-line default threshold.
  • ADR search: no ADR link in the PR body, no docs/adr/ file for PR 76427, and no ADR content in linked issue OpenAI WIF follow-up: release pin, detector id-token permission, allowlist and evals #76290. ADR-68457 covers only the Azure path.
  • Closing note: the PR body has Fixes #76290, but that issue lists a live token-exchange trial in its "done when" section, and this PR excludes that trial.
📋 Michael Nygard ADR Format Reference

An ADR must contain four sections to be considered complete: Context, Decision, Alternatives Considered, and Consequences. ADRs live in docs/adr/ and are numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 8.5K · ◷
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-10T14:31:05Z
review_event: REQUEST_CHANGES
top_themes: raw env-based OIDC permission escalation; unverifiable latest AWF version gate; misleading generated API-proxy image validation
files_reviewed: pkg/workflow/threat_detection_job.go, pkg/workflow/compiler_validators.go, pkg/workflow/sandbox_agent_images.go
comment_count: 3

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~5 AIC · ⌖ ~2 AIC · ⊞ 1.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.

Found three correctness/security issues in the OpenAI WIF hardening changes.

Highlights
  • Raw AWF_AUTH_TYPE in engine.env now grants id-token: write without structured auth validation.
  • latest bypasses the explicit AWF support-version gate.
  • Generated model-routing API-proxy images can produce a misleading user-override error.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~5 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again

Comment thread pkg/workflow/threat_detection_job.go Resolved
Comment thread pkg/workflow/compiler_validators.go Resolved
Comment thread pkg/workflow/compiler_validators.go Resolved

@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 and /improve-codebase-architecture (selected by pr-triage). Requesting changes: the new AWF version floor can be bypassed in two ways.

📋 Key Themes & Highlights

Key Themes

  • Version floor is not enforced: shorthand image tags (v1, 1.2) and version: latest both pass the gate. I confirmed both with probe tests.
  • Untested env-only WIF path: AWF_AUTH_TYPE set via engine.env drives both the version gate and the detection-job id-token grant, with no test coverage.
  • Duplicate helper: awfImageTag repeats imageReferenceTag from model_routing.go.

Positive Highlights

  • ✅ Targeted tests pass on the PR head (pkg/constants and pkg/workflow OpenAI WIF and detection suites).
  • ✅ The auth.openai.com allowlist removal is consistent across the Codex engine and detector paths, and the docs and ADR are updated to match.
  • ✅ The detector clones the engine config, so the id-token fix covers same-engine overrides.

Uncertainty

I could not verify from this repository that AWF v0.29.11 provides the proxy-side egress path for auth.openai.com that the PR relies on. Please confirm this against the AWF release.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~10 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

Comment thread pkg/workflow/compiler_validators.go Resolved
Comment thread pkg/workflow/compiler_validators.go Resolved
Comment thread pkg/workflow/compiler_validators.go Resolved
Comment thread pkg/workflow/compiler_validators.go Resolved
Comment thread pkg/workflow/threat_detection_job.go Resolved

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 detector can receive id-token: write on AWF versions that expose OIDC request credentials, allowing a compromised agent to mint tokens for trusted cloud audiences.

3 open issues
What changed in this PR

Hardens OpenAI Workload Identity Federation (WIF) support in the workflow compiler and Codex threat detection, while narrowing agent network access.

Changes:

  • Requires AWF v0.29.11+ and compatible version tags for custom API-proxy images.
  • Adds detector OIDC permission handling and removes automatic token-exchange host allowlisting.
  • Expands regression coverage and documents that OpenAI evals still require API keys.
File Description
pkg/​workflow/​threat_detection_job.go Handles detector OIDC permissions from effective environment settings.
pkg/​workflow/​threat_detection_helpers.go Removes automatic detector access to the token-exchange host.
pkg/​workflow/​threat_detection_firewall_test.go Checks that WIF does not add token-host egress.
pkg/​workflow/​compiler_validators.go Adds AWF and API-proxy version validation for WIF.
pkg/​workflow/​codex_engine.go Removes automatic Codex token-host allowlisting.
pkg/​workflow/​codex_azure_oidc_test.go Expands version, image, egress, and detector-permission coverage.
pkg/​constants/​version_constants.go Defines the minimum AWF version for OpenAI WIF.
pkg/​constants/​version_constants_test.go Verifies the new minimum-version constant.
docs/​src/​content/​docs/​reference/​auth.mdx Documents version requirements and proxy-owned token exchange.
docs/​src/​content/​docs/​experimental/​experiments.md Clarifies the separate authentication requirements for evals.
.changeset/​openai-wif-follow-up.md Records the hardening changes for release.

Review effort: Max (auto)

Comment thread pkg/workflow/threat_detection_job.go Resolved
Comment thread pkg/workflow/compiler_validators.go Resolved
Comment thread pkg/workflow/threat_detection_job.go Resolved
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@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/compiler_validators.go:885): address unresolved feedback - Review comment
  3. Review (pkg/workflow/threat_detection_job.go:223): address unresolved feedback - Review comment
  4. Review (pkg/workflow/compiler_validators.go:862): address unresolved feedback - Review comment
  5. Review (pkg/workflow/compiler_validators.go:873): address unresolved feedback - Review comment
  6. Review (pkg/workflow/compiler_validators.go:862): address unresolved feedback - Review comment
  7. Review (pkg/workflow/compiler_validators.go:885): address unresolved feedback - Review comment
  8. Review (pkg/workflow/compiler_validators.go:873): address unresolved feedback - Review comment
  9. Review (pkg/workflow/compiler_validators.go:806): 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": "228d4a177c216bda61dfa37baff8ce5fee8eaa79",
  "kind": "requested",
  "schema_version": "1",
  "state": "764a21b6e9ea0b05ccd2914dde265702e02121c0595a0073a032fa3117762c60",
  "work": [
    "1cc1c09c4c4f801b86421c51d7445c15f6dba621ee007c62814855c5f7d354a3",
    "244fce5123e525f9da627a21c2671a87318f6a2ee5417c7a7cafc5806f97cade",
    "47c8b891f85f8bd31dc255634968adc1ac858c1c84126511eae23fe6a9320326",
    "52b2fa38c6e74d0b3c7670bea3f13f85a63b0c54c70a55aad4d144121cb858cd",
    "548e5e6d1bcd16186da3640befd18569cdd85b76284d5a2ea6418a0f197a44ba",
    "9055270039e34152abc0704cec69d4e3b7e2b1c39f9349e192c50a502a891108",
    "c0b8529af780846db9249006150b9c1411ce8bb6b531b23d976a90d3d4ff32ee",
    "febea9f7fdce89add2b713156737011ef582aaeca9a80eba39914d9298f18f7c"
  ],
  "workflow": "pr-sous-chef"
}

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

Copilot AI commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

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

Merged the latest main and addressed the listed review feedback in 697d607. Focused WIF tests and intermediate checks passed; the final repository gate is running now.

pelikhan and others added 2 commits November 10, 2026 11:07
Cover keyless setup, AWF version gates, proxy-owned token egress, detector auth inheritance, and evals authentication limits.

Co-authored-by: Copilot App <[email protected]>
Resolve inherited and environment-based OpenAI WIF before checking detector proxy versions and generating keyless configuration. Require credential-exclusion support before granting detector OIDC permission.

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan merged commit 445df5a into main Nov 10, 2026
85 checks passed
@pelikhan
pelikhan deleted the copilot/openai-wif-follow-up branch November 10, 2026 19:46
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI WIF follow-up: release pin, detector id-token permission, allowlist and evals

5 participants