answered from live GitHub & Hugging Face data
How can I implement a disclosure policy for AI-generated pull requests in my GitHub repository?
Verdict: A pull request template alone is a disclosure request, not a disclosure policy. Pair it with a commit trailer and a required CI check.
I could not search GitHub for example AI-contribution policies because the search tool hit a rate limit. The steps below rely on GitHub Docs, git's reference, and the Linux kernel's written rules.
Step 1: Add a PR template with a disclosure section
- Create
.github/pull_request_template.mdin your default branch. GitHub shows this template in every new pull request body. (GitHub Docs) - Add a section that asks the author to state whether AI tools helped write the change.
- Ask for the tool name and the parts affected. Keep the question short so authors answer it.
The template is self-declared. Contributors can skip or misstate it.
Step 2: Require a machine-readable trailer in each commit
Use a commit trailer for the record. Git reads trailers from the end of a commit message. A trailer is a key-value line in a block that follows a blank line. (git-interpret-trailers)
The Linux kernel uses this format:
Assisted-by: LLM [TOOL1] [TOOL2](Linux kernel: AI Coding Assistants)
The kernel also sets two rules:
- AI agents must not add
Signed-off-by. Only a human can certify the Developer Certificate of Origin. - Basic tools such as git, gcc, make, and editors are not listed.
Adopt the Assisted-by key and the same two rules. Your policy then works for both humans and agents.
Step 3: Enforce the policy in CI
- Write a CI check that reads each commit message in the pull request.
- Fail the check if a commit lacks the trailer. Fail it if an AI agent adds
Signed-off-by. - Add a required status check with a repository ruleset. Rulesets can require status checks before a merge. (GitHub Docs: available rules for rulesets)
- Apply the ruleset to your default branch.
A local commit-msg hook helps contributors. CI is the real gate, because hooks can be skipped.
Step 4: Write the policy down
Add a CONTRIBUTING.md section. Include:
- Which AI uses require disclosure. Name the tools and the level of help.
- The trailer format and the example in Step 2.
- Who is responsible. The human submitter reviews the code and takes responsibility.
- What happens when a contributor omits disclosure.
Caveats
- Trailers show what the author declared. They do not prove how the code was written.
- Trailer rules do not cover licensing. Ask a lawyer if licensing risk matters for your project.
Recommendation
Use the PR template, the Assisted-by trailer, and a required CI check together. Each one covers a gap in the others.
- Choose the template only if you want a light touch for a small project.
- Add the CI check if you accept pull requests from strangers or run AI agents yourself.
githug covers the agent side of this. Its agent commits name the accountable human, the agent, and the run in trailers. Its hug CLI sets this up for agents that run git. The service is in beta and free to use.