Skip to content

Add safe outputs for security advisory drafts and comments - #76711

Merged
pelikhan merged 15 commits into
mainfrom
pelikhan/security-advisory-drafts
Nov 11, 2026
Merged

pelikhan merged 15 commits into
mainfrom
pelikhan/security-advisory-drafts

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add create-security-advisory to create draft advisories in the workflow repository. The handler never publishes advisories, creates private forks, or accepts an agent-selected repository.
  • Add add-security-advisory-comment to post comments using ghsa_id and body, with standard attribution and execution provenance. It never falls back to public issue comments.
  • Require an explicit external token or GitHub App, configured per output or globally, with Repository security advisories: write permission. Reject GITHUB_TOKEN, keep credentials out of agent configuration, and scope App tokens to advisory writes.
  • Include schemas, compiler/runtime registration, limits, staged previews without credentials, documentation, a minor changeset, and regenerated workflow locks.

ADR: ADR-76711: Require an External Token for Security Advisory Safe Outputs. Proposed; maintainer approval remains pending.

Review follow-up

  • Preserve complete secret-redacted staged previews, detection notices, attribution, execution provenance, and global body-footer policy.
  • Execute advisory-only workflows even when default diagnostics are disabled, advertise both tools and budgets in prompts, and preserve 65,000-character input fields through actual MCP submission.
  • Honor explicit advisory-permission denial, normalize expression-resolved budgets including -1, count failed API attempts, and preserve canonical advisory/comment URLs in recorded outcomes.
  • Retain start_private_fork: false and GitHub App authentication based on the current API schema and pinned action's environment-input conversion; regressions cover the disputed contracts.
  • Merge current main and integrate the concurrent review-fix commit without force-pushing, preserving compatible budget-validation and capped-rendering coverage.

API availability and confidentiality

Advisory comments use POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/comments. The current GitHub REST reference documents this endpoint and advisory-write authentication; availability must be verified for the target installation, particularly GitHub Enterprise Server versions. Comments follow advisory visibility. Workflow logs, artifacts, and staged previews can contain advisory content, so a private draft alone does not make the run confidential. Preview secrets are redacted; API errors expose status without echoing confidential request bodies, and there are no issue-comment fallbacks or automatic retries.

Validation

  • Advisory, MCP submission, safe-output, permission, prompt, and parser regressions pass.
  • Targeted JavaScript suites pass: 503 passed, 3 skipped; TypeScript checking passes.
  • Standard Go lint and scoped formatting/compilation/JavaScript lint pass.
  • All 365 repository workflows compile, with no remaining lock drift.
  • Existing custom-Go-linter findings in unchanged App-token and handler infrastructure still prevent a clean full make agent-report-progress gate. The App-token findings were reproduced against unchanged source using a Go source overlay; no new custom-lint findings were reported for the advisory implementations.

No advisory was created, no live advisory comment was posted, and no workflow was dispatched during validation.

Copilot AI adaptive review requested due to automatic review settings November 11, 2026 02:20
@pelikhan
pelikhan marked this pull request as draft November 11, 2026 02:29
@pelikhan
pelikhan marked this pull request as ready for review November 11, 2026 02:30
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

Generated by PR Specification Reviewer for #76711

@github-actions

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

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

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

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 11, 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 from Ponytail Reviewer · routed: gpt61 medium · ~8 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 181 · ◷

Generated by Ponytail Reviewer for #76711

@github-actions

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

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-11T02:33:27Z
review_event: REQUEST_CHANGES
top_themes: [GitHub REST API contract]
files_reviewed: [actions/setup/js/create_security_advisory.cjs]
comment_count: 1

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 · ⌖ ~1 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 one blocking API-contract issue: the advisory creation handler sends start_private_fork, but the REST endpoint expects private_fork. This can reject requests and fails to enforce the documented no-private-fork behavior. I did not run tests per the static-review instructions.

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

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

Reviewed PR head ae185f8f3b063a585f7913ead1e1dc6d8c443474 against the applicable Safe Outputs MCP Gateway Specification v1.29.22, §5.2 GP2 (staged mode), and the security-architecture safe-output isolation requirements.

Blocking finding: both advisory handlers intentionally produce content-omitting staged previews (content omitted), while GP2 requires complete operation details and prohibits omitting critical operation details. The changed reference documentation also records this behavior. This is a normative contract violation; please implement a compliant detailed/redacted preview or obtain and land an approved security-preserving specification change.

No specification synchronization was applied: the PR does not update the formal contract, and weakening its mandatory staged-preview requirements requires maintainer approval and explicit conformance coverage. Review was limited to the captured open, non-draft head and the prefetched PR diff; tests were not run per static-review policy.

Generated by PR Specification Reviewer for #76711 · copilot · gpt50 · ~4 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review-specs 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 business-logic directories) but does not have a linked Architecture Decision Record (ADR).

