Repository navigation
Add fail-closed authorization for safe outputs - #79029
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ 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.
|
|
✂️ Ponytail Reviewer has started processing this pull request |
|
✅ PR Code Quality Reviewer completed the code quality review. Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Detected threat types: prompt injection. Review the workflow run logs for details. PR Code Quality ReviewerOutcome: 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.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: 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.
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
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 the changed lines in the pre-fetched diff. No actionable correctness, security, or performance issues were identified. The grumpy-coder specialist pass was unavailable because its file-read attempt was denied; this review is based on independent static analysis only. No tests were run per the static-review instructions.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~6 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines) but does not have a linked Architecture Decision Record (ADR). 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs MatterADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors will rely on it when they revisit this design.
|
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
Overview
Reviewed PR head 0bd771ae1e12c3f041ced47627da795b9e781751 against the Safe Outputs MCP Gateway specification.
Findings and synchronization
The authorization feature adds a substantial normative contract in docs/src/content/docs/specs/safe-outputs-specification.md, but its metadata/changelog initially remained at Version 1.29.26 (2026-11-13). I synchronized the existing specification to Version 1.30.0, Publication Date 2026-11-18, and added a focused changelog entry covering authorization inheritance, staged behavior, fail-closed protocol, binding, evidence, and preserved AND-semantics obligations. The specification-only commit was queued for publication to the PR branch.
Coverage
No implementation or test files were changed. This was a static contract review; tests were not run. The prefetched patch was capped, so review relied on the complete changed-file metadata and the checked-out PR-head specification plus its authorization evidence.
Generated by PR Specification Reviewer for #79029 · copilot · gpt50 · ~6 AIC · ⌖ ~2 AIC · ⊞ 1.7K
Comment /review-specs to run again
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design (triage recommended architecture_change). Requesting changes on two fail-closed consistency gaps.
📋 Key Themes & Highlights
Key Themes
- Implicit fail-open path:
authorizeHandlerInvocationreturnsnot_configuredwhen no requirement is in scope, and callers gate onrequirementbefore calling it. Fail-closed then depends on every protected executor running under the manager wrapper. - Evidence path drift: the manager falls back to
/tmpwhenRUNNER_TEMPis unset, while the gate refuses. The same expression is repeated in several places.
Positive Highlights
- ✅ Authorization is consistently persisted with fsync before permission is returned.
- ✅ Staged mode skips authority calls cleanly.
- ✅ Go-side alias and conflict validation looks consistent.
Review Limits
- The pre-fetched patch is capped at 3000 lines, so later Go and handler hunks were checked against committed files, not the diff.
- The
text()regex in the patch is a descending range that fails to compile. The committed file at0bd771aeis valid, so this is treated as a patch artifact, not a finding. - Reachability of the queue-executor bypass was not fully traced within the review budget.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~14 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects allow staged jobs and outputs to perform live mutations and cause protected workflows to fail before authorization.
13 open issues
Use a Windows-compatible durable evidence writer · New Run setup before downloading the coverage report · New Apply staging guards to unprotected custom jobs · New Preserve no-authorization import behavior · New Preserve custom staging flags when authorization is disabled · New Annotate existing normalized custom-job entries · New Initialize shared globals before loading agent output · New Add the agent dependency for reusable-workflow artifact lookup · New Allow finite fractional numbers in invocation payloads · New Use effective staging state for preview rendering · New Include authorization journal in the existing artifact upload · New Upload launch authorization evidence from the gate runner · New Exclude authorization metadata from dynamic tool registration · New
What changed in this PR
Introduces opt-in external authorization for gh-aw safe outputs, extending the compiler and runtime with fail-closed execution gates.
Changes:
- Add global and per-output authorization configuration, inheritance checks, and compiler coverage metadata.
- Implement a bounded HTTPS/OIDC protocol with invocation bindings, freshness checks, and authorization evidence.
- Integrate gates and staged previews across executor paths, with focused tests and documentation.
| File | Description |
|---|---|
pkg/workflow/safe_update_manifest.go |
Add authorization coverage to manifests. |
pkg/workflow/safe_scripts.go |
Parse script authorization and staging. |
pkg/workflow/safe_outputs_permissions.go |
Account for authorization OIDC permissions. |
pkg/workflow/safe_outputs_jobs.go |
Configure standalone authorization permissions and evidence. |
pkg/workflow/safe_outputs_config_types.go |
Define authorization configuration fields. |
pkg/workflow/safe_outputs_config_runtime.go |
Include authorization in manager configuration. |
pkg/workflow/safe_outputs_config_generation.go |
Emit authorization runtime metadata. |
pkg/workflow/safe_outputs_config_extraction.go |
Extract and validate authorization declarations. |
pkg/workflow/safe_outputs_config_base.go |
Parse native per-output authorization. |
pkg/workflow/safe_outputs_authorization.go |
Resolve requirements and generate gates. |
pkg/workflow/safe_outputs_authorization_test.go |
Test compiler authorization behavior. |
pkg/workflow/safe_outputs_authorization_launch.go |
Generate reusable-workflow launch gates. |
pkg/workflow/safe_outputs_actions.go |
Gate generated custom-action steps. |
pkg/workflow/safe_outputs_actions_test.go |
Adapt tests to error-returning generation. |
pkg/workflow/safe_jobs.go |
Gate author steps in custom jobs. |
pkg/workflow/publish_code_coverage.go |
Authorize standalone coverage publication. |
pkg/workflow/publish_assets.go |
Supply asset authorization descriptors. |
pkg/workflow/imports.go |
Preserve imported authorization requirements. |
pkg/workflow/dispatch_repository.go |
Parse dispatch authorization requirements. |
pkg/workflow/compiler_yaml_header.go |
Populate manifest authorization coverage. |
pkg/workflow/compiler_work_queue_claim_adapters.go |
Gate prepared Claim-adapter execution. |
pkg/workflow/compiler_safe_outputs_steps.go |
Include authorization evidence in uploads. |
pkg/workflow/compiler_safe_outputs_job.go |
Wire permissions, action gates, and outputs. |
pkg/workflow/compiler_safe_outputs_envvars.go |
Emit authorization context variables. |
pkg/workflow/compiler_safe_output_jobs.go |
Register workflow-launch authorization jobs. |
pkg/workflow/compiler_orchestrator_workflow.go |
Resolve authorization after configuration merging. |
pkg/workflow/call_workflow_compilation_test.go |
Test generated launch dependencies and permissions. |
pkg/parser/schemas/main_workflow_schema.json |
Define authorization and custom staging schemas. |
pkg/parser/schema_safe_outputs_authorization_test.go |
Test accepted and rejected declarations. |
pkg/parser/schema_compiler.go |
Classify authorization as metadata. |
docs/src/content/docs/specs/safe-outputs-specification.md |
Specify authorization protocol and execution guarantees. |
docs/src/content/docs/reference/governance.md |
Explain configuration and enforcement boundaries. |
actions/setup/js/work_queue_upload_assets.cjs |
Authorize prepared queue asset writes. |
actions/setup/js/work_queue_prepare_claim_adapter.cjs |
Skip staged Claim preparation. |
actions/setup/js/work_queue_code_coverage.cjs |
Authorize coverage and recheck target revision. |
actions/setup/js/work_queue_claim_adapters.cjs |
Authorize prepared adapter effects. |
actions/setup/js/work_queue_authorization.test.cjs |
Test staged and denied adapter paths. |
actions/setup/js/upload_assets.cjs |
Authorize asset batches before publication. |
actions/setup/js/upload_assets_authorization.test.cjs |
Test asset authorization boundaries. |
actions/setup/js/upload_artifact.test.cjs |
Test denial and artifact-change protection. |
actions/setup/js/upload_artifact.cjs |
Bind authorization to prepared artifact bytes. |
actions/setup/js/types/safe-outputs-config.d.ts |
Type authorization and staging configuration. |
actions/setup/js/types/handler-factory.d.ts |
Define authorization requirements and evidence. |
actions/setup/js/safe_output_handler_manager_authorization.test.cjs |
Test manager authorization and initialization boundaries. |
actions/setup/js/safe_output_execution.cjs |
Track invocation context and project evidence. |
actions/setup/js/safe_output_authorization.test.cjs |
Test protocol validation, deadlines, and persistence. |
actions/setup/js/safe_output_authorization.cjs |
Implement the shared authorization protocol. |
actions/setup/js/safe_output_authorization_gate.test.cjs |
Test executor batches and artifact bindings. |
actions/setup/js/safe_output_authorization_gate.cjs |
Implement handler and external-executor gates. |
actions/setup/js/safe_output_action_handler.test.cjs |
Test staged payload-export suppression. |
actions/setup/js/safe_output_action_handler.cjs |
Suppress executable payloads during staging. |
actions/setup/js/call_workflow.test.cjs |
Test trusted launch bindings and ordinals. |
actions/setup/js/call_workflow.cjs |
Authorize workflow selection and export source ordinals. |
Review effort: Max (adaptive)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve imported policy without enabling implementations, enforce independent staging and trusted runtime contexts, and retain executor authorization evidence. Complete the ADR and specification metadata without claiming maintainer acceptance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "86956453ba1ff5b35a9b5a390486c114b157711e",
"kind": "requested",
"schema_version": "1",
"state": "81136aabb0f053521d1059830c4e855e70fc94cc8fc99b26421f4cc7daea70f6",
"work": [
"208a297ff0d131a0c9a6ee94209b99dba9583ef66c215dc9d60f4755d9169fed",
"20d4adf6985c8fa2c43670e8368779a6a508bde94669804d437c469e043f6a61",
"3706352358f3b79bb1603b731d287f0d2eb1699a21b42e49938342c46eb08383",
"42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
"4b91d79687a0f8420ef0c70ef75f6afbdfa85913d0b870df4f53f5cb8cf4a971",
"5328ab817d6cc89f14c63c7eb124fc832039b05a9f71d53577d0569587010890",
"6fcc6e4ac8ebafc0e8354f13e52a33d308ec2d023661f4fa3e71c090e2f0afdf",
"82c6c81849b5639c9d242bd9c64d366179a332cccd23597c087e8b4dbe97718e",
"86cf21ad40433d70ee89f629f6f03260efb99b8f9dcc9c866877a0a16d42fdf6",
"8b8e96afa57abc9c0b1273828ac899c27c0a396da52d9fa477a1de8b83e81d0b",
"9f159abe9fa571828836b67b17a4856ee33c0a9fee76358e5f4adabd1064caa8",
"a84796a338c3a5aa879389fa8bb0ffe2086e01d809c0aac01986664fcfb73225",
"bc52fc2bb750b4727c02e8ca114d8cd0baaf95751b589b6882ab17c8388b3b96",
"d9cc08d9273b4c5b8d8d29ecce0602e2a5a0920d5e3db1a3425b6dbafc01d7bc",
"db53c40c1b93959c39670a5b5ee8357fcb355bb4e92a094e1c54d55e1968da79",
"efd42ecaeea2bdae5f217f5a04b9ef3e235fc6945e1943f2e1accbd6aa10c7e3",
"f07c07e00eee1f93a301ad42d1c4a74d7bb186361fdd13c7250c0c7d353cc36f",
"f7883e8c8105930e955354caa741d783bcca067e66097fe9612fb72b90823998",
"ff5105b6b5778e44a169ae7d6b2f54370f40e21c303d4f60533175d0b767a980"
],
"workflow": "pr-sous-chef"
}
|
|
In response to this notification: Acknowledged as informational; no code change is needed. The no-action outcome is not evidence that required testing or publication succeeded. |
|
In response to this notification: Acknowledged as a processing notice, not a review result. No code change is needed for this notification. |
|
In response to this notification: Inspected the detection logs and retained the prompt-injection warning. Successful job status does not clear it; manual provenance review is still required. |
|
In response to this notification: Acknowledged the completed skills review. Its context-enforcement and evidence-path findings are addressed in this batch rather than treating this notification as validation. |
|
In response to this notification: Applied the missing specification update: Version 1.30.0, Publication Date 2026-11-18, and an authorization changelog entry. The earlier queued-update notice did not match the branch contents. |
|
In response to this notification: Preserved the generated ADR commit and reviewed the resulting document. Updated it without treating generation as maintainer approval. |
|
In response to this comment: Updated and linked the ADR with verified retrospective alternatives, current behavior, and explicit approval limitations. Status is Proposed because implementation approval does not establish maintainer acceptance. |
|
In response to this history record: Acknowledged as a zero-findings history ledger, not independent validation. It does not clear the associated threat warning. |
|
In response to this history record: The specification metadata and changelog update recorded by this ledger is now included in the batch commit. The history record alone was not treated as validation. |
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Preserve the compiler parsing boundary while rejecting invalid repository policy before YAML emission. Keep isolated MCP bundles free of authorization I/O through a trusted executor callback, and correct relative documentation links. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve first-attempt success without an ambient Actions core while retaining injected retry diagnostics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Describe gate attributes, phase-specific states and optional decision metadata, span emission conditions, and authorization telemetry privacy boundaries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


