Skip to content

Commit 67e01b2

Browse files
authored
docs: add AI contribution policy (#3077)
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
1 parent 2321c2e commit 67e01b2

2 files changed

Lines changed: 97 additions & 2 deletions

File tree

AI_POLICY.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# AI Contribution Policy
2+
3+
Chainloop is an open-source evidence store for Software Supply Chain
4+
attestations, SBOMs, VEX, SARIF, and other compliance artifacts. Correctness,
5+
security, and long-term maintainability are non-negotiable properties of the
6+
project.
7+
8+
This policy sets clear expectations for AI-assisted contributions. It is not
9+
an anti-AI stance — maintainers and contributors alike use AI tools in their
10+
daily workflows, and we encourage you to do the same. AI can accelerate
11+
learning, improve documentation, generate test scaffolding, and help explore
12+
design alternatives. We welcome contributors who use AI as a productivity
13+
amplifier, not as a substitute for understanding.
14+
15+
**AI tools are welcome in the Chainloop contributor workflow. The human
16+
contributor is always accountable for every line submitted.**
17+
18+
## Contribution Guidelines
19+
20+
The following rules apply to all contributions, regardless of how they were
21+
produced:
22+
23+
- **Own your changes.** You must be able to explain every change you submit.
24+
"The AI generated it" is never an acceptable answer during review.
25+
- **Design before coding.** For non-trivial changes, open a GitHub Issue with
26+
clear reasoning before a PR. PRs that ignore established patterns will be
27+
closed.
28+
- **Quality over quantity.** One well-understood, well-tested PR is worth more
29+
than many AI-assisted drive-by fixes. A flood of low-effort PRs exhausts
30+
maintainer attention and delays everyone in the queue.
31+
- **Tests are required.** Bug fixes need regression tests; new features need
32+
unit and integration tests. AI-generated tests that do not actually exercise
33+
the relevant behaviour will be rejected.
34+
- **Legal compliance.** Chainloop is [Apache 2.0 licensed](LICENSE).
35+
Contributions must ensure:
36+
- No third-party copyrighted material has been reproduced without a compatible
37+
open source license and proper attribution.
38+
- When AI tools are used, their terms do not impose restrictions incompatible
39+
with Apache 2.0.
40+
41+
## Disclosure
42+
43+
If AI assisted in producing any part of your contribution, disclose it in the
44+
PR description. Add an `Assisted-by:` trailer to each affected commit:
45+
46+
```
47+
Assisted-by: GitHub Copilot
48+
Assisted-by: Claude Code
49+
Assisted-by: ChatGPT o3
50+
```
51+
52+
Disclosure is not a penalty — it is trust infrastructure. It preserves
53+
transparency, helps reviewers calibrate their attention, and keeps provenance
54+
clear for the project's long-term health.
55+
56+
## Engaging With Maintainers
57+
58+
- **Respond personally.** Do not pipe review feedback back into an AI and
59+
apply the output blindly. Responses during review must reflect genuine
60+
understanding of the code and the project's design goals.
61+
- **No AI ping-pong.** If maintainers observe a pattern of AI-driven responses
62+
without real engagement, the PR will be closed without further explanation.
63+
- Maintainers reserve the right to close any low-effort AI contribution without
64+
a detailed technical critique.
65+
66+
## Maintainer Use of AI
67+
68+
Maintainers also use AI tools: for reviewing changes, exploring implementation
69+
options, and improving documentation. The same disclosure and ownership
70+
expectations apply to maintainer-authored commits.
71+
72+
## Acknowledgements
73+
74+
This policy is inspired by the
75+
[go-git AI Policy](https://github.com/go-git/go-git/blob/main/AI_POLICY.md),
76+
the [Kubewarden AI Policy](https://github.com/kubewarden/community/blob/main/AI_POLICY.md),
77+
the [CloudNativePG AI Policy](https://github.com/cloudnative-pg/governance/blob/main/AI_POLICY.md),
78+
and the [Kyverno AI Usage Policy](https://github.com/kyverno/kyverno/blob/main/AI_POLICY.md).
79+
It aligns with the Linux Foundation's
80+
[Generative AI guidance](https://www.linuxfoundation.org/legal/generative-ai)
81+
and the CNCF community's evolving norms on sustainable AI-assisted open source
82+
development.

CLAUDE.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,21 @@ All commits must meet these criteria:
256256
- **Example**: `git commit -S -s -m "feat: add new material type"`
257257

258258
Code reviews are required for all submissions via GitHub pull requests.
259+
260+
### AI Disclosure
261+
262+
If AI assisted in producing any part of a contribution, disclose it in the PR description. Add an `Assisted-by:` trailer to each affected commit:
263+
264+
```
265+
Assisted-by: GitHub Copilot
266+
Assisted-by: Claude Code
267+
Assisted-by: ChatGPT o3
268+
```
269+
270+
See [AI_POLICY.md](AI_POLICY.md) for the full AI contribution policy.
271+
259272
- make sure golang code is always formatted and golang-ci-lint is run
260-
- I do not want you to be in the co-author signoff
273+
- do not add co-author signoff lines — use `Assisted-by:` trailers for AI disclosure instead
261274
- when the schema is changed, run make generate, do not create a migration explicitly
262275
- If you are writing go code, adhere to best practices such as the ones in effective-go, or others. This could include, error handling patterns, interface design, package organization, concurrency patterns, etc.
263276
- When writing tests, use table-driven tests whenever possible
@@ -271,7 +284,7 @@ Code reviews are required for all submissions via GitHub pull requests.
271284
- if you add any new dependency to a constructor, remember to run wire ./...
272285
- when creating PR message, keep it high-level, what functionality was added, don't add info about testing, no icons, no info about how the message was generated.
273286
- app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts is a special case that we don't want to upgrade, so if it upgrades, put it back to main
274-
- when creating a commit or PR message, NEVER add co-authored by or generated by Claude code
287+
- when creating a commit or PR message, NEVER add co-authored-by lines — use `Assisted-by:` trailers for AI disclosure instead
275288
- any call to authorization Enforce done from the biz or svc layer must be done using biz.AuthzUseCase
276289
- if you modify a schema, remember to run `make migration_sync`
277290
- after changing Helm chart source code (`deployment/chainloop/`), bump the **patch** version (not minor, not major) in the chart's `Chart.yaml`

0 commit comments

Comments
 (0)