AI attribution
How the AI-generated estimate is computed, how it was validated, and its limits.
For every scanned file TrustLedger estimates how much of it is AI-generated, and which assistant most likely produced it. It is an estimate, and it is presented as one.
Signals
47 signals feed the estimate, combined with a noisy-OR ensemble and calibrated with a sigmoid. They fall into three groups:
- Code structure — patterns in the syntax tree that correlate with model output (uniform naming, characteristic comment and docstring shapes, missing edge-case handling, boilerplate density).
- Repository provenance — assistant configuration and markers in the repository (
.cursor/,.claude/, Copilot instructions, Windsurf config, inline marker comments) used to attribute a tool. - Behaviour — a contributor's change compared with their own baseline, so a sudden shift is visible even when the absolute score is moderate.
Validation
The estimate is checked against a labelled corpus kept in the repository: 10 TypeScript/JavaScript files. At a threshold of 0.5: precision 100%, recall 60%, accuracy 80%, ROC-AUC 1.00; tool attribution is correct on 100% of 10 labelled samples. This is a small regression check, not a statistically strong evaluation.
Limitations
- The estimate is probabilistic. It is not proof that a person or a tool wrote any line, and it should not be used to judge individuals.
- Human code written in a model-like style scores high; model output edited heavily by a person scores low.
- Tool attribution depends on markers and configuration the repository contains; without them the tool is reported as unknown.
- Validation covers TypeScript/JavaScript only; other languages use the same signals without a labelled check.
Policies can flag files above an AI-percentage threshold for review; by default that does not block a merge on its own.