Skip to content

Enable external threat detection by default - #54111

Merged
pelikhan merged 5 commits into
mainfrom
copilot/enable-gh-aw-detection-true
Aug 20, 2026
Merged

Enable external threat detection by default#54111
pelikhan merged 5 commits into
mainfrom
copilot/enable-gh-aw-detection-true

Conversation

CopilotAI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

gh-aw-detection should default to the external threat-detection implementation while retaining a feature flag for legacy behavior.

  • Default behavior
    • Enable external threat-detect execution when the flag is omitted.
    • Preserve explicit false as the legacy inline detection path.
  • Compatibility
    • Update detection tests and fixtures to distinguish default and opt-out behavior.
    • Document the new default and artifact differences.
features:
gh-aw-detection: false # Opt into legacy inline detection

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot pin gh-aw-detection to https://github.com/github/gh-aw-threat-detection/releases/tag/v0.4.11 and going forward add it to the list of dependencies that get upgraded by the cli dependency updater agentic workflow.

CopilotAIand others added 2 commits August 20, 2026 01:14
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Excellent work on this threat detection refactor! 🎯

This PR successfully transitions the default threat detection behavior to use the external threat-detect binary while preserving backward compatibility with a feature flag. The implementation is well-structured and includes:

Comprehensive documentation — Feature flag behavior is clearly documented in feature-flags.md and threat-detection.md
Code updates — Constants and readme updated to reflect the new default
Lock file regeneration — All workflow lock files regenerated to maintain consistency
Backward compatible — Legacy inline detection remains accessible via features.gh-aw-detection: false

The scope is appropriately focused on this single concern (threat detection default), and the PR has a clear, actionable description.

As this is marked as a draft, it looks ready for team review when you're ready to move it forward. Great contribution to the codebase!

Generated by ✅ Contribution Check · auto · 56.4 AIC · ⌖ 6.63 AIC · ⊞ 9.2K ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

CopilotAI commented Aug 20, 2026

Copy link
Copy Markdown
ContributorAuthor

@copilot pin gh-aw-detection to https://github.com/github/gh-aw-threat-detection/releases/tag/v0.4.11 and going forward add it to the list of dependencies that get upgraded by the cli dependency updat...

Pinned DefaultThreatDetectVersion to v0.4.11, updated compiled workflows to use it, and added threat-detect release monitoring to the CLI version checker. Changes are in commit 2c68112 and the follow-up compiled-workflow pin commit.

@pelikhan
pelikhan marked this pull request as ready for review August 20, 2026 01:26
CopilotAI balanced review requested due to automatic review settings August 20, 2026 01:26
@pelikhan
pelikhan merged commit be23dc3 into mainAug 20, 2026
@pelikhan
pelikhan deleted the copilot/enable-gh-aw-detection-true branch August 20, 2026 01:27

CopilotAI 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

Makes external threat detection the default while retaining gh-aw-detection: false for legacy inline detection.

Changes:

  • Defaults detection to the external implementation and updates tests.
  • Pins threat-detect to v0.4.11 and regenerates workflows.
  • Updates feature, artifact, and version-monitoring documentation.
