Skip to content

fix(threat-detection): stop uploading detection.log for external gh-aw-detection path - #51233

Merged
pelikhan merged 7 commits into
mainfrom
ace/01KZF5H4KGDQV24EKF5GQXSG7A
Aug 8, 2026
Merged

fix(threat-detection): stop uploading detection.log for external gh-aw-detection path#51233
pelikhan merged 7 commits into
mainfrom
ace/01KZF5H4KGDQV24EKF5GQXSG7A

Conversation

@davidslater

@davidslater davidslater commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Created by GitHub Ace · View Session

Problem

For the external gh-aw-detection engine path (features: gh-aw-detection: true), the "Upload threat detection artifact" step uploaded detection.log alongside detection_result.json. That log can contain the full untrusted agent transcript/output fed into the detection engine — including any secrets the agent may have echoed — so persisting it as a downloadable workflow artifact was a secret-exfiltration path.

Fix

buildUploadDetectionArtifactStep (external-detector path only) no longer includes constants.ThreatDetectionLogPath in the artifact's path: list. The detection artifact on this path now only contains:

  • detection_result.json (structured verdict)
  • step-summary.md

The inline detection path (buildUploadDetectionLogStep, used by default without the feature flag) is unchanged — it still uploads detection.log, since that path doesn't have the same untrusted-transcript-in-log concern (out of scope for this change; not raised by the user).

Validation that nothing else depends on detection.log

  • Downstream GitHub Actions jobs never download the detection artifact — they only read needs.detection.outputs.* and needs.detection.result (job outputs/conclusion), which are set from detection_result.json via the in-job conclude step, not from the uploaded artifact.
  • No other job in the compiled workflows runs actions/download-artifact for the detection artifact.
  • The only consumer of the detection artifact set is the gh aw logs/gh aw audit CLI (ArtifactSetDetection), used for optional human diagnostics — this remains functional, it will just no longer surface the raw log for this path.
  • Confirmed via if-no-files-found: ignore that omitting the path doesn't cause upload failures.

Changes

  • pkg/workflow/threat_detection_external.go: removed detection.log from the upload path list + updated doc comment.
  • pkg/workflow/threat_detection_isolation_test.go: added assertion that the external-detector upload step does NOT include detection.log.
  • docs/src/content/docs/reference/artifacts.md: documented the exception for the external-detector path.
  • Recompiled all 100 affected .lock.yml workflows that use features: gh-aw-detection: true.

Testing

  • go build ./... — passes
  • go test ./pkg/workflow/... ./pkg/cli/... — all pass
  • gh-aw compile --validate --verbose --purge — all 283 workflows compiled successfully

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.1 AIC · ⊞ 8.5K ·
Comment /souschef to run again

…w-detection path

The external threat-detect engine's raw log (detection.log) can contain
the full untrusted agent transcript passed to the detection engine,
including any secrets the agent may have echoed. Uploading it as a
downloadable workflow artifact created a secret-exfiltration path.

The `detection` artifact now only contains detection_result.json (the
structured verdict) and the step-summary on the external-detector path.
Neither GitHub Actions jobs nor the CLI rely on detection.log contents:
downstream jobs consume only needs.detection.outputs.*/result, and the
CLI's `detection` artifact set is used purely for optional human
diagnostics via `gh aw logs`/`audit`.

Recompiled all 100 affected .lock.yml workflows using the
gh-aw-detection feature.

Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 7, 2026 23:04

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.

Pull request overview

Prevents external threat-detection workflows from persisting potentially sensitive detection.log output while retaining structured verdict and summary artifacts.

Changes:

  • Removes detection.log from external-detector artifact uploads.
  • Adds regression coverage and updates artifact documentation.
  • Recompiles 100 affected workflow lock files.