📄 Draft ADR committed: docs/adr/76711-require-external-token-for-advisory-outputs.md. Review and complete it before merging.

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

Decision captured in the draft: add create-security-advisory and add-security-advisory-comment, require an explicit external token or GitHub App with advisory-write permission, never publish or fork advisories, and never fall back to public issue comments.

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

  2. Resolve the [TODO: verify] markers: confirm the deciders and the current availability of the public-preview advisory comments endpoint.

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

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

    ADR: ADR-76711: Require an External Token for Security Advisory Safe Outputs (link unavailable: invalid HTTPS URL)

Once an ADR is linked in the PR body, this gate re-runs and verifies that the implementation matches the decision.

❓ Why ADRs Matter

ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be 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/, numbered by PR number (for example, 76427-...md for PR #76427).

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

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

Explicit advisory permission restrictions are ignored, advisory descriptions omit required detection notices, and advisory-only workflows can skip execution entirely.

7 open issues
What changed in this PR

Extends gh-aw’s safe-output pipeline with security-advisory drafts and comments, keeping advisory writes in the trusted execution job.

Changes:

  • Add advisory tools across schemas, compiler configuration, and runtime handlers.
  • Add external-token/App authentication, advisory permissions, limits, and staged previews.
  • Add regression tests, documentation, a minor changeset, and regenerated validation-catalog content.
File Description
schemas/​agent-output.json Define advisory output payloads.
pkg/​workflow/​safe_outputs_validation_config.go Add advisory field-validation rules.
pkg/​workflow/​safe_outputs_tools_computation.go Enable configured advisory tools.
pkg/​workflow/​safe_outputs_state.go Recognize enabled advisory outputs.
pkg/​workflow/​safe_outputs_max_validation.go Validate advisory operation limits.
pkg/​workflow/​safe_outputs_handler_registry_workflow.go Build draft-advisory handler configuration.
pkg/​workflow/​safe_outputs_handler_registry_test.go Update expected handler registrations.
pkg/​workflow/​safe_outputs_handler_registry_comments.go Build advisory-comment handler configuration.
pkg/​workflow/​safe_outputs_config_types.go Add advisory configuration fields.
pkg/​workflow/​safe_outputs_config_extraction.go Extract advisory configurations.
pkg/​workflow/​safe_outputs_app_config.go Map advisory permissions to App-token inputs.
pkg/​workflow/​safe_outputs_advisory_auth.go Resolve and validate advisory credentials.
pkg/​workflow/​safe_output_handlers.go Register advisory handlers and permissions.
pkg/​workflow/​permissions.go Add the advisory App permission scope.
pkg/​workflow/​js/​safe_outputs_tools.json Define compiler-side advisory tool schemas.
pkg/​workflow/​create_security_advisory.go Parse and validate draft-advisory configuration.
pkg/​workflow/​create_security_advisory_test.go Test draft authentication and compilation.
pkg/​workflow/​compiler_validators.go Invoke advisory authentication validators.
pkg/​workflow/​add_security_advisory_comment.go Parse and validate advisory-comment configuration.
pkg/​workflow/​add_security_advisory_comment_test.go Test comment configuration and compilation.
pkg/​parser/​schemas/​main_workflow_schema.json Define workflow options and advisory permissions.
docs/​src/​content/​docs/​reference/​safe-outputs.md Document advisory usage and confidentiality limits.
actions/​setup/​js/​types/​safe-outputs.d.ts Add advisory payload types.
actions/​setup/​js/​types/​safe-outputs-config.d.ts Add advisory handler configuration types.
actions/​setup/​js/​safe_outputs_tools.json Define runtime advisory tool schemas.
actions/​setup/​js/​safe_outputs_mcp_schema_validation.test.cjs Test advisory tool input schemas.
actions/​setup/​js/​safe_output_handler_manager.cjs Register runtime handlers and warning-mode classifications.
actions/​setup/​js/​create_security_advisory.test.cjs Test draft creation, validation, and error handling.
actions/​setup/​js/​create_security_advisory.cjs Implement draft-advisory creation.
actions/​setup/​js/​add_security_advisory_comment.test.cjs Test comments, attribution, limits, and failures.
actions/​setup/​js/​add_security_advisory_comment.cjs Implement attributed advisory comments.
.github/​workflows/​pr-sous-chef.lock.yml Refresh generated validation-catalog entries.
.github/​aw/​safe-outputs-automation.md Add advisory automation reference entries.
.changeset/​create-security-advisory.md Record the minor feature release.

Review effort: Max (auto)

Comment thread pkg/workflow/safe_outputs_app_config.go Resolved
Comment thread pkg/workflow/safe_outputs_state.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 /diagnosing-bugs, /tdd, and /codebase-design. Requesting changes on one runtime-correctness issue. The rest is minor.

📋 Key Themes & Highlights

Key Themes

  • App-token advisory scope: permission-repository-advisories is not an input of the pinned actions/create-github-app-token (SHA 64ab729a, v3.3.0). The App path may mint a token without advisory write access.
  • Comment handler budget: the max check runs after report rendering, and failed POSTs do not count toward max. Both need explicit tests.
  • Schema vs handler: the handler supports max: -1, but the schema allows only 1 to 10.

Positive Highlights

  • ✅ GHSA ID validation, body limits, and status-only error reporting avoid leaking confidential payloads.
  • ✅ GITHUB_TOKEN is rejected for advisory operations, with a clear compile-time error.
  • ✅ Targeted Go tests for the new compile and auth paths pass.

Limits of this review

  • Vitest could not run because the npm registry is unreachable from this sandbox, so the JS suites were reviewed by reading only.

@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/safe_outputs_app_config.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 (actions/setup/js/create_security_advisory.cjs:79): address unresolved feedback - Review comment
  3. Review (docs/src/content/docs/reference/safe-outputs.md:1379): address unresolved feedback - Review comment
  4. Review (pkg/workflow/safe_outputs_app_config.go:562): address unresolved feedback - Review comment
  5. Review (actions/setup/js/add_security_advisory_comment.cjs:44): address unresolved feedback - Review comment
  6. Review (actions/setup/js/add_security_advisory_comment.cjs:22): 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": "8e3310d6cc6bc82ad69bf5cb7ec390366f2f2a8a",
  "kind": "requested",
  "schema_version": "1",
  "state": "8b97aebff64538deee47b1264b22d089ff71dddd3e216bb9948f97051e9636d2",
  "work": [
    "6c014cee1a112333f89c6276d81229c687dec5a2b70d2e443e2a03c3362dd6c6",
    "6c9a328b95501dc66ab070f25fddb9ede254d8bf8ecf1bbf23e1790fc49b79c1",
    "7963ffe6d14ac5bdc62c511baf9e27acc3af26e1db937395407b33c37b27ba23",
    "9942d6dd679991d2ec4de62de7050c07ded43928e32b1fa4cb6322fb8a90b980",
    "ca38ba1c83aae8b29c2de02046de7560da4847b738e7719ef74c72db1cc6368e"
  ],
  "workflow": "pr-sous-chef"
}

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

