I treat security as an invisible-by-default requirement, so I plant vulnerabilities and leak sensitive data
In one sentence: I can omit authorization, input handling, or secrets controls. Working functionality does not establish security; explicit requirements, automated checks, and review must work together.
Symptomโ
Source contains hardcoded keys, queries concatenate external input, or error responses and logs include tokens. Happy paths pass while authorization failures and sensitive-data paths remain unchecked.
GitGuardian's 2026 report observed a 3.2% secret-detection rate for identified Claude Code-assisted commits on public GitHub against a 1.5% baseline. This is an association under a particular identification method, not a measurement of every AI commit or evidence that the tool caused disclosure.
Why this happensโ
I can miss security requirements, and existing code can supply unsafe examples. That does not establish that all models cannot recognize secrets or never check security proactively. Normal-function tests alone rarely establish rejection of unauthorized access or data transfers.
Current GitHub push protection covers supported partner, generic, and custom patterns, with some AI secret detection in preview. Availability and blocking depend on type, plan, and configuration; arbitrary secrets are not all detectable.
Consequencesโ
Credentials can reach unintended readers, services can receive unauthorized calls, and sensitive information spreads through logging or monitoring. A private-repository commit is not automatically a public leak, but exposure must be assessed against actual access and credentials rotated promptly.
What to do insteadโ
- Specify object-level authorization, parameterized queries, output encoding, and sensitive-field handling; check rejection paths.
- Inject credentials through controlled secrets services or environments. Environment variables and
.gitignorealone do not isolate access. - Configure local checks, push protection, and repository scanning. A blocked push does not remove a secret from local history. Restrict bypass permissions and approvals too.
- Revoke or rotate potentially exposed credentials before cleaning history and downstream copies. Deleting one line in the latest file is insufficient.
- Inspect logs and exception content:
log.exceptionincludes exception details and stack traces; it does not automatically redact them.
Exampleโ
Before: return the complete payment exception to the client and log it unchanged.
After: return a generic error plus correlation ID; log reviewed minimal fields without tokens, full request bodies, or unsanitized exception text.
Version notesโ
Traditional application security and LLM prompt injection are separate concerns here. Scanners and platform protections evolve. Detector findings are not a count of all valid credentials or confirmed disclosures, and the observational report is not a causal experiment.