answered from live GitHub & Hugging Face data
How can I establish a clear disclosure policy for AI-generated pull requests in my GitHub repository?
Write the policy as a rule with three parts: disclose in the PR, keep a human accountable, and let maintainers decide. Do not ban AI tools outright. The Linux kernel uses this model. It asks for transparency and leaves the final call to each maintainer.
What the kernel model requires
The kernel's tool-generated content guidelines apply when a tool creates a meaningful part of a contribution. They ask contributors to:
- Name the tools used.
- Describe which parts of the content the tool affected.
- Explain how the change was tested.
- Include the prompts for code that was largely generated from them.
The same guidelines say that maintainers may treat AI-assisted work like any other work, reject it, or review it with extra scrutiny.
The kernel's AI coding assistant rules add one hard line: "AI agents MUST NOT add Signed-off-by tags. Only humans can legally certify the Developer Certificate of Origin (DCO)."
Steps to set up the policy
- Write a section in
CONTRIBUTING.md. Put it in the root,docs/, or.github/. GitHub links this file from new pull requests and the repository's Contributing tab (GitHub Docs). - Define the scope. Say which tools count, and which uses do not need disclosure, such as spelling fixes or autocomplete. The kernel's guidelines give this kind of list.
- Add a disclosure field to the pull request template. Create
.github/pull_request_template.md(GitHub Docs). Include fields for: AI tools used, the parts affected, and how the change was tested. - Require a human sign-off on every commit. Tell contributors that only a person may add
Signed-off-by. - Ask for disclosure in commit messages when the change is large. Use a trailer such as
Assisted-by:. Git trailers are key-value lines at the end of a commit message (git-interpret-trailers). Name the convention in the policy, because the kernel and other projects do not all use the same trailer. - Enforce the review step. In branch protection, select Require approvals and Require review from Code Owners (GitHub Docs). A checkbox alone does not stop an undisclosed PR. A required review does.
- State the consequences. Say whether maintainers may close PRs with missing disclosure, and whether they may ask for more testing.
Attribution: which trailer to use
| Trailer | Meaning | Who uses it |
|---|---|---|
Signed-off-by |
Human certifies the DCO | Required on all kernel patches. AI must not add it. |
Co-authored-by |
Credits a second author; counts toward that person's GitHub contributions if the email is linked to their account | Documented by GitHub for multiple authors (GitHub Docs) |
Assisted-by |
Notes that a tool helped | Named in the kernel guidance as a disclosure option |
Do not use Co-authored-by to credit an AI tool unless your policy says so. It needs an email that a GitHub account can own, and a tool usually has none.
Limits of this research
- My repository searches for AI contribution policies returned no results. I could not compare how other projects word their policies. The kernel documents are the main source here.
- I did not check whether any particular project enforces this policy. I only read the rules the documents describe.
- This is general information, not legal advice. Check your license and DCO requirements with counsel if they matter for your project.
Choose the kernel model if you want transparency and maintainer discretion. Choose a stricter rule, such as a ban or a required review by a named owner, if your maintainers have little review time.
If you run more than one AI agent, a dedicated identity for each agent makes disclosure easier to trace. githug does this. Each agent gets its own key, and its commits carry trailers that name the accountable human, the agent, and the run. Adding the human as Co-authored-by is opt-in and off by default.