Skip to content

Commit a1d8127

Browse files
CharlieTLeclaude
andauthored
Add Generative AI Contribution Policy (#7396)
* Add Generative AI Contribution Policy Create GENAI_POLICY.md to set clear expectations for AI-assisted contributions across cortexproject repos, covering permitted uses, contributor responsibilities, disclosure requirements, and maintainer authority. Also add references from CONTRIBUTING.md, docs/contributing/_index.md, the PR template checklist, and a "Related Policies" section in AGENTS.md clarifying the distinction between guidance *to* AI agents and policy governing *human use* of AI tools. Fixes #7388 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Charlie Le <charlie_le@apple.com> * Update pull_request_template.md Signed-off-by: Charlie Le <charlie_le@apple.com> * Update GENAI_POLICY.md Signed-off-by: Charlie Le <charlie_le@apple.com> * Update GENAI_POLICY.md Signed-off-by: Charlie Le <charlie_le@apple.com> * Update GENAI_POLICY.md Signed-off-by: Charlie Le <charlie_le@apple.com> * Fix link to Generative AI Contribution Policy Update link to the Generative AI Contribution Policy. Signed-off-by: Charlie Le <charlie_le@apple.com> * Fix link formatting in contributing guidelines Updated link formatting for the Generative AI Contribution Policy. Signed-off-by: Charlie Le <charlie_le@apple.com> --------- Signed-off-by: Charlie Le <charlie_le@apple.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b9b9fec commit a1d8127

4 files changed

Lines changed: 75 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,7 @@ Import order: stdlib, third-party packages, internal Cortex packages (separated
114114
- Sign commits with DCO: `git commit -s -m "message"`
115115
- Run `make doc` if config/flags changed
116116
- Include CHANGELOG entry for user-facing changes
117+
118+
## Related Policies
119+
120+
This file (`AGENTS.md`) provides technical guidance **to** AI coding agents working in this repository (build commands, architecture, conventions). For the policy governing **human use** of AI tools when preparing contributions, see [GENAI_POLICY.md](GENAI_POLICY.md).

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Contributing to Cortex
22

33
See [https://cortexmetrics.io/docs/contributing/](https://cortexmetrics.io/docs/contributing/).
4+
5+
If using generative AI tools, please also review our [Generative AI Contribution Policy](GENAI_POLICY.md).

GENAI_POLICY.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Generative AI Contribution Policy
2+
3+
## Purpose
4+
5+
The Cortex project welcomes contributions that make use of generative AI (GenAI) tools. AI assistants can help contributors write code, explore the codebase, draft documentation, and improve productivity. However, **humans bear full responsibility** for every contribution they submit, regardless of how it was produced.
6+
7+
This policy applies to all repositories under the [cortexproject](https://github.com/cortexproject) GitHub organisation.
8+
9+
## Permitted Use of AI Tools
10+
11+
The following uses of AI tools are encouraged and permitted:
12+
13+
- **Coding assistants** - Using tools like GitHub Copilot, Claude Code, Cursor, or similar to help write, refactor, or debug code.
14+
- **Codebase exploration** - Querying AI tools to understand project architecture, locate relevant code, or learn conventions.
15+
- **Documentation drafting** - Generating initial drafts of documentation, comments, or commit messages.
16+
- **PR review assistance** - Using AI to help review code, identify potential issues, or suggest improvements.
17+
- **Maintainer-configured review bots** - Automated review bots configured by project maintainers.
18+
19+
## Contributor Responsibilities
20+
21+
When using AI tools to assist with contributions, you must:
22+
23+
1. **Understand every line you submit.** You must be able to independently explain any change in your contribution. "The AI wrote it" is not an acceptable justification during review.
24+
25+
2. **Review and validate AI output.** Never submit AI-generated content verbatim without careful review. Verify correctness, check for hallucinated APIs or dependencies, and ensure the output follows Cortex conventions.
26+
27+
3. **Disclose significant AI usage.** If AI generated the bulk of a contribution (e.g., an entire new feature, large refactors, or substantial documentation), note this in the PR description. Minor assistance (autocomplete, small suggestions) does not require disclosure.
28+
29+
4. **Honour the DCO.** Your `Signed-off-by` line on each commit certifies the [Developer Certificate of Origin](https://developercertificate.org/) for **all** content in that commit, including any AI-generated portions. You are attesting that you have the right to submit the work.
30+
31+
5. **Meet the same quality bar.** AI-assisted contributions are held to the same standards as any other contribution: tests, documentation, CHANGELOG entries, passing CI, and adherence to the project's [design patterns and conventions](docs/contributing/design-patterns-and-conventions.md).
32+
33+
## GitHub Communications
34+
35+
- **Issues, pull request reviews, and discussions** must be substantively human-authored. Do not submit bulk AI-generated comments, reviews, or issue reports.
36+
- Sharing AI-generated analyses (e.g., "I asked an AI to summarise the failure modes and here is what it found") is acceptable when clearly attributed and verified by the contributor.
37+
- Do not use AI tools to generate large volumes of low-quality issues or review comments.
38+
39+
## Maintainer Authority
40+
41+
Maintainers may:
42+
43+
- **Request disclosure** of AI tool usage for any contribution.
44+
- **Close or request revision** of PRs or issues that appear to contain unreviewed AI-generated content.
45+
- **Escalate persistent low-effort submissions** through the project's normal [Code of Conduct](code-of-conduct.md) enforcement process.
46+
47+
## Relationship to Other Policies
48+
49+
| Document | Purpose |
50+
|----------|---------|
51+
| [Contributing Guide](CONTRIBUTING.md) | General contribution workflow and requirements |
52+
| [Code of Conduct](code-of-conduct.md) | Community behaviour standards |
53+
| [Governance](GOVERNANCE.md) | Project governance and decision-making |
54+
| [AGENTS.md](AGENTS.md) | Technical guidance **to** AI coding agents working in this repo |
55+
56+
**AGENTS.md vs GENAI_POLICY.md:** `AGENTS.md` provides instructions that AI coding agents consume when working with the codebase (build commands, architecture, conventions). This document (`GENAI_POLICY.md`) governs how **human contributors** use AI tools when preparing their contributions.
57+
58+
## References
59+
60+
- [OpenTelemetry GenAI Contribution Policy](https://github.com/open-telemetry/community/blob/main/policies/genai.md)
61+
- [Linux Foundation AI Guidelines](https://www.linuxfoundation.org/legal/generative-ai)
62+
- [Developer Certificate of Origin](https://developercertificate.org/)

docs/contributing/_index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ a piece of work is finished it should:
2121
* Include a CHANGELOG message if users of Cortex need to hear about what you did.
2222
* If you have made any changes to flags or config, run `make doc` and commit the changed files to update the config file documentation.
2323

24+
## Use of AI Tools
25+
26+
Cortex permits the use of generative AI tools to assist with contributions. Contributors remain
27+
fully responsible for all submitted content. If AI generated the bulk of a contribution, please
28+
disclose this in the PR description. See the full `GENAI_POLICY.md`
29+
for details.
30+
2431
## Formatting
2532

2633
Cortex projects uses `goimports` tool (`go get golang.org/x/tools/cmd/goimports` to install) to format the Go files, and sort imports. We use goimports with `-local github.com/cortexproject/cortex` parameter, to put Cortex internal imports into a separate group. We try to keep imports sorted into three groups: imports from standard library, imports of 3rd party packages and internal Cortex imports. Goimports will fix the order, but will keep existing newlines between imports in the groups. We try to avoid extra newlines like that.

0 commit comments

Comments
 (0)