AI-code audit
By 2027, 40-60% of code submissions will be AI-generated. Regulated teams need an answer to one compliance question: which findings sit on AI-touched code? Vulkro is the only SAST tool that ships a defender-side AI-origin audit today.
Three CLI surfaces use the audit:
- AI-origin fingerprinting (per-tool markers: Claude, Copilot, Cursor, Aider, ChatGPT, generic AI-generated)
--ai-code-segregationsegregation report--attest-reviewedreviewer attestation
Why this is on the SAST tool
Most security tools run the same detectors on every line. That is right in technique but misses a posture point: AI-generated code fails in specific ways more often - boilerplate auth that does not enforce, copy-paste secrets, missing error handling, hallucinated dependency names. The scanner already knows about each finding, so it is the right place to flag which findings sit on AI-touched code.
Vulkro stays on the defender side. This module audits AI-generated code; it does not generate fixes via a vendor LLM. That fits the offline-first posture: your code never leaves the host.
How origin is detected
The origin scan looks at each module for canonical per-tool markers:
| Tool | Markers it looks for |
|---|---|
| Claude | Generated by Claude, Generated with Claude, Co-Authored-By: Claude, @claude-generated, @anthropic-generated |
| GitHub Copilot | GitHub Copilot, Copilot-generated, @copilot |
| Cursor | cursor.sh, @cursor-generated |
| Aider | aider:, // aider |
| ChatGPT | Generated by ChatGPT, OpenAI GPT-... |
| Generic | AI-generated, Generated by AI, # generated by ..., // generated by ... |
The marker scan is strict precision today: no explicit marker means the file is treated as hand-written. Heuristic shape detection (long boilerplate docstrings, uniform variable naming) is planned for later. The strict scan is the safer first step, since falsely tagging a hand-written file as Copilot output would be worse than the current under-coverage.
Marker line numbers are kept, so Vulkro can compute a per-file marker ratio ("3 of 280 lines carry an AI marker").
--ai-code-segregation
Adds a markdown report after the scan output:
$ vulkro scan . --ai-code-segregation
... (normal scan output) ...
# Vulkro AI-Code Segregation Report
- Total findings: 42
- Findings on AI-touched files: 11 (26.2%)
## Per-tool breakdown
- claude: 7 finding(s)
- copilot: 3 finding(s)
- generic-ai: 1 finding(s)
## AI-touched files (marker-line ratio)
- src/api/users.ts: 0.71%
- src/api/auth.ts: 1.43%
- src/services/notifier.ts: 0.36%
The report goes to stderr. The main output stream (table / JSON / SARIF) is unchanged, so machine-readable formats stay parse-clean.
--attest-reviewed
Stamps every finding on an AI-touched file with a
human-reviewed-ai-code evidence row. A downstream compliance emit
can then show "every AI-touched finding has a human-review sign-off"
without tagging each finding by hand.
$ vulkro scan . --attest-reviewed --reviewer jane@team
... (normal scan output) ...
attest-reviewed: stamped 11 finding(s) on AI-touched files (reviewer: jane@team)
The reviewer name defaults to $USER; pass --reviewer NAME to
override. The attestation lives on evidence[].signal = "human-reviewed-ai-code" and evidence[].detail = "Reviewer attestation: AI-touched code reviewed by ...", so it carries into
SARIF, JSON, JUnit, and the database emit.
Use cases
HIPAA / PCI-DSS / FedRAMP audit evidence
The auditor asks you to show that every AI-touched line was reviewed
by a human. Run vulkro scan . --ai-code-segregation --attest-reviewed --format sarif > scan.sarif. The SARIF carries
both the per-tool breakdown (properties rolls up segregation
counts) and the per-finding attestation row. Hand the auditor the
SARIF file.
Pre-merge gate on AI-shop PRs
CI runs vulkro scan . --ai-code-segregation on every PR. The
stderr report goes into the CI log. If the AI-touched share crosses
the team's threshold, a wrapper script fails the build and posts the
report as a PR comment.
Forensics after a security incident
A security event surfaces in production. Run
vulkro scan . --ai-code-segregation against the commit that shipped
the bug. The output tells you which tool produced the offending
code, so the team can update its reviewer playbook for that tool.
Related
vulkro scan- the full flag list- Confidence model - how the attestation rows feed into the confidence aggregator