Require successful redaction for all agent artifact uploads by pelikhan · Pull Request #70875 · github/gh-aw · GitHub
Skip to content

Require successful redaction for all agent artifact uploads - #70875

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan-vigilant-robot
Oct 21, 2026
Merged

pelikhan merged 3 commits into
mainfrom
pelikhan-vigilant-robot

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Require successful built-in redaction and every configured custom masking hook before either agent or agent-output-fallback uploads, including workflows without AWF or custom artifact paths.
  • Reuse the existing outcome-based condition, so failed, skipped, cancelled, or missing redactors block uploads even when a custom hook uses continue-on-error. An engine failure alone still permits diagnostic uploads after successful redaction.
  • Extend the regression matrix across firewall configurations and custom-hook outcomes; assert exactly one tracked redaction step and ordering before uploads. Update artifact documentation and add a patch changeset.
  • Remove the now-unused hasSafeJobArtifactPaths helper identified in review. Full-package unused-only lint, without diff filtering, reports zero issues.

ADR: ADR-70875: Require Successful Redaction for All Agent Artifact Uploads

The ADR is finalized as Proposed for maintainer acceptance. It records the rationale, alternatives, fail-closed trade-offs, and limitations rather than claiming to solve the underlying runtime failures.

Investigation and scope

Refs #69800 and #69180; this PR intentionally does not close either historical report automatically.

Validation

  • make build and PATH="/opt/homebrew/bin:$PATH" make fmt passed.
  • Focused Go coverage passed: go test ./pkg/workflow -run 'TestCustomSecretMasking(StepIDs|UploadGates|WorkQueueUploadGates)$|TestAgentOutputFallbackArtifact|TestAgentArtifactExcludesUserGeneratedDirectory' -count=1, including after the review cleanup.
  • Six focused safe-job/artifact tests and full-package golangci-lint run --enable-only unused ./pkg/workflow passed for the review cleanup, without diff filtering.
  • make agent-report-progress ran impacted unit tests successfully once. Schema freshness and change-scoped custom Go lint passed.
  • golangci-lint run --timeout=30m --concurrency=2 --allow-parallel-runners --new-from-rev=HEAD ./pkg/workflow passed with zero new issues before the initial implementation commit. Review correctly identified that diff-only lint did not catch the subsequently removed unused helper.
  • make check-workflow-drift passed and restored all generated files.
  • Repository gate limitation: initial pre-PR wrapper runs were nonzero because the wrapper treats the existing Found unknown linters in //nolint directives: largefunc, uncheckedsliceindex warning as a non-diagnostic failure while filtering unchanged-file findings. Attempts also encountered a shared linter lock and timeout. This is not presented as a fully green wrapper run.

Security review

A single read-only reviewer passed all ten scoped safety questions for the production changes and authored documentation, with no confirmed vulnerabilities. Their reviewed upload-generator and artifact-reference hashes still match the committed content. Afterwards, only test indentation and a compile-only fixture's required threat-detection: false setting changed; runtime tools rejected follow-up to the synchronous reviewer, so the corrected fixture has passing local coverage but no renewed reviewer verdict. No replacement reviewer or live execution was used. The review-follow-up batch removes dead code and finalizes the non-executable ADR; it does not change the upload guards.

Authored Markdown documents the stronger upload eligibility and its rationale, and announces it in the patch changeset; it introduces no executable permissions, credential destinations, or sandbox exceptions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 21, 2026 12:03
Copilot AI max review requested due to automatic review settings October 21, 2026 12:03
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Oct 21, 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 Oct 21, 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.

Commit pushed: 3e34492

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 21, 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 · haiku45 · 5.19 AIC · ⌖ 8.29 AIC · ◇ 2.52 AIC · ⊞ 9.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 21, 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 · gpt56 · 6.72 AIC · ⌖ 5.4 AIC · ⊞ 14.8K · ◷

Generated by Ponytail Reviewer for #70875

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Design Decision Gate — ADR Required

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

📄 Draft ADR committed: docs/adr/70875-require-successful-redaction-for-all-agent-artifact-uploads.md. Review and complete it before merging.

Decision captured: the agent and agent-output-fallback uploads now always require steps.redact_secrets and every custom secret-masking step to have outcome == 'success'. This replaces the old gating, which only applied when AWF was enabled, when certain paths were present, or when safe-job or work-queue artifacts existed (pkg/workflow/compiler_yaml_artifacts.go, compiler_yaml_post_agent.go).

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