Show a summary per file
File Description
pkg/workflow/threat_detection_external.go Excludes the raw detection log from external-detector artifacts.
pkg/workflow/threat_detection_isolation_test.go Tests that external uploads omit the raw log.
docs/src/content/docs/reference/artifacts.md Documents external-detector artifact contents.
.github/workflows/typist.lock.yml Regenerated detection upload path.
.github/workflows/test-quality-sentinel.lock.yml Regenerated detection upload path.
.github/workflows/prompt-clustering-analysis.lock.yml Regenerated detection upload path.
.github/workflows/pr-sous-chef.lock.yml Regenerated detection upload path.
.github/workflows/pr-description-caveman.lock.yml Regenerated detection upload path.
.github/workflows/pr-code-quality-reviewer.lock.yml Regenerated detection upload path.
.github/workflows/mattpocock-skills-reviewer.lock.yml Regenerated detection upload path.
.github/workflows/issue-monster.lock.yml Regenerated detection upload path.
.github/workflows/impeccable-skills-reviewer.lock.yml Regenerated detection upload path.
.github/workflows/github-remote-mcp-auth-test.lock.yml Regenerated detection upload path.
.github/workflows/github-mcp-structural-analysis.lock.yml Regenerated detection upload path.
.github/workflows/example-workflow-analyzer.lock.yml Regenerated detection upload path.
.github/workflows/duplicate-code-detector.lock.yml Regenerated detection upload path.
.github/workflows/docs-noob-tester.lock.yml Regenerated detection upload path.
.github/workflows/detection-analysis-report.lock.yml Regenerated detection upload path.
.github/workflows/design-decision-gate.lock.yml Regenerated detection upload path.
.github/workflows/deployment-incident-monitor.lock.yml Regenerated detection upload path.
.github/workflows/deep-report.lock.yml Regenerated detection upload path.
.github/workflows/daily-token-consumption-report.lock.yml Regenerated detection upload path.
.github/workflows/daily-testify-uber-super-expert.lock.yml Regenerated detection upload path.
.github/workflows/daily-repo-chronicle.lock.yml Regenerated detection upload path.
.github/workflows/daily-rendering-scripts-verifier.lock.yml Regenerated detection upload path.
.github/workflows/daily-reliability-review.lock.yml Regenerated detection upload path.
.github/workflows/daily-regulatory.lock.yml Regenerated detection upload path.
.github/workflows/daily-performance-summary.lock.yml Regenerated detection upload path.
.github/workflows/daily-observability-report.lock.yml Regenerated detection upload path.
.github/workflows/daily-news.lock.yml Regenerated detection upload path.
.github/workflows/daily-multi-device-docs-tester.lock.yml Regenerated detection upload path.
.github/workflows/daily-model-resolution.lock.yml Regenerated detection upload path.
.github/workflows/daily-model-inventory.lock.yml Regenerated detection upload path.
.github/workflows/daily-mcp-concurrency-analysis.lock.yml Regenerated detection upload path.
.github/workflows/daily-max-ai-credits-test.lock.yml Regenerated detection upload path.
.github/workflows/daily-issues-report.lock.yml Regenerated detection upload path.
.github/workflows/daily-hippo-learn.lock.yml Regenerated detection upload path.
.github/workflows/daily-graft-intelligence.lock.yml Regenerated detection upload path.
.github/workflows/daily-geo-optimizer.lock.yml Regenerated detection upload path.
.github/workflows/daily-function-namer.lock.yml Regenerated detection upload path.
.github/workflows/daily-formal-spec-verifier.lock.yml Regenerated detection upload path.
.github/workflows/daily-file-diet.lock.yml Regenerated detection upload path.
.github/workflows/daily-fact.lock.yml Regenerated detection upload path.
.github/workflows/daily-experiment-report.lock.yml Regenerated detection upload path.
.github/workflows/daily-evals-report.lock.yml Regenerated detection upload path.
.github/workflows/daily-elixir-credo-snippet-audit.lock.yml Regenerated detection upload path.
.github/workflows/daily-doc-updater.lock.yml Regenerated detection upload path.
.github/workflows/daily-doc-healer.lock.yml Regenerated detection upload path.
.github/workflows/daily-credit-limit-test.lock.yml Regenerated detection upload path.
.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml Regenerated detection upload path.
.github/workflows/daily-compiler-quality.lock.yml Regenerated detection upload path.
.github/workflows/daily-community-attribution.lock.yml Regenerated detection upload path.
.github/workflows/daily-code-metrics.lock.yml Regenerated detection upload path.
.github/workflows/daily-cli-tools-tester.lock.yml Regenerated detection upload path.
.github/workflows/daily-cli-performance.lock.yml Regenerated detection upload path.
.github/workflows/daily-choice-test.lock.yml Regenerated detection upload path.
.github/workflows/daily-caveman-optimizer.lock.yml Regenerated detection upload path.
.github/workflows/daily-cache-strategy-analyzer.lock.yml Regenerated detection upload path.
.github/workflows/daily-byok-ollama-test.lock.yml Regenerated detection upload path.
.github/workflows/daily-awf-spec-compiler-surfacing.lock.yml Regenerated detection upload path.
.github/workflows/daily-aw-cross-repo-compile-check.lock.yml Regenerated detection upload path.
.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml Regenerated detection upload path.
.github/workflows/daily-assign-issue-to-user.lock.yml Regenerated detection upload path.
.github/workflows/daily-architecture-diagram.lock.yml Regenerated detection upload path.
.github/workflows/daily-ambient-context-optimizer.lock.yml Regenerated detection upload path.
.github/workflows/daily-agentrx-trace-optimizer.lock.yml Regenerated detection upload path.
.github/workflows/daily-agent-of-the-day-blog-writer.lock.yml Regenerated detection upload path.
.github/workflows/craft.lock.yml Regenerated detection upload path.
.github/workflows/copilot-session-insights.lock.yml Regenerated detection upload path.
.github/workflows/copilot-pr-prompt-analysis.lock.yml Regenerated detection upload path.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Regenerated detection upload path.
.github/workflows/copilot-pr-merged-report.lock.yml Regenerated detection upload path.
.github/workflows/copilot-opt.lock.yml Regenerated detection upload path.
.github/workflows/copilot-cli-deep-research.lock.yml Regenerated detection upload path.
.github/workflows/copilot-agent-analysis.lock.yml Regenerated detection upload path.
.github/workflows/contribution-check.lock.yml Regenerated detection upload path.
.github/workflows/constraint-solving-potd.lock.yml Regenerated detection upload path.
.github/workflows/commit-changes-analyzer.lock.yml Regenerated detection upload path.
.github/workflows/code-scanning-fixer.lock.yml Regenerated detection upload path.
.github/workflows/cloclo.lock.yml Regenerated detection upload path.
.github/workflows/cli-version-checker.lock.yml Regenerated detection upload path.
.github/workflows/cli-consistency-checker.lock.yml Regenerated detection upload path.
.github/workflows/claude-code-user-docs-review.lock.yml Regenerated detection upload path.
.github/workflows/ci-doctor.lock.yml Regenerated detection upload path.
.github/workflows/ci-coach.lock.yml Regenerated detection upload path.
.github/workflows/chaos-pr-bundle-fuzzer.lock.yml Regenerated detection upload path.
.github/workflows/changeset.lock.yml Regenerated detection upload path.
.github/workflows/breaking-change-checker.lock.yml Regenerated detection upload path.
.github/workflows/blog-auditor.lock.yml Regenerated detection upload path.
.github/workflows/aw-failure-investigator.lock.yml Regenerated detection upload path.
.github/workflows/avenger.lock.yml Regenerated detection upload path.
.github/workflows/auto-triage-issues.lock.yml Regenerated detection upload path.
.github/workflows/audit-workflows.lock.yml Regenerated detection upload path.
.github/workflows/artifacts-summary.lock.yml Regenerated detection upload path.
.github/workflows/archivx-agentic-workflows-analyzer.lock.yml Regenerated detection upload path.
.github/workflows/architecture-guardian.lock.yml Regenerated detection upload path.
.github/workflows/archie.lock.yml Regenerated detection upload path.
.github/workflows/approach-validator.lock.yml Regenerated detection upload path.
.github/workflows/api-consumption-report.lock.yml Regenerated detection upload path.
.github/workflows/agentic-token-trend-audit.lock.yml Regenerated detection upload path.
.github/workflows/agent-persona-explorer.lock.yml Regenerated detection upload path.
.github/workflows/agent-performance-analyzer.lock.yml Regenerated detection upload path.
.github/workflows/ab-testing-advisor.lock.yml Regenerated detection upload path.

