ci: block PRs on ASH prompt-injection findings in prompt files#281
Merged
Conversation
Promote the custom prompt-injection Semgrep rules from advisory to a narrow blocking gate after a clean ~19-day burn-in (0 findings, 0 false positives). Enable ASH's flat-json reporter and add a gate step that parses reports/ash.flat.json. The gate only engages when a PR changes an in-scope AI prompt file (docs/ageai-*.md, .kiro/prompts/*.md), so unrelated PRs are unaffected. It blocks only on the four ERROR-severity rule IDs; the WARNING jailbreak rule and all other ASH findings stay advisory (PR comment). It fails closed when a prompt file changed but no parseable report exists (scan-did-not-run is not a clean pass), and honors inline 'nosemgrep: <rule-id>' suppressions via the finding is_suppressed flag. The gate runs after the artifact upload so the companion comment workflow still posts, and the ASH run step stays continue-on-error so scanner crashes never masquerade as a clean pass. Documented the blocking behavior and the suppression escape hatch in CONTRIBUTING.md.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Scan for commit: 🔒 Security Scan ResultsScanned files: 2 ✅ No security issues found. |
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.
Promote the custom prompt-injection Semgrep rules from advisory to a narrow blocking gate after a clean ~19-day burn-in (0 findings, 0 false positives). Enable ASH's flat-json reporter and add a gate step that parses reports/ash.flat.json.
The gate only engages when a PR changes an in-scope AI prompt file (docs/ageai-.md, .kiro/prompts/.md), so unrelated PRs are unaffected. It blocks only on the four ERROR-severity rule IDs; the WARNING jailbreak rule and all other ASH findings stay advisory (PR comment). It fails closed when a prompt file changed but no parseable report exists (scan-did-not-run is not a clean pass), and honors inline 'nosemgrep: ' suppressions via the finding is_suppressed flag.
The gate runs after the artifact upload so the companion comment workflow still posts, and the ASH run step stays continue-on-error so scanner crashes never masquerade as a clean pass. Documented the blocking behavior and the suppression escape hatch in CONTRIBUTING.md.
What does this PR do?
🛑 Please open an issue first to discuss any significant work and flesh out details/direction — we would hate for your time to be wasted.
Consult the CONTRIBUTING guide for submitting pull-requests.
Motivation
Type of Change
Testing
npm run buildsuccessfullynpm run testand all tests passnpx cdk synthwith a sample.env(e.g. fromblueprints/dummy/samples/) and it succeedsnpm run run-pre-commitNew Blueprint Checklist (if adding a protocol)
blueprints/dummy/(reference implementation).envfiles are provided for at least one network (mainnet or testnet)blueprints/dummy/)website/docs/blueprints/(.mdx mirror importing README)Documentation
cd website && npm run buildwith no broken links (if docs changed)License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.