Why
Safe-output execution needs an opt-in external authorization boundary across native handlers, custom implementations, and generated executors, rather than a manager-only or merge-specific check.
Approach
withRetryfor bounded API calls with authorization replay explicitly disabled.Configuration examples
Repository-wide authorization through
aw.jsonand managed variablesEnable the requirement in
.github/workflows/aw.json, then recompile workflows:{ "safe_output_authorization": true }This loads the authority at runtime from
GH_AW_DEFAULT_SAFE_OUTPUT_AUTHORIZATION_URLandGH_AW_DEFAULT_SAFE_OUTPUT_AUTHORIZATION_AUDIENCE, managed throughgh aw env. Export existing defaults, add the following keys while retaining other fields, then update the same scope:gh aw env get defaults.yml --scope repo # Add the authorization keys above to defaults.yml, retaining existing fields. gh aw env update defaults.yml --scope repo gh aw compileUse
--scope org --org OWNERfor organization defaults. Repository variables take precedence, so protect variable administration independently.gh aw env updatereconciles all managed fields; omitted fields are deleted at the selected scope.Both authorization variables are required for live execution: missing or invalid values block outputs, rather than disabling authorization. Staged outputs still skip configuration resolution, credentials and authority calls. Changes to the
aw.jsonsetting require recompilation; changes to these runtime variables do not.Alternatively, bind a literal repository-wide authority in
aw.json:{ "safe_output_authorization": { "endpoint": "https://authority.example.org/api/safe-output-authorization", "audience": "https://authority.example.org/gh-aw-safe-outputs" } }Repository requirements apply after imports are merged and do not enable otherwise-disabled outputs. Conflicting repository, workflow or imported authorities fail compilation. An environment-backed repository authority cannot be proven identical to a literal workflow authority at compile time, so use one representation rather than combining them.
Workflow-wide authorization
Require authorization for every enabled non-builtin safe output:
Per-output authorization
Protect only one output by placing the requirement locally; the other output retains its existing execution behavior:
Staged preview
Preview protected outputs without OIDC or authority calls, execution Claims, or author-code initialization:
The same local
authorizationobject is supported under customscripts.<name>,actions.<name>, andjobs.<name>declarations. Identical literal global/local authorities resolve to one requirement; conflicting authorities and disabling overrides fail compilation. Global inheritance exempts only compiler-classifiednoop,report-missing-tool,report-missing-data, andreport-incompletediagnostics; an explicit local requirement still protects them.Review notes
Bindings remain invocation-level where native preparation or custom code does not independently resolve exact effects. Reusable-workflow authorization approves launch release, not downstream writes. Production use requires a separately provisioned conforming authority; this does not add a production policy service or organization-wide enforcement.
Protected live invocations on native Windows runners fail before credentials or authority requests because durable directory fsync is unsupported; staged and unprotected execution are unchanged. Imported authority follows normalized tool identity without automatically enabling imported implementations.
ADR: Require External Authorization for Safe-Output Execution. Status is Proposed; maintainer acceptance is not recorded. The earlier prompt-injection detection warning remains pending manual provenance review.
Validation
npm --prefix actions/setup/js run typecheckbefore this review batch.make agent-report-progress-no-test.make agent-report-progress-no-test.make agent-report-progressonce. Impacted Go and runtime tests passed; the full gate remains blocked by pre-existing custom-linter findings. New authorization lint findings were fixed and checked separately.