See the human and the AI grain in your code.
Grain measures how much of a repository was human-written vs AI-assisted — with a confidence level on every claim. Signals, not verdicts.
Two trends just collided in every repo.
AI writes code freely, and maintainers have grown wary of what it wrote. Between them sits an unmet need: a neutral way to measure provenance.
AI commits on its own
Agents open PRs, keep tool-activity logs, and push commits directly. A diff is no longer presumed human.
Maintainers turned wary
Projects are rewriting contribution policy to demand transparency about AI use — but disclosure is honor-system today.
The gap between them is trust. Grain is the instrument that measures it.
One command in. Three things out.
No dashboard to learn. Grain meets developers where they already look — the badge, the PR, and a file in the repo.
A README shield
The repo's human/AI mix, the way a coverage badge shows tests.
A calm comment
Itemized, framed as signals — never an accusation.
A nutrition label
A committable report of the whole repo, backed by grain.json.
Forensics, ranked by confidence.
Grain starts from hard evidence and only falls back to inference — and it reports a confidence score, never an accusation.
Declared signals
Co-Authored-By trailers, agent commits, bot accounts, explicit tags.
high confidenceCommit forensics
Burst timing, diff uniformity, the “all at once” shape of agent output.
inferredConvention diffing
Did the change respect the repo's own style and CODEOWNERS?
inferredLocal model pass
Optional, for ambiguous diffs. Runs client-side; code never leaves the machine.
privacy-firstSignals, not verdicts.
Grain reports “62% of these lines carry AI signals” — never “this person cheated”. Inference is capped, declared signals are preferred, and it names its own limits.
The instrument is free. The org tooling is paid.
Everything that runs on a single repo, locally, is free and MIT. The open engine is what makes the numbers credible.
grain CLI
- →CLI, GitHub Action, badge
- →PROVENANCE.md + grain.json
- →Runs fully local
- →The full detection engine
grain Cloud
- →Org dashboard & trends
- →Merge-policy engine
- →Multi-repo rollups
- →Slack / PR gating
grain Audit
- →Signed provenance ledger
- →EU AI Act / SOC2 export
- →SSO & retention policy
- →On-prem option
See the grain of your codebase.
One command. MIT. Runs locally. Star it, try it, and put a provenance badge on your repo today.