Review details

Tip

Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 103/103 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread docs/src/content/docs/reference/artifacts.md Outdated
GitHub Ace and others added 3 commits August 7, 2026 23:14
…-detector path

Address review feedback: the `detection` artifact table entry said
"Single-file" unconditionally, which contradicted the exception noted
in the same row (external gh-aw-detection engine omits detection.log
but still uploads detection_result.json + step-summary, i.e. 2 files).
Split the Type column by engine path and updated the flattening
guidance below the naming-compatibility table to call out `detection`
as multi-file when produced by the external gh-aw-detection engine.

Also revert the .lock.yml regeneration from the previous commit per
review feedback — keeping this PR scoped to the compiler/docs/test
change; workflow lock files will be regenerated separately.

Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>
…rnal gh-aw-detection path

The detection step-summary file (step-summary.md) can contain content
derived from the untrusted agent transcript that was passed to the
detection engine, the same secret-exfiltration concern that applied to
detection.log. It was already being appended directly to the job's
$GITHUB_STEP_SUMMARY by buildDetectionStepSummaryAppendStep, so
uploading it separately as an artifact was redundant as well as risky.

The external-detector `detection` artifact now contains only
detection_result.json (the structured verdict).

Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage nudge for this PR.

Please refresh the branch if needed, check for any unresolved reviewer feedback, run the pr-finisher skill, and hand back to maintainers once the PR is ready.