pelikhan and others added 4 commits November 10, 2026 19:21
Preserve the concurrent budget-validation and capped-rendering regressions while retaining verified GitHub App support, start_private_fork, redacted previews, and expression-based unlimited budgets.

Co-authored-by: Copilot App <[email protected]>
Copilot AI and others added 2 commits November 11, 2026 03:41
…s' into pelikhan/security-advisory-drafts

# Conflicts:
#	pkg/workflow/safe_outputs_advisory_auth.go

Co-authored-by: gh-aw-bot <[email protected]>
@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. Fix failing check lint-go-govulncheck (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "2ef84c4051af0df705d3b48b99aa91ff10a63d5f",
  "kind": "requested",
  "schema_version": "1",
  "state": "034c24d4a1be42a487947f63c586e9e274632c825d810503de37abbf6f249dd2",
  "work": [
    "4ce4dd407e604d374ecd66edfd2afc18c54e2d0b3733dbac37ac8e9c8834fdba"
  ],
  "workflow": "pr-sous-chef"
}

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

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot ensure temporary ids resolution

Copilot AI commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@copilot

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

Merged latest main (99c2f327) and updated go.mod to Go 1.27.4 (02e32b22), where GO-2026-6859 is fixed. Build and impacted tests passed. Local govulncheck could not fetch vuln.go.dev due to sandbox DNS, so its result remains unverified; the final gate also reports existing custom-Go-linter findings in the advisory files. No CI was triggered.

Copilot AI commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@copilot ensure temporary ids resolution

The existing temporary-ID mapping resolves issue numbers created by create_issue; these advisory handlers use GHSA identifiers, not issue numbers. Did you mean temporary GHSA references so add-security-advisory-comment can target an advisory created earlier in the same run, or do you mean issue temporary-ID support in another safe output? Supporting the former needs a separate GHSA mapping and job dependency.

@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. Fix failing check impacted-go-tests (FAILURE): Check run.
  3. Fix failing check Unit tests (N-R) (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "02e32b2228b28318e3cb2a7703e8beaa566f275d",
  "kind": "requested",
  "schema_version": "1",
  "state": "b2d54fa847ca37c384da85ef03810961ff70dafcbabecd9ddddf7c7437d9290a",
  "work": [
    "42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
    "e9d7501fc834b70ac771af5e7694ba7f29ea683b65e0f01f096571f99da4b76f"
  ],
  "workflow": "pr-sous-chef"
}

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

Copilot AI commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@copilot

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

Merged current main (already up to date) and fixed both failures by aligning the repository Go baseline and all owned workflow/toolchain pins to 1.27.4 (a234b3b). The exact TestRepositoryGoToolingBaseline and targeted runtime/toolchain tests pass; final impacted Go and JS tests pass. No CI was triggered.

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

4 participants