Repository navigation
Harden secret scanning of agent-authored issue context and PR descriptions #1673
Description
What happens
The code post-script publishes agent-authored text in two places:
- On a clean no-commit exit,
post_noop_commentreadspr_bodyand posts it
as "Agent context" on the source GitHub/GitLab issue. It applies
sanitize_failure_detail, but does not run a general secret scan. The
sanitizer covers selected token and private-key formats, not every
credential type. - On a normal PR-creation run, the script secret-scans
pr_bodybefore
publishing the PR description, but the command permits inline
gitleaks:allowsuppression.
The script's installer specifies Gitleaks v8.30.1, although an existing
binary on PATH is reused. That version also accepts scanner configuration
from GITLEAKS_CONFIG / GITLEAKS_CONFIG_TOML and defaults its ignore-file
lookup to the current working directory. The post-script runs inside the
extracted repository. A temporary source file avoids automatic discovery
of the repository's .gitleaks.toml, but does not by itself isolate the
environment overrides or ignore lookup. These are policy inputs to verify,
not a claim that a workflow exploit has been reproduced.
This can leave credential-shaped content eligible for publication, or make
the scan's effective policy depend on settings unrelated to public text.
No actual credential disclosure has been observed in this investigation.
What should happen
For these two code-agent publication paths:
- Agent-authored text is checked before it becomes an issue comment or PR
description, using the supported scanner and a known effective policy. - Inline allow markers and repository-controlled scanner settings cannot
suppress a credential detection in public text. - A secret finding or inability to complete a scan suppresses the optional
no-op context or uses the existing PR-body fallback. Ordinary safe text
remains publishable. Existing credential redaction still applies. - Scanner diagnostics do not disclose credential values publicly.
- Tests exercise real scanner behavior and the actual publication paths,
including safe text, a synthetic detectable credential, an inline allow
marker, configuration/ignore interactions, and scanner failures.
Scope
scripts/post-code.src.sh, its generated scripts/post-code.sh, and tests
for the two publication paths. GitHub and GitLab issue delivery must retain
the same behavior. Jira-source no-op runs currently return before reading
pr_body; this issue does not add Jira comment delivery.
This issue does not change repository-boundary guidance, result fields,
review dispatch, merge-commit scans, or commit-history scanning policy.
Context
Security observations during PR #1659
were separated from #1656,
which asks for guidance when a fix belongs in another repository.
- Original no-op publication finding
- Inline allow-marker finding
- Scanner-policy verification finding
- Both paths need scope and test coverage
Related open issue #233
covers PR-body scan-status checklist rendering tests, rather than scanner
policy or no-op publication. #137
covers reviewer detection of sensitive tool output reaching public comments.
Neither owns this production behavior.
Earlier hardening work remains in PR #1659's history at 412106d and
eb14ad8; 07fe09d removes it from that PR's final diff. Those commits
are reference material, not a verified complete fix for this issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn progress
Activity
fullsend-ai-triage commentedon Oct 13, 2026
🤖 Finished Triage · ✅ Success · Started 6:20 PM UTC · Completed 6:22 PM UTC
Commit:
49c77a6· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.24
fullsend-ai-triage commentedon Oct 13, 2026
Triage found this issue actionable as written. Code review confirms both gaps: the no-op comment path posts the agent's
pr_bodyafter redaction only (no scan), and the PR-body scan calls gitleaks directly without isolating config environment variables, the working-directory ignore lookup, or inline allow markers. No existing PR, sub-issue, or duplicate was found, and #233 and #137 cover different behavior, as you noted.Suggested approach (for the implementer):
GITLEAKS_CONFIG*cleared and allow markers defeated.scripts/post-code.shfrom the.src.shfile.Open design question for maintainers (not blocking): how to neutralize inline allow markers. Options are stripping them from the scanned copy or relying on a scanner mode that ignores them. The implementer should check the behavior against the pinned gitleaks version. Because a pre-existing binary on PATH is reused, the helper should also check the version it runs.
Proposed test cases (real gitleaks, actual publication paths):
This is categorized as security, so it is outside the default auto-promotion categories and will need a maintainer to dispatch the code agent.
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancefix(#1673): scan final public text and classify scan failures
fix(#1673): scan final PR title and description
fix(#1673): report final description scan status
fix(#1673): keep scanning within issue scope
fix(#1673): drop PR-title scan claims from code doc
fix(#1673): isolate public-text secret scans
fix(#1673): scan final public text and classify scan failures
fix(#1673): scan final PR title and description
fix(#1673): report final description scan status
fix(#1673): keep scanning within issue scope
fix(#1673): drop PR-title scan claims from code doc
fix(#1673): isolate public-text secret scans
fix(#1673): scan final public text and classify scan failures
fix(#1673): scan final PR title and description
fix(#1673): report final description scan status
fix(#1673): keep scanning within issue scope
fix(#1673): verify gitleaks before public-text scans