Run: https://github.com/github/gh-aw/actions/runs/31227649983

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.1 AIC · ⊞ 8.5K ·
Comment /souschef to run again

GitHub Ace and others added 3 commits August 7, 2026 23:44
…r external detector

The upstream threat-detect binary removed the --step-summary flag entirely
in v0.4.5 (github/gh-aw-threat-detection#792): it no longer writes any
step-summary output. Our compiler was still:

  - passing --step-summary <path> to threat-detect (now a stale, unused arg)
  - resetting/touching ThreatDetectionStepSummaryPath before execution on the
    external-detector path (dead code — nothing writes to it anymore)
  - emitting an "Append detection step summary" host-side step to copy that
    file into $GITHUB_STEP_SUMMARY (always a no-op now, since the file is
    never populated)

Removed all three. The step-summary reset/touch is now scoped to the inline
detection path only, where the engine's own execution step still overrides
GITHUB_STEP_SUMMARY to write there. Updated the isolation test to assert
these are absent on the external-detector path, and updated docs.

Co-authored-by: David Slater <12449447+davidslater@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@copilot Quick triage nudge for this PR.

Please refresh the branch if needed, check for any unresolved reviewer feedback, run the pr-finisher skill, and hand back to maintainers once the PR is read...

Addressed the remaining reviewer feedback in 683daae. I also recompiled the affected lockfiles and reran local validation: make agent-report-progress-no-test passed, make test-unit passed, and make test passed. make lint still reports two unrelated pre-existing issues in pkg/cli/codemod_bash_allowlist_unsupported_engine.go, so CI on this agent-pushed HEAD still needs a maintainer re-trigger before merge.

Copilot AI requested a review from gh-aw-bot August 8, 2026 00:08
@pelikhan
pelikhan merged commit 51bc067 into main Aug 8, 2026
29 checks passed
@pelikhan
pelikhan deleted the ace/01KZF5H4KGDQV24EKF5GQXSG7A branch August 8, 2026 00:11
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.2

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.

5 participants