Skip to content

Surface unsupported PAT authentication in Decisions evals - #75949

Closed
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-evals-400-error
Closed

pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-evals-400-error

Conversation

Copilot AI commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Copilot’s Decisions endpoint can reject PATs that work for agent inference, but plain-text errors were reduced to opaque HTTP failures. Non-blocking evals jobs then reported only judge_failed.

  • Diagnostics: Classify the allowlisted PAT rejection as auth_unsupported, persist execution evidence, and show actionable remediation without exposing provider bodies.
  • Audit: Surface evals_auth_unsupported findings from status artifacts scoped to the audited run and attempt, even when the judge step succeeds.
  • Compiler and docs: Warn on secret-based Copilot judge authentication without making strict compilation fail. Document credential selection, personal-account limitations, and independently authenticated OpenAI judges.
  • Integration identity: Preserve Copilot-Integration-Id: agentic-workflows for Copilot requests.

Rejected credentials produce no answers; evals remain non-blocking:

{"status":"not_evaluated","reason_code":"auth_unsupported"}

Copilot AI changed the title [WIP] Fix evals decisions endpoint handling for fine-grained PATs Surface unsupported PAT authentication in Decisions evals Nov 8, 2026
Copilot AI requested a review from pelikhan November 8, 2026 19:41
@pelikhan
pelikhan marked this pull request as ready for review November 8, 2026 19:42
Copilot AI adaptive review requested due to automatic review settings November 8, 2026 19:42
@pelikhan pelikhan closed this Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

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 Design Decision Gate 🏗️ · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.6K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #75949

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 8, 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 8, 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 8, 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 · ~1 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.7K · ◷

Generated by PR Specification Reviewer for #75949

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

Rejected-PAT runs lack zero-usage accounting, which can inflate or break daily-budget scans, and the new warning causes existing compiler tests to fail.

6 open issues
What changed in this PR

This PR improves gh-aw’s non-blocking Decisions evals by distinguishing unsupported PAT authentication from generic judge failures and surfacing it in runtime diagnostics and audits.

Changes:

  • Records auth_unsupported evidence and actionable remediation without publishing provider error bodies.
  • Adds audit findings scoped to the evaluated run and attempt.
  • Adds compiler warnings, authentication documentation, and regression coverage.
File Description
pkg/​workflow/​evals_job.go Warns about secret-based Copilot judge authentication.
pkg/​workflow/​evals_job_test.go Checks warnings across authentication configurations.
pkg/​cli/​audit_report_analysis.go Includes evals authentication findings in audit reports.
pkg/​cli/​audit_finding_codes.go Defines the stable evals_auth_unsupported finding code.
pkg/​cli/​audit_evals_auth.go Reads unsupported-auth status artifacts with run and attempt checks.
pkg/​cli/​audit_evals_auth_test.go Covers artifact layouts, scoping, and ignored markers.
docs/​src/​content/​docs/​reference/​auth.mdx Explains that agent PAT support does not guarantee evals support.
docs/​src/​content/​docs/​experimental/​experiments.md Documents judge credentials, limitations, and alternatives.
actions/​setup/​js/​run_evals.test.cjs Covers unsupported-auth outcomes, cleanup, and existing integration identity.
actions/​setup/​js/​run_evals.cjs Persists and preserves unsupported-auth execution evidence.
actions/​setup/​js/​render_evals_summary.test.cjs Checks remediation summaries without answer tallies.
actions/​setup/​js/​evals_status.cjs Adds the shared auth_unsupported reason code.
actions/​setup/​js/​decisions_client.test.cjs Tests PAT rejection classification and provider-body privacy.
actions/​setup/​js/​decisions_client.cjs Introduces the unsupported-auth error and allowlisted response matching.

Review effort: Max (auto)

if (!(error instanceof DecisionsModelUnavailableError)) throw error;
evidence.state = EVALS_REASON_CODES.MODEL_UNAVAILABLE;
if (!(error instanceof DecisionsModelUnavailableError) && !(error instanceof DecisionsAuthUnsupportedError)) throw error;
evidence.state = error instanceof DecisionsAuthUnsupportedError ? EVALS_REASON_CODES.AUTH_UNSUPPORTED : EVALS_REASON_CODES.MODEL_UNAVAILABLE;
Comment thread pkg/workflow/evals_job.go
return nil, nil
}
evalsJobLog.Print("Building evals job")
c.warnEvalsAuth(data)
Comment on lines +136 to +137
const text = (await response.text()).slice(0, 2048);
if ([400, 401, 403].includes(response.status) && text.includes("Personal Access Tokens are not supported")) {
if (!(error instanceof DecisionsModelUnavailableError)) throw error;
evidence.state = EVALS_REASON_CODES.MODEL_UNAVAILABLE;
if (!(error instanceof DecisionsModelUnavailableError) && !(error instanceof DecisionsAuthUnsupportedError)) throw error;
evidence.state = error instanceof DecisionsAuthUnsupportedError ? EVALS_REASON_CODES.AUTH_UNSUPPORTED : EVALS_REASON_CODES.MODEL_UNAVAILABLE;
AuditFindingDetectionJobFailed AuditFindingCode = "threat_detection_job_failed"
AuditFindingThreatDetected AuditFindingCode = "threat_detected"
AuditFindingEngineStepFailed AuditFindingCode = "engine_step_failed"
AuditFindingEvalsAuthUnsupported AuditFindingCode = "evals_auth_unsupported"
Comment thread pkg/workflow/evals_job.go
func (c *Compiler) warnEvalsAuth(data *WorkflowData) {
evalsData := c.buildEvalsDecisionData(data)
if evalsData.AI == "copilot" && !hasCopilotRequestsWritePermission(evalsData) && !usesTokenBrokerInference(evalsData) {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage("evals uses the Copilot Decisions endpoint with COPILOT_GITHUB_TOKEN. This endpoint can reject personal access tokens even when the agent accepts them. Use a credential supported by Decisions, configure an OpenAI-backed evals.model, or remove evals; changing the Copilot model will not fix token rejection."))
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.

evals: /v1/decisions rejects fine-grained PATs, and the opaque "HTTP 400" hides why

3 participants