Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions AIPOLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# P4 Project Policy: AI Tool Use in Contributions
The P4 Project permits the use of AI tools to assist with writing code and documentation. Our approach follows the [Linux Foundation’s Generative AI Guidance](https://www.linuxfoundation.org/legal/generative-ai) and adds organization-specific requirements.

**Contributors remain fully accountable for their submissions** and are always the authors of their work. Review should be requested only when the contributor is confident the contribution is high quality and understands the code well enough to explain it.**In all cases, a human must remain in the loop.**

This policy applies to all contribution types, including (but not limited to):
- code changes (PRs)
- RFCs/design proposals
- Issues or security reports
- Comments and feedback on pull requests

# Contributor Responsibility
To ensure meaningful self-review and ownership, contributors should write PR descriptions themselves, AI tools may be used only for translation or copy-editing. PR descriptions must clearly cover the motivation, implementation approach, expected impact, and any open questions, to the same standard as non-AI contributions. First-time contributors who use AI tools must disclose that use in the PR description, commit message, or wherever authorship is normally indicated; long-time contributors and maintainers are exempt from mandatory disclosure but remain responsible for ensuring contributions comply with Linux Foundation and P4 community guidelines. A human must remain in the loop. Agents or automation may not take actions in project spaces, such as opening PRs, pushing commits, or posting review comments, without explicit human approval.

**Contributors must avoid maintainer-burdening contributions**. In other words, submissions that offload excessive review work onto maintainers, for example, submitting unreviewed LLM output. The rule is simple: a contribution should deliver more value than the maintainer time required to review it.

If a maintainer judges a submission to be non-compliant with this policy, they may request revisions, e.g., reducing scope or improving usefulness. In more serious cases, they may escalate to moderators/admins to lock the thread if it remains unproductive.

# Intellectual Property and Licensing
Using AI tools does not remove copyright or change licensing obligations. You must ensure AI-assisted output does not include third-party copyrighted material or introduce license terms that are incompatible with the project. If there is any reasonable risk the output contains or reproduces third-party code or text, you must verify rights and license compatibility, add any required attribution/notices, or remove and replace the material before submitting it.

Non-compliant contributions may be reverted or removed, just like any other licensing or copyright violation.

# Examples:
- This [PR](https://github.com/p4lang/gsoc/pull/98) demonstrates how humans stay in the loop when using agents or automation.
-

# References:
- LLVM AI Tool Use Policy: https://llvm.org/docs/AIToolPolicy.html
- Linux Foundation’s Generative AI Guidance: https://www.linuxfoundation.org/legal/generative-ai