[PATCH] docs/code-provenance: add an exception for non-creative AI changes

Paolo Bonzini posted 1 patch 3 days, 6 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250925075630.352720-1-pbonzini@redhat.com
docs/devel/code-provenance.rst | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
[PATCH] docs/code-provenance: add an exception for non-creative AI changes
Posted by Paolo Bonzini 3 days, 6 hours ago
AI tools can be used as a natural language refactoring engine for simple
tasks such as modifying all callers of a given function or all accesses
to a variable.  These tasks are interesting for an exception because:

* it is credible for a contributor to claim DCO compliance.  If the
contributor can reasonably make the same change with different tools or
with just an editor, which tool is used (including an LLM) should have
no bearing on compliance.  This also applies to less simple tasks such
as adding Python type annotations.

* they are relatively easy to test and review, and can provide noticeable
time savings;

* this kind of change is easily separated from more complex non-AI-generated
ones, which we encourage people to do anyway.  It is therefore natural
to highlight them as AI-generated.

Make an exception for patches that have "limited creative content" - that
is, mechanical transformations where the creativity lies in deciding what
to change rather than in how to implement the change.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/devel/code-provenance.rst | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/docs/devel/code-provenance.rst b/docs/devel/code-provenance.rst
index 8cdc56f6649..d6e86636964 100644
--- a/docs/devel/code-provenance.rst
+++ b/docs/devel/code-provenance.rst
@@ -290,9 +290,11 @@ Use of AI-generated content
 
 TL;DR:
 
-  **Current QEMU project policy is to DECLINE any contributions which are
+  **The general QEMU project policy is to DECLINE any contributions which are
   believed to include or derive from AI generated content. This includes
-  ChatGPT, Claude, Copilot, Llama and similar tools.**
+  ChatGPT, Claude, Copilot, Llama and similar tools.** The following exceptions
+  are acceptable:
+  * **Limited creative content** (e.g., mechanical transformations)
 
   **This policy does not apply to other uses of AI, such as researching APIs
   or algorithms, static analysis, or debugging, provided their output is not
@@ -323,8 +325,9 @@ content generators commonly available today is unclear.  The QEMU project is
 not willing or able to accept the legal risks of non-compliance.
 
 The QEMU project thus requires that contributors refrain from using AI content
-generators on patches intended to be submitted to the project, and will
-decline any contribution if use of AI is either known or suspected.
+generators on patches intended to be submitted to the project, with exceptions
+outlined below.  If use of AI is known or suspected to go beyond the exceptions,
+QEMU will decline a contribution.
 
 Examples of tools impacted by this policy includes GitHub's CoPilot, OpenAI's
 ChatGPT, Anthropic's Claude, and Meta's Code Llama, and code/content
@@ -347,3 +350,19 @@ requirements for contribution.  In particular, the "Signed-off-by"
 label in a patch submission is a statement that the author takes
 responsibility for the entire contents of the patch, including any parts
 that were generated or assisted by AI tools or other tools.
+
+The following exceptions are currently in place:
+
+**Limited creative content**
+  Mechanical transformations where there is reasonably only one way to
+  implement the change.  Any tool, as well as a manual change, would
+  produce substantially the same modifications to the code.  Examples
+  include adjustments to data structures, mechanical API migrations,
+  or applying non-functional changes uniformly across a codebase.
+
+It is highly encouraged to provide background information such as the
+prompts that were used, and to not mix AI- and human-written code in the
+same commit, as much as possible.
+
+Maintainers should ask for a second opinion and avoid applying the
+exception to their own patch submissions.
-- 
2.51.0
Re: [PATCH] docs/code-provenance: add an exception for non-creative AI changes
Posted by Peter Maydell 2 days ago
On Thu, 25 Sept 2025 at 08:56, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> AI tools can be used as a natural language refactoring engine for simple
> tasks such as modifying all callers of a given function or all accesses
> to a variable.  These tasks are interesting for an exception because:
>
> * it is credible for a contributor to claim DCO compliance.  If the
> contributor can reasonably make the same change with different tools or
> with just an editor, which tool is used (including an LLM) should have
> no bearing on compliance.  This also applies to less simple tasks such
> as adding Python type annotations.
>
> * they are relatively easy to test and review, and can provide noticeable
> time savings;
>
> * this kind of change is easily separated from more complex non-AI-generated
> ones, which we encourage people to do anyway.  It is therefore natural
> to highlight them as AI-generated.
>
> Make an exception for patches that have "limited creative content" - that
> is, mechanical transformations where the creativity lies in deciding what
> to change rather than in how to implement the change.

I figure I'll state my personal opinion on this one. This isn't
intended to be any kind of 'veto' on the question: I don't
feel that strongly about it (and I don't think I ought to
have a personal veto in any case).

I'm not enthusiastic. The current policy is essentially
"the legal risks are unclear and the project isn't willing
to accept them". That's a straightforward rule to follow
that doesn't require either the contributor or the reviewer
or the project to make a possibly difficult judgement call on
what counts as not in fact risky. As soon as we start adding
exceptions then either we the project are making those
judgement calls, or else we're pushing them on contributors
or reviewers. I prefer the simple "'no' until the legal
picture becomes less murky" rule we have currently.

-- PMM
Re: [PATCH] docs/code-provenance: add an exception for non-creative AI changes
Posted by Paolo Bonzini 1 day, 19 hours ago
On Fri, Sep 26, 2025, 16:39 Peter Maydell <peter.maydell@linaro.org> wrote:

> I figure I'll state my personal opinion on this one. This isn't
> intended to be any kind of 'veto' on the question: I don't
> feel that strongly about it (and I don't think I ought to
> have a personal veto in any case).
>
> I'm not enthusiastic. The current policy is essentially
> "the legal risks are unclear and the project isn't willing
> to accept them". That's a straightforward rule to follow
> that doesn't require either the contributor or the reviewer
> or the project to make a possibly difficult judgement call on
> what counts as not in fact risky. As soon as we start adding
> exceptions then either we the project are making those
> judgement calls, or else we're pushing them on contributors
> or reviewers. I prefer the simple "'no' until the legal
> picture becomes less murky" rule we have currently.
>

In principle I agree. I am not enthusiastic either. There are however two
problems in the current policy.

First, the policy is based on a honor code; in some cases the use of AI can
be easily spotted, but in general it's anything but trivial especially in
capable hands where, for example, code is generated by AI but commit
messages are not. As such, the policy cannot prevent inclusion of AI
generated code, it only tells you who is to blame.

Second, for this specific kind of change it is, pretty much, impossible to
tell whether it's generated with AI or by a specialized tool or by hand. If
you provide a way for people to be honest about their tool usage, and allow
it at least in some cases, there's a nonzero chance they will be; if you
just tell them a hard no, and lying by omission has more than plausible
deniability, there's a relatively high chance that they will just stay
silent on the matter while still using the tool.

In other words, as much as I would also like a simple policy, I expect
fewer undiscovered violations with the exception in place—even beyond what
the exception allows. And given the stated goal of using proposals and
actual usage to inform future policy, this approach could serve that goal
better than plain prohibition.

That said, I am okay with having no exception if that's the consensus.

Thanks,

Paolo


> -- PMM
>
>