fix(conformance): fix WTD-001/WTD-002 false-positives on centralized threat-detection label string - #49753
Merged
Merged
Conversation
…threat-detection label string Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix false positives in conformance checker for label string
fix(conformance): fix WTD-001/WTD-002 false-positives on centralized threat-detection label string
Aug 2, 2026
pelikhan
marked this pull request as ready for review
August 2, 2026 11:16
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes false positives in WTD-001 and WTD-002 conformance checks by recognizing centralized threat-warning sources.
Changes:
- Adds template/helper fallback validation for WTD-001.
- Adds helper delegation validation for WTD-002.
Show a summary per file
| File | Description |
|---|---|
scripts/check-safe-outputs-conformance.sh |
Recognizes centralized threat-detection label generation. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Balanced
Comment on lines
+1353
to
+1357
| if [ -f "$caution_template" ] && grep -q "agentic threat detected" "$caution_template" 2>/dev/null; then | ||
| label_found=1 | ||
| elif [ -f "$threat_warning_file" ] && grep -q "agentic threat detected" "$threat_warning_file" 2>/dev/null; then | ||
| label_found=1 | ||
| fi |
Comment on lines
+1421
to
+1423
| elif grep -q "getThreatWarningPresentation" "$push_handler" 2>/dev/null; then | ||
| local threat_warning_file="actions/setup/js/threat_detection_warning.cjs" | ||
| if [ -f "$threat_warning_file" ] && grep -q "agentic threat detected" "$threat_warning_file" 2>/dev/null; then |
Contributor
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The conformance checker incorrectly reports CRITICAL/HIGH failures for WTD-001 (req 2) and WTD-002 because it greps handler
.cjsfiles for the literal string"agentic threat detected", which is never verbatim in those files — it lives in the centralizedthreat_detection_warning.cjshelper andthreat_detection_caution.mdtemplate, reached via delegation.Changes
scripts/check-safe-outputs-conformance.shWTD-001 req 2 (
check_wtd_reviewable_annotation): replaces the direct grep ongenerate_footer.cjswith a fallback chain matching the pattern already used for req 3 (the XML marker check): if the string isn't literal in the footer, accept it when the footer referencesthreat_detection_cautionviarenderTemplateFromFileand the string is present inthreat_detection_caution.mdorthreat_detection_warning.cjs.WTD-002 (
check_wtd_convertible_fallback): adds an equivalent fallback — if"agentic threat detected"isn't literal inpush_to_pull_request_branch.cjs, accept it when the handler callsgetThreatWarningPresentationand the string is present inthreat_detection_warning.cjs.No changes to handler source files — the centralized-template approach is intentional.