📋 What to do next
  1. Review the draft ADR on your branch. It was generated from the PR diff.
  2. Complete the missing sections. Add context the AI couldn't infer, refine the decision rationale, and list the alternatives you actually considered.
  3. Commit the finalized ADR to docs/adr/ on your branch.
  4. Reference the ADR in this PR body by adding a line such as:

    ADR: ADR-70875: Require Successful Redaction for All Agent Artifact Uploads

Once an ADR is linked in the PR body, this gate will re-run and check 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, and your future self, will thank you.

📋 Michael Nygard ADR Format Reference

An ADR must contain these four sections to be considered 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/ as Markdown files numbered by PR number.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · opus55 · 26.7 AIC · ⌖ 40.5 AIC · ⊞ 1.9K · ◷
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.

Review summary

No actionable blocking issues found in the changed lines. The artifact gating change is internally consistent with the documented security requirement, and the updated tests cover AWF/no-AWF configurations plus custom redaction outcomes. I did not run code or tests per the static-review constraint.

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

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd per pr-triage classification (bug_fix). The fix is sound: redact_secrets is unconditionally emitted in the agent job, so always gating on secretRedactionSuccessCondition(data) is correct and closes the real gap (no-AWF workflows previously skipped the gate). Test coverage is strong — the new sandbox/tc nested matrix exercises both AWF and non-AWF paths against every hook outcome, and asserts exactly one redact_secrets step id, which is exactly the kind of regression-test discipline /tdd calls for.

📋 Key Themes & Highlights

Key Themes

  • One actionable finding: removing the requireSuccessfulRedaction parameter also removed the last caller of hasSafeJobArtifactPaths (pkg/workflow/safe_jobs.go:285), leaving it unused dead code. Flagged inline on compiler_yaml_post_agent.go:306.
  • No other logic gaps found in the diff: generateAgentOutputFallbackUpload and generateUnifiedArtifactUpload both now apply the same unconditional condition, and the doc update in artifacts.md accurately describes the new behavior.

Positive Highlights

  • ✅ Good regression-test restructuring: wrapping the existing table in an outer sandbox table instead of duplicating cases keeps the matrix DRY while doubling coverage.
  • ✅ The PR body is unusually careful about scope (explicitly not claiming to fix the heap-exhaustion/permission issues referenced in #69800/#69180), which is exactly the kind of precise root-cause framing /diagnosing-bugs encourages.
  • ✅ Simplification of generateUnifiedArtifactUpload's signature (dropping the boolean parameter) is a net readability win.

No blocking issues; the dead-code cleanup is a nice-to-have, not a correctness concern.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 54.2 AIC · ⌖ 13.9 AIC · ⊞ 10.2K
Comment /matt to run again

Comment thread pkg/workflow/compiler_yaml_post_agent.go

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

An unused helper introduces a full-scan lint failure that diff-only checks miss.

1 open issue
What changed in this PR

This PR makes agent artifact uploads require successful built-in and custom redaction, including workflows without the agent firewall.

Changes:

  • Apply the redaction guard to both upload paths.
  • Expand regression coverage across firewall configurations and hook outcomes.
  • Document upload eligibility and add a patch changeset.
File Description
pkg/​workflow/​redaction_upload_gating_test.go Expands redaction-gate regression coverage.
pkg/​workflow/​compiler_yaml_post_agent.go Updates the unified upload call.
pkg/​workflow/​compiler_yaml_artifacts.go Requires successful redaction for both uploads.
docs/​src/​content/​docs/​reference/​artifacts.md Documents upload eligibility.
.changeset/​patch-gate-all-agent-uploads-on-redaction.md Adds a patch release note.

Review effort: Max

Comment thread pkg/workflow/compiler_yaml_post_agent.go
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reply to comment 6315455518:

No additional change is needed for this completion notice; the review summary reports no actionable blocking issues. The separately reported unused helper was removed in this batch.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reply to comment 6315455545:

Accepted the actionable finding from the skills-based review: removed the unused hasSafeJobArtifactPaths helper. The unconditional redaction guards and their existing outcome coverage are unchanged.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reply to comment 6315457732:

Accepted the ADR follow-up: reviewed and completed the bot-authored draft with the decision rationale, alternatives, and consequences. The finalized ADR is now linked in the PR body.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reply to comment 6315460172:

No additional code change is needed for this reported_no_action notice because it contains no specific test finding. The existing AWF/no-AWF and custom-hook outcome regressions are retained.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

Reply to comment 6315462457:

No change is needed for this reported_no_action notice because it contains no actionable finding. It is not treated as proof of correctness; the batch is checked independently.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@pelikhan
pelikhan merged commit 1092311 into main Oct 21, 2026
56 checks passed
@pelikhan
pelikhan deleted the pelikhan-vigilant-robot branch October 21, 2026 14:10
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.

2 participants