Skip to content

Commit 24913a3

Browse files
authored
chore: add AI contribution policy (#570)
* chore: add AI contribution policy * docs: avoid hardcoded year in AI policy
1 parent 2b33969 commit 24913a3

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

.github/pull_request_template.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,29 @@
1919
- [ ] Ran `pnpm changeset` to generate a changeset file
2020

2121
<!-- For more details check RELEASING.md -->
22+
23+
## 🤖 Agent context
24+
25+
<!-- Fill this section if an agent co-authored or authored this PR. Remove it for fully human-authored PRs. -->
26+
27+
<!-- Autonomy — keep one of the two options on the line below:
28+
- "Human-driven (agent-assisted)" when a person directed the work — assign that person as the PR assignee (the DRI).
29+
- "Fully autonomous" when no human drove it; leave the PR unassigned for the owning team to triage. -->
30+
31+
**Autonomy:** Human-driven (agent-assisted) — or — Fully autonomous
32+
33+
<!-- Keep this short: 1-3 short paragraphs or a handful of bullets — not an exhaustive log. Include:
34+
- tools/agent used and link to session. List the agent and tool names used, but do not include tool call results.
35+
- decisions made along the way (what was tried, rejected, chosen, and why)
36+
- anything else that helps reviewers
37+
Write reviewer-facing prose. Do not paste user prompts verbatim — paraphrase the intent in your own words.
38+
DO NOT INCLUDE sensitive data that may have been shared in an agent session.
39+
-->
40+
<!-- Rules for agent-authored PRs:
41+
- When a human directed the work, the PR must be attributable to that person, even if agent-assisted.
42+
- If a human directed this work, assign them as the PR assignee (the DRI) — actually set the assignee, don't just name them here. Leave a PR unassigned only when it is fully autonomous with no human driver (set Autonomy to "Fully autonomous").
43+
- Do not add a human Co-authored-by just for the sake of attribution — if no human was involved in the changes, own it as agent-authored.
44+
- Agent-authored PRs always require human review — do not self-merge or auto-approve.
45+
- Do NOT claim manual testing you haven't done.
46+
- GitHub PR descriptions render markdown, not fixed-width text. Do not hard-wrap prose at a column width or use space-aligned tables — use real markdown tables, headings, and fenced code blocks, and let GitHub flow the text.
47+
-->

AI_POLICY.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# AI contributions policy
2+
3+
PostHog is built with plenty of AI assistance.
4+
This policy exists because of a growing volume of low-quality, AI-generated contributions that waste maintainer time.
5+
6+
## The standard
7+
8+
**You own what you submit.**
9+
Understand your code, test it, and be ready to explain why it's correct and how it interacts with the rest of the system (without re-prompting an LLM).
10+
This is no different from what we'd expect of any contribution; AI makes it easier to skip the work – please don't skip the work.
11+
12+
**Prove it works.**
13+
Before submitting, please verify the change actually works end-to-end — don't rely on "it compiles" or "tests pass" alone.
14+
15+
Add tests for new behavior, smoke test the change in an example project where applicable, and describe your test strategy in the PR description: what you tested, how you tested it, and what edge cases you considered.
16+
17+
For changes with user-visible UI, include a short demo (screenshot, screen recording, or GIF) of the feature working in the PR description. Ideally you demo more than just the happy path.
18+
19+
PRs that clearly weren't run or tested will be closed under this policy.
20+
21+
**Disclose AI usage.**
22+
Our [PR template](.github/pull_request_template.md) includes an Agent context section — please use it (most agents will pick it up automatically).
23+
If an agent co-authored or authored your PR, say so and leave context about the tools and session.
24+
This helps reviewers calibrate.
25+
26+
**Prefer PRs over AI-generated issues.**
27+
If AI helped you find a bug, fix it and open a pull request — don't paste the AI's output into an issue.
28+
Unreviewed, AI-generated bug reports and security disclosures will be closed without response.
29+
30+
**Don't submit unsolicited AI-generated PR reviews.**
31+
If you didn't write the code and aren't a maintainer, don't point an LLM at someone else's PR and leave its output as a review comment.
32+
This is generally never helpful.
33+
34+
## What happens when contributions don't meet this bar
35+
36+
- **First time:** We'll close the PR/issue with a link to this policy and a brief explanation.
37+
- **Two or more closures:** We'll block the account.
38+
39+
## Why we're not anti-AI
40+
41+
We think the best contributions today often involve AI.
42+
A contributor who uses an LLM to help them understand unfamiliar code, draft a first pass, or catch edge cases they'd miss is probably _more_ productive than someone doing everything by hand.
43+
The key difference is that they're driving the AI, not the other way around.
44+
45+
If you're new to open-source contributing and want to learn, we're genuinely happy to help — open an issue, ask questions, submit small PRs.

0 commit comments

Comments
 (0)