Show a summary per file
FileDescription
pkg/workflow/threat_detection_test.goOpts inline-path tests out.
pkg/workflow/threat_detection_isolation_test.goPreserves inline isolation fixtures.
pkg/workflow/threat_detection_file_access_test.goPreserves inline file-access tests.
pkg/workflow/features.goEnables external detection by default.
pkg/workflow/features_test.goTests default and opt-out behavior.
pkg/workflow/detection_success_test.goKeeps legacy success fixture inline.
pkg/workflow/compiler_validators.goSuppresses warnings for implicit defaults.
pkg/constants/version_constants.goPins detector v0.4.11.
pkg/constants/README.mdDocuments the new default.
pkg/constants/feature_constants.goUpdates flag documentation.
pkg/constants/constants.goUpdates result-path documentation.
docs/src/content/docs/reference/threat-detection.mdExplains implementation selection.
docs/src/content/docs/reference/feature-flags.mdDocuments the opt-out flag.
docs/src/content/docs/reference/artifacts.mdUpdates detection artifact guidance.
.github/workflows/typist.lock.ymlPins detector v0.4.11.
.github/workflows/tidy.lock.ymlRegenerates external detection steps.
.github/workflows/test-quality-sentinel.lock.ymlPins detector v0.4.11.
.github/workflows/technical-doc-writer.lock.ymlRegenerates external detection steps.
.github/workflows/static-analysis-report.lock.ymlPins detector v0.4.11.
.github/workflows/smoke-gemini.lock.ymlRegenerates external detection steps.
.github/workflows/refiner.lock.ymlRegenerates external detection steps.
.github/workflows/q.lock.ymlPins detector v0.4.11.
.github/workflows/prompt-clustering-analysis.lock.ymlPins detector v0.4.11.
.github/workflows/pr-sous-chef.lock.ymlPins detector v0.4.11.
.github/workflows/pr-description-caveman.lock.ymlPins detector v0.4.11.
.github/workflows/pr-code-quality-reviewer.lock.ymlPins detector v0.4.11.
.github/workflows/ponytail-reviewer.lock.ymlPins detector v0.4.11.
.github/workflows/mcp-inspector.lock.ymlPins detector v0.4.11.
.github/workflows/mattpocock-skills-reviewer.lock.ymlPins detector v0.4.11.
.github/workflows/issue-triage-agent.lock.ymlRegenerates external detection steps.
.github/workflows/issue-monster.lock.ymlPins detector v0.4.11.
.github/workflows/impeccable-skills-reviewer.lock.ymlPins detector v0.4.11.
.github/workflows/go-pattern-detector.lock.ymlPins detector v0.4.11.
.github/workflows/github-remote-mcp-auth-test.lock.ymlPins detector v0.4.11.
.github/workflows/github-mcp-structural-analysis.lock.ymlPins detector v0.4.11.
.github/workflows/example-workflow-analyzer.lock.ymlPins detector v0.4.11.
.github/workflows/eslint-monster.lock.ymlPins detector v0.4.11.
.github/workflows/duplicate-code-detector.lock.ymlPins detector v0.4.11.
.github/workflows/docs-noob-tester.lock.ymlPins detector v0.4.11.
.github/workflows/dev-hawk.lock.ymlPins detector v0.4.11.
.github/workflows/detection-analysis-report.lock.ymlPins detector v0.4.11.
.github/workflows/designer-drift-audit.lock.ymlPins detector v0.4.11.
.github/workflows/design-decision-gate.lock.ymlPins detector v0.4.11.
.github/workflows/deployment-incident-monitor.lock.ymlPins detector v0.4.11.
.github/workflows/dependabot-go-checker.lock.ymlPins detector v0.4.11.
.github/workflows/dependabot-burner.lock.ymlPins detector v0.4.11.
.github/workflows/delight.lock.ymlPins detector v0.4.11.
.github/workflows/deepsec-security-scan.lock.ymlPins detector v0.4.11.
.github/workflows/deep-report.lock.ymlPins detector v0.4.11.
.github/workflows/dataflow-pr-discussion-dataset.lock.ymlPins detector v0.4.11.
.github/workflows/daily-yamllint-fixer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-workflow-updater.lock.ymlPins detector v0.4.11.
.github/workflows/daily-windows-terminal-integration-builder.lock.ymlPins detector v0.4.11.
.github/workflows/daily-vulnhunter-scan.lock.ymlPins detector v0.4.11.
.github/workflows/daily-token-consumption-report.lock.ymlPins detector v0.4.11.
.github/workflows/daily-testify-uber-super-expert.lock.ymlPins detector v0.4.11.
.github/workflows/daily-team-evolution-insights.lock.ymlPins detector v0.4.11.
.github/workflows/daily-syntax-error-quality.lock.ymlPins detector v0.4.11.
.github/workflows/daily-squid-image-scan.lock.ymlPins detector v0.4.11.
.github/workflows/daily-spending-forecast.lock.ymlPins detector v0.4.11.
.github/workflows/daily-spec-coverage-kiro.lock.ymlPins detector v0.4.11.
.github/workflows/daily-spdd-spec-planner.lock.ymlPins detector v0.4.11.
.github/workflows/daily-semgrep-scan.lock.ymlPins detector v0.4.11.
.github/workflows/daily-security-red-team.lock.ymlPins detector v0.4.11.
.github/workflows/daily-security-observability.lock.ymlPins detector v0.4.11.
.github/workflows/daily-schema-audit-cursor.lock.ymlPins detector v0.4.11.
.github/workflows/daily-safeoutputs-git-simulator.lock.ymlPins detector v0.4.11.
.github/workflows/daily-safe-outputs-conformance.lock.ymlPins detector v0.4.11.
.github/workflows/daily-safe-output-optimizer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-safe-output-integrator.lock.ymlPins detector v0.4.11.
.github/workflows/daily-repo-chronicle.lock.ymlPins detector v0.4.11.
.github/workflows/daily-rendering-scripts-verifier.lock.ymlPins detector v0.4.11.
.github/workflows/daily-reliability-review.lock.ymlPins detector v0.4.11.
.github/workflows/daily-regulatory.lock.ymlPins detector v0.4.11.
.github/workflows/daily-regression-audit-kiro.lock.ymlPins detector v0.4.11.
.github/workflows/daily-pr-review-cursor.lock.ymlPins detector v0.4.11.
.github/workflows/daily-performance-summary.lock.ymlPins detector v0.4.11.
.github/workflows/daily-observability-report.lock.ymlPins detector v0.4.11.
.github/workflows/daily-news.lock.ymlPins detector v0.4.11.
.github/workflows/daily-multi-device-docs-tester.lock.ymlPins detector v0.4.11.
.github/workflows/daily-model-resolution.lock.ymlPins detector v0.4.11.
.github/workflows/daily-model-inventory.lock.ymlPins detector v0.4.11.
.github/workflows/daily-mcp-concurrency-analysis.lock.ymlPins detector v0.4.11.
.github/workflows/daily-max-ai-credits-test.lock.ymlPins detector v0.4.11.
.github/workflows/daily-issues-report.lock.ymlPins detector v0.4.11.
.github/workflows/daily-hippo-learn.lock.ymlPins detector v0.4.11.
.github/workflows/daily-graft-intelligence.lock.ymlPins detector v0.4.11.
.github/workflows/daily-go-test-stubs-aider.lock.ymlPins detector v0.4.11.
.github/workflows/daily-go-test-parallelizer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-geo-optimizer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-function-namer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-formal-spec-verifier.lock.ymlPins detector v0.4.11.
.github/workflows/daily-firewall-report.lock.ymlPins detector v0.4.11.
.github/workflows/daily-file-diet.lock.ymlPins detector v0.4.11.
.github/workflows/daily-fact.lock.ymlPins detector v0.4.11.
.github/workflows/daily-experiment-report.lock.ymlPins detector v0.4.11.
.github/workflows/daily-evals-report.lock.ymlPins detector v0.4.11.
.github/workflows/daily-elixir-credo-snippet-audit.lock.ymlPins detector v0.4.11.
.github/workflows/daily-doc-updater.lock.ymlPins detector v0.4.11.
.github/workflows/daily-doc-healer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-credit-limit-test.lock.ymlPins detector v0.4.11.
.github/workflows/daily-compiler-threat-spec-optimizer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-compiler-quality.lock.ymlPins detector v0.4.11.
.github/workflows/daily-community-attribution.lock.ymlPins detector v0.4.11.
.github/workflows/daily-code-metrics.lock.ymlPins detector v0.4.11.
.github/workflows/daily-code-debt-aider.lock.ymlPins detector v0.4.11.
.github/workflows/daily-cli-tools-tester.lock.ymlPins detector v0.4.11.
.github/workflows/daily-cli-performance.lock.ymlPins detector v0.4.11.
.github/workflows/daily-choice-test.lock.ymlPins detector v0.4.11.
.github/workflows/daily-caveman-optimizer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-cache-strategy-analyzer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-byok-ollama-test.lock.ymlPins detector v0.4.11.
.github/workflows/daily-awf-spec-compiler-surfacing.lock.ymlPins detector v0.4.11.
.github/workflows/daily-aw-cross-repo-compile-check.lock.ymlPins detector v0.4.11.
.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.ymlPins detector v0.4.11.
.github/workflows/daily-assign-issue-to-user.lock.ymlPins detector v0.4.11.
.github/workflows/daily-arxiv-researcher.lock.ymlPins detector v0.4.11.
.github/workflows/daily-architecture-diagram.lock.ymlPins detector v0.4.11.
.github/workflows/daily-ambient-context-optimizer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-agentrx-trace-optimizer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-agent-of-the-day-blog-writer.lock.ymlPins detector v0.4.11.
.github/workflows/daily-action-setup-security-audit.lock.ymlPins detector v0.4.11.
.github/workflows/craft.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-session-insights.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-pr-prompt-analysis.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-pr-nlp-analysis.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-pr-merged-report.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-opt.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-cli-deep-research.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-centralization-optimizer.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-centralization-drilldown.lock.ymlPins detector v0.4.11.
.github/workflows/copilot-agent-analysis.lock.ymlPins detector v0.4.11.
.github/workflows/contribution-check.lock.ymlPins detector v0.4.11.
.github/workflows/constraint-solving-potd.lock.ymlPins detector v0.4.11.
.github/workflows/commit-changes-analyzer.lock.ymlPins detector v0.4.11.
.github/workflows/code-scanning-fixer.lock.ymlPins detector v0.4.11.
.github/workflows/cloclo.lock.ymlPins detector v0.4.11.
.github/workflows/cli-version-checker.mdAdds detector release monitoring.
.github/workflows/cli-version-checker.lock.ymlRegenerates version-checker workflow.
.github/workflows/cli-consistency-checker.lock.ymlPins detector v0.4.11.
.github/workflows/claude-code-user-docs-review.lock.ymlPins detector v0.4.11.
.github/workflows/ci-doctor.lock.ymlPins detector v0.4.11.
.github/workflows/ci-coach.lock.ymlPins detector v0.4.11.
.github/workflows/chaos-pr-bundle-fuzzer.lock.ymlPins detector v0.4.11.
.github/workflows/changeset.lock.ymlPins detector v0.4.11.
.github/workflows/breaking-change-checker.lock.ymlPins detector v0.4.11.
.github/workflows/blog-auditor.lock.ymlPins detector v0.4.11.
.github/workflows/aw-failure-investigator.lock.ymlPins detector v0.4.11.
.github/workflows/avenger.lock.ymlPins detector v0.4.11.
.github/workflows/auto-triage-issues.lock.ymlPins detector v0.4.11.
.github/workflows/audit-workflows.lock.ymlPins detector v0.4.11.
.github/workflows/artifacts-summary.lock.ymlPins detector v0.4.11.
.github/workflows/archivx-agentic-workflows-analyzer.lock.ymlPins detector v0.4.11.
.github/workflows/architecture-guardian.lock.ymlPins detector v0.4.11.
.github/workflows/archie.lock.ymlPins detector v0.4.11.
.github/workflows/approach-validator.lock.ymlPins detector v0.4.11.
.github/workflows/api-consumption-report.lock.ymlPins detector v0.4.11.
.github/workflows/agentic-token-trend-audit.lock.ymlPins detector v0.4.11.
.github/workflows/agent-persona-explorer.lock.ymlPins detector v0.4.11.
.github/workflows/agent-performance-analyzer.lock.ymlPins detector v0.4.11.
.github/workflows/agent-job-health.lock.ymlPins detector v0.4.11.
.github/workflows/ab-testing-advisor.lock.ymlPins detector v0.4.11.
.github/skills/agentic-workflows/SKILL.mdAdds job guidance to workflow routing.

