gitlint-rai
A gitlint plugin that enforces exactly one thing:
if AI touched the code, say so in the commit. ⚖️
That’s it. No philosophy, no negotiations. Pick a trailer and move on.
⭐ Found this useful? Star the repo.
Installation 🔧
pip install gitlint-rai
Or with uv, which is objectively the better choice:
uv add gitlint-rai
Usage 🚦
Run the bundled wrapper — it loads the RAI rules automatically and accepts all gitlint arguments:
gitlint-rai
gitlint-rai --msg-filename .git/COMMIT_EDITMSG
Prefer plain gitlint? Point your .gitlint config at the installed package:
[general]
extra-path=/path/to/site-packages/gitlint_rai
Get that path with:
python -c "import gitlint_rai, pathlib; print(pathlib.Path(gitlint_rai.__file__).parent)"
To verify the rule loaded:
gitlint-rai --debug
Look for rai-footer-exists and rai-signed-off-by in the loaded-rules output. If you see them, the plugin is active and doing its job.
Both rules are enforced by default: rai-footer-exists (UC1) requires an AI attribution trailer, and rai-signed-off-by (UC2) requires the Signed-off-by: Your Name <email> footer that git commit -s adds. To skip sign-off enforcement, add ignore=rai-signed-off-by under [general] in your .gitlint.
Valid Trailers 📌
Pick the one that matches the majority AI contribution. Skip it entirely and the commit fails. Extra footers are fine — the rule only checks that at least one valid footer exists.
This is not a debate.
Authored-by: [Human] <email>— all you, no AI involvedCommit-generated-by: [AI Tool] <email>— AI wrote the commit message, you wrote the codeAssisted-by: [AI Tool] <email>— AI helped some, you were drivingCo-authored-by: [AI Tool] <email>— roughly 50/50, like actual pair programmingGenerated-by: [AI Tool] <email>— AI did most of it, you supervised
All patterns are case-insensitive, because life is too short for that kind of pedantry.
Why This Exists ⚖️
Git already supports trailers. Commits already support attribution. What they don’t do is require you to be honest when AI is involved.
This plugin exists to make that honesty boring, consistent, and automatic, so nobody has to reconstruct intent later by reading commit history like tea leaves.
If you want the longer reasoning behind this, it lives at Did AI Erase Attribution?.
This plugin is the practical follow-through.
Requirements ⚙️
- Python >= 3.11, < 3.15
- gitlint >= 0.19.1
Related 🔗
Enforcement is only half the story. RAI Commit Attribution Badge reads these footers back out of your history and publishes the score as a badge.
License 📄
PolyForm Shield License 1.0.0 — free to use anywhere, including inside commercial products. What's off the table: providing anything that competes with this tool — selling it, rebranding it, hosting it, or shipping a practical substitute, paid or free. This is a plain-language summary; the LICENSE is what actually controls. Commercial licensing questions: anchildress1@gmail.com.
Metadata
Release files for gitlint-rai 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gitlint_rai-1.0.3.tar.gz | 10.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitlint_rai-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.8 kB
Release files / gitlint_rai-1.0.3.tar.gz
| Download URL | gitlint_rai-1.0.3.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e8aff698f0123e1bb234db73bd02121fbe57c39285ab7f2d9bde95d671f3d0e
|
|
BLAKE2b-256 checksum How to use checksums |
e9ee720074ead0d7ad2a0bad54564a5e67a9551b39038e1b11e114992f6292bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.
Transparency logRelease files / gitlint_rai-1.0.3-py3-none-any.whl
| Download URL | gitlint_rai-1.0.3-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5241f0019289753752070bc6e9eba80009071ff9205510d3626b0c08d1047888
|
|
BLAKE2b-256 checksum How to use checksums |
332d3c1d82acdcde2bc93dadb1b49c1c124b069199907bf7cf20cab8380d739b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.
Transparency log