ci: scan issue and comment bodies — this repo has never scanned one
User description
This repo's public-repo-guard has never scanned a single issue or comment body.
Measured across all 28 public wave-av repos (wave-av/claude-workstation#1747, #1794): two coverage shapes satisfy the one required check name Secrets + content policy.
| repos | triggers | jobs |
|---|---|---|
| 27 | pull_request, push, workflow_dispatch | guard |
| 1 | + issues, issue_comment | + body-guard |
This repo is in the 27. All 28 report the same green check — because a required check asserts that something named X passed, never what X examined.
The outlier is wave-moq-edge, and its own comment says why it matters:
edited matters as much as opened: a body can be made to leak long after the PR is first raised, and until this workflow covered it, nothing ever re-scanned.
That gap was not theoretical there: a PR was blocked for naming a private repo in wrangler.toml while the very same name, with more operational detail attached, sat unchallenged in its body.
What lands
Three files — the bundle the workflow's own header names, minus what this repo already has (.gitleaks.toml and content-policy.sh are already vendored, and are checked as prerequisites; a repo missing either is refused rather than half-installed):
.github/workflows/public-repo-guard.yml replaced (72 -> 163 lines)
scripts/public-repo-guard/body-policy.sh new, mode 100755
scripts/public-repo-guard/tests/body-policy.test.sh new, mode 100755
The workflow's header names four files as the install unit but executes a fifth — tests/body-policy.test.sh, in its own self-test step. Omitting it installs a workflow that fails on a step nobody read, so the manifest ships it. Modes are preserved via the git trees API; the contents API creates 100644 regardless, which would silently break running these scripts as executables.
Planned by governance/lib/vendor-bundle.mjs (claude-workstation#1850) against a checked-in manifest, not by ad-hoc shell.
One deliberate divergence from the reference, stated rather than silent
The shipped workflow is wave-moq-edge's with actions/checkout bumped from v5.0.1 to v7.0.1 (3d3c42e5aac5ba805825da76410c181273ba90b1), the pin already used by claude-workstation's own gate.
Copying verbatim was checked first and rejected on evidence: of the 18 target repos, 17 carry a byte-identical guard, and wave-realtime-edge already runs v7.0.0 — so a verbatim copy would have downgraded it, and shipped a stale pin to the other 17. A separate PR brings the reference itself up to the same pin.
Honest about what this can and cannot do
On a PR this PREVENTS the merge. On an issue or comment the text is already public the moment it posts, so this is DETECTION: it says go redact, fast. Only a client-side pre-write hook stops that class before publication.
Also inherited from the reference: concurrency moves from workflow-level to per job, because the two jobs want opposite behaviour. A workflow-level group forced one policy on both, and rapid body edits cancelled the tree job repeatedly — every cancelled check-run stays attached to the commit, so the PR reported UNSTABLE while the live runs were green.
The body gate ships with its own fixtures and runs them in CI. Its negative cases are the load-bearing half: a leak gate that blocks legitimate cross-repo references gets switched off, and then it protects nothing.
Refs wave-av/claude-workstation#1747.
[!NOTE]
Medium Risk
Changes required-status CI behavior and merge gating on PR text; misconfigured GUARD_PRIVATE_REPOS or scanner failures fail closed and can block merges until fixed.
Overview
Closes a gap where only the published tree was scanned — PR/issue/comment/review text is now checked server-side via a new body-policy.sh and a separate public-repo-guard-body.yml workflow that materializes event payloads safely and runs the policy on titles/bodies (including edited events).
The tree workflow is reworked so the required "Secrets + content policy" check no longer runs (or publishes skipped) on comment/review events — a file-level split that fixes branch-protection masking when skipped runs overwrote real failures. The tree job also gains merge_group, per-job concurrency, actions/checkout v7.0.1, persist-credentials: false, and a pinned PCRE2 ripgrep install (replacing apt rg that broke -P rules). Fixture tests for body policy run from the tree job in CI.
body-policy.sh mirrors many tree leak rules but tunes them for prose (e.g. private-repo names only block when paired with operational detail on the same line, redacted annotations, fail-closed on scanner/empty GUARD_PRIVATE_REPOS in CI). body-policy.test.sh adds must-block, must-pass, and fail-closed coverage.
Reviewed by Cursor Bugbot for commit 882e9656fed2edded0094a3cacd59e2b4cfc9b53. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.
[!NOTE]
Scan PR/issue/comment/review bodies for credential and infrastructure leaks in CI
- Adds body-policy.sh, a new Bash scanner that checks materialized PR/issue/comment/review text for credential formats (Stripe, Anthropic, GitHub PATs, AWS keys, PEM headers) and private repo name proximity to operational keywords.
- Adds a new
body-guard CI job in public-repo-guard.yml triggered by issues, issue_comment, pull_request_review, and pull_request_review_comment events, with per-event concurrency keyed to the most specific object ID.
- Expands the existing
guard job triggers to include review events and body-policy fixture tests; adds PCRE2-capable ripgrep installation to prevent false scanner failures.
- Adds body-policy.test.sh covering must-block, must-pass, and fail-closed fixture cases.
- Risk: the scanner fails closed (exit 2) when
GUARD_PRIVATE_REPOS is unset in CI or when a non-PCRE2 rg is detected, blocking the check run.
Macroscope summarized c284c89.
Summary by Sourcery
Expand the public repository guard to scan all public conversation text while preserving reliable, merge-blocking tree checks.
New Features:
- Add CI coverage for scanning pull request, issue, comment, and review text for exposed credentials and internal infrastructure details.
- Introduce body-policy fixtures covering blocking detections, allowed references, redacted findings, and fail-closed behavior.
Bug Fixes:
- Prevent review and comment events from masking or bypassing the required published-tree security check.
Enhancements:
- Apply separate concurrency policies for tree scans and body scans so rapid updates do not discard required verdicts or body coverage.
- Make body scanning safer and more precise by materializing untrusted event text without shell interpolation, allowing ordinary cross-repository references, and failing closed on missing configuration or scanner errors.
Build:
- Pin and checksum-verify a PCRE2-capable ripgrep binary for policy scans.
- Upgrade the workflow checkout action to v7.0.1.
CI:
- Add a dedicated body-guard workflow for pull request, issue, comment, and review events, including edits.
- Run body-policy fixture tests as part of the existing repository guard workflow.
Tests:
- Add comprehensive body-policy tests for secret formats, infrastructure identifiers, private-repository operational detail, allowlists, false-positive protections, and failure handling.
CodeAnt-AI Description
Scan public PR, issue, and comment text for internal leaks
What Changed
- Added a body-content scan for pull request titles and bodies, issue text, comments, inline review comments, and submitted reviews
- Blocks exposed credentials, private infrastructure details, operator file paths, internal-only markers, and private repository names paired with operational details
- Re-scans edited content and keeps each event’s verdict separate so body checks cannot mask the required source-tree scan
- Fails closed when scanning tools, event data, or private-repository configuration is missing or broken, without printing matched secrets in workflow logs
- Added fixture coverage for detected leaks, safe documentation references, allowlisted examples, configuration formats, and scanner failures
- Keeps the required tree scan limited to tree-changing events and adds merge-queue coverage
Impact
✅ Fewer internal leaks in public PRs and discussions
✅ Edited comments and reviews are rescanned
✅ Required tree-scan results cannot be masked by skipped body events
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
@codeant-ai ask: Your question here
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
@codeant-ai ask: Can you suggest a safer alternative to storing this secret?
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
@codeant-ai: Your feedback here
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
@codeant-ai: Do not flag unused imports.
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
@codeant-ai: review
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.