Review details

  • Files reviewed: 170/252 changed files
  • Comments generated: 2
  • Review effort level: Balanced

if isFeatureInEnvironment(flagLower, logEnabled) {
return true
}
return true
@@ -14,7 +14,7 @@ GitHub Agentic Workflows upload several artifacts during workflow execution. Thi
| `agent` | `constants.AgentArtifactName`<br/>Source: `pkg/constants/job_constants.go` | Multi-file | Unified agent job outputs (logs, safe outputs, token usage summary) |
| `activation` | `constants.ActivationArtifactName` | Multi-file | Activation job output (`aw_info.json`, `prompt.txt`, rate limits) |
| `firewall-audit-logs` | `constants.FirewallAuditArtifactName`<br/>Source: `pkg/constants/constants.go` | Multi-file | AWF firewall audit/observability logs (token usage, network policy, audit trail) |
| `detection` | `constants.DetectionArtifactName` | Conditional | Inline engine: single-file `detection.log`. External `gh-aw-detection` engine (`features: gh-aw-detection: true`): multi-file `detection_result.json` + `step-summary.md`; `detection.log` is intentionally **not** uploaded (see below) |
| `detection` | `constants.DetectionArtifactName` | Conditional | Legacy inline engine (`features.gh-aw-detection: false`): single-file `detection.log`. The default external `gh-aw-detection` engine: multi-file `detection_result.json` + `step-summary.md`; `detection.log` is intentionally **not** uploaded (see below) |
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.2

Sign up for freeto 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.

3 participants

@pelikhan