All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions
@ 2026-11-24 16:42 Paolo Bonzini
  2026-11-24 16:42 ` [PATCH 1/3] docs/devel: relax " Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Paolo Bonzini @ 2026-11-24 16:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, peter.maydell, berrange, eblake, armbru, alex.bennee

As agreed in the community call, I'm posting a cleaned up version of
v5 patches 1-3, not including the permission for pre-arranged large
contributions.  However, the full text of AGENTS.md is included, as
that can be a useful way to steer agents in our preferred direction,
even for contributions not allowed by the policy.

To be clear, I don't think this is a particularly useful intermediate
step.  It all but encourages the same "don't ask, don't tell" behavior
that we had until now, perhaps even more since it does not mention
copyright anymore and therefore does not explain _why_ large contributions
are disallowed.  Also like the current prohibition, we won't get any
information other than gut feelings about when this happens.

To avoid that, I would like to have already an informal process for
evaluating AI-based contributions openly and on a case by case basis,
to understand what their prevalence could be and the impact on maintainer
review workloads.  (Personally, I'm more worried by a large amount of
small contributions and no path towards getting help in consolidating
them, than by a few large ones; but that may admittedly vary by subsystem).

Nevertheless, I plan to send this as a pull request next week, and keep
the rest for discussion in future months.

All changes from v5 are to the commit messages, other than removing
this sentence.

  No such agent currently exists; in the future, such official
  agents will be listed in the documentation.

Paolo

v5->v6: drop references to pre-arrangement in patch 1 commit message
        drop examples of agent behavior that were done on previous versions
        drop patch 4
        
Paolo Bonzini (3):
  docs/devel: relax policy on AI-generated contributions
  AGENTS.md: let agents know what the participation rules are
  AGENTS.md: make the human part of the design process

 docs/devel/code-provenance.rst |  71 ++----------
 docs/devel/index-process.rst   |   1 +
 docs/devel/llm-usage.rst       | 191 +++++++++++++++++++++++++++++++++
 AGENTS.md                      | 133 ++++++++++++++++++++---
 scripts/checkpatch.pl          |   5 +-
 5 files changed, 321 insertions(+), 80 deletions(-)
 create mode 100644 docs/devel/llm-usage.rst

-- 
2.56.1



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-24 16:42 [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions Paolo Bonzini
@ 2026-11-24 16:42 ` Paolo Bonzini
  2026-11-24 21:05   ` Peter Xu
  2026-11-25 17:07   ` Alex Bennée
  2026-11-24 16:42 ` [PATCH 2/3] AGENTS.md: let agents know what the participation rules are Paolo Bonzini
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 15+ messages in thread
From: Paolo Bonzini @ 2026-11-24 16:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, peter.maydell, berrange, eblake, armbru, alex.bennee

Until now QEMU's code provenance policy declined any contribution
believed to include or derive from AI-generated content.  A blanket ban
was easy to maintain while LLM output was rarely usable on its own, but
as the tools improved an absolute prohibition has become harder to
justify and enforce.

Even a simple code review task these days may result in the agent
suggesting code changes, or producing a useful test case to verify the
presence or absence of a bug.  A hardline interpretation of the policy
makes it hard to use AI even for tasks that are explicitly allowed.

Since the policy has been written, other projects have discussed and
taken their stance on AI contributions.  These vary from full prohibition
(though typically motivated by social reasons rather than legal, e.g.
for Zig) to limited use (e.g. GCC, allowing small contributions and
tests to use AI), to cautious experimentation.  Based on consensus of
the community, the proposed policy allows limited use, albeit wider than
what is allowed by for example GCC.

The previous policy was mostly motivated by intellectual property issues,
The Software Freedom Conservancy's recommendations on LLMs and generative
AI alleviate the concern on whether the submitter has the legal right to
contribute the code and about unintentional reproduction of copyrighted
code:

   "Copyleft Everything" remains the best viable and safest approach
   Certainly those who want to release FOSS under non-copyleft licenses
   have more to worry about when using these tools.

While we shouldn't treat copyleft as a silver bullet, it is effective
as part of a defense in depth strategy that includes, for example,
"de minimis" thresholds and `AGENTS.md` instructions that encourage user
participation in the design.

Therefore, the revised policy considers QEMU's copyleft to be a viable
approach to any unanswered legal questions about AI-generated
contributions and their copyright status.  This lets the policy
focus on the topic of what AI-assisted contributions require of
maintainers.

Going full circle to the reason why we might need to review the
policy, there is the question of how to make sure policy is applied.
QEMU maintainers have already experimented with using AGENTS.md files;
subsequent patches will also try to embody the "work better, not faster"
mantra into an AGENTS.md file.  Nevertheless, some explicit prohibitions
should be included in the policy, and they are indeed.  The list is short
and based on the Rust policy and the GStreamer AGENTS.md file.

Revise the policy according to the above considerations, and introduce the
"AI-used-for:" trailer as a record of where AI was used.  The standard is
slightly different from the more usual "Assisted-by"; the intention is for
the metadata to provide more information for reviewers to judge the result,
and to scope areas for which Signed-off-by cannot guarantee full control
of provenance.

For now, community consensus was to delay a decision on larger
contributions that are mostly or entirely AI-generated.  The feasibility
of rejecting such contributions remains to be seen; some contributions
that have been accepted in the past, and are suspected to be AI-assisted,
would still be disallowed.

In any case, use of AI does not relax any other contribution requirement:
authors still need to comply with the DCO (declaring that they have
corporate authorization to contribute, for example) and take technical
responsibility for their work.

[Commit message largely based on discussions with Daniel Berrangé,
 Alistair Francis, Peter Maydell, Kevin Wolf and others. - Paolo]

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 docs/devel/code-provenance.rst |  71 ++----------
 docs/devel/index-process.rst   |   1 +
 docs/devel/llm-usage.rst       | 191 +++++++++++++++++++++++++++++++++
 AGENTS.md                      |  37 ++++---
 scripts/checkpatch.pl          |   5 +-
 5 files changed, 225 insertions(+), 80 deletions(-)
 create mode 100644 docs/devel/llm-usage.rst

diff --git a/docs/devel/code-provenance.rst b/docs/devel/code-provenance.rst
index 65b8f232a08..7403961378e 100644
--- a/docs/devel/code-provenance.rst
+++ b/docs/devel/code-provenance.rst
@@ -128,6 +128,10 @@ that are commonly used during QEMU development:
    suggestions for how to change a patch, it is good practice to credit them
    by including a ``Suggested-by`` tag.
 
+ * **AI-used-for**: when AI/LLM tools were used to produce the patch, this tag
+   discloses what they were used for.  See :ref:`llm-usage` for the cases in
+   which it is required.
+
 Subsystem maintainer requirements
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -282,68 +286,5 @@ boilerplate code template which is then filled in to produce the final patch.
 The output of such a tool would still be considered the "preferred format",
 since it is intended to be a foundation for further human authored changes.
 Such tools are acceptable to use, provided there is clearly defined copyright
-and licensing for their output. Note in particular the caveats applying to AI
-content generators below.
-
-Use of AI-generated content
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-TL;DR:
-
-  **Current 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.**
-
-  **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
-  included in contributions.**
-
-The increasing prevalence of AI-assisted software development results in a
-number of difficult legal questions and risks for software projects, including
-QEMU.  Of particular concern is content generated by `Large Language Models
-<https://en.wikipedia.org/wiki/Large_language_model>`__ (LLMs).
-
-The QEMU community requires that contributors certify their patch submissions
-are made in accordance with the rules of the `Developer's Certificate of
-Origin (DCO) <dco>`.
-
-To satisfy the DCO, the patch contributor has to fully understand the
-copyright and license status of content they are contributing to QEMU. With AI
-content generators, the copyright and license status of the output is
-ill-defined with no generally accepted, settled legal foundation.
-
-Where the training material is known, it is common for it to include large
-volumes of material under restrictive licensing/copyright terms. Even where
-the training material is all known to be under open source licenses, it is
-likely to be under a variety of terms, not all of which will be compatible
-with QEMU's licensing requirements.
-
-How contributors could comply with DCO terms (b) or (c) for the output of AI
-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.
-
-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
-generation agents which are built on top of such tools.
-
-This policy may evolve as AI tools mature and the legal situation is
-clarified.
-
-Exceptions
-^^^^^^^^^^
-
-The QEMU project welcomes discussion on any exceptions to this policy,
-or more general revisions. This can be done by contacting the qemu-devel
-mailing list with details of a proposed tool, model, usage scenario, etc.
-that is beneficial to QEMU, while still mitigating issues around compliance
-with the DCO.  After discussion, any exception will be listed below.
-
-Exceptions do not remove the need for authors to comply with all other
-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.
+and licensing for their output. Note in particular the caveats applying to
+:ref:`AI content generators <llm-usage>`.
diff --git a/docs/devel/index-process.rst b/docs/devel/index-process.rst
index 5807752d704..ce0f4e73197 100644
--- a/docs/devel/index-process.rst
+++ b/docs/devel/index-process.rst
@@ -13,6 +13,7 @@ Notes about how to interact with the community and how and where to submit patch
    maintainers
    style
    submitting-a-patch
+   llm-usage
    code-provenance
    trivial-patches
    stable-process
diff --git a/docs/devel/llm-usage.rst b/docs/devel/llm-usage.rst
new file mode 100644
index 00000000000..133863a8ed1
--- /dev/null
+++ b/docs/devel/llm-usage.rst
@@ -0,0 +1,189 @@
+.. _llm-usage:
+
+Use of AI-generated content
+===========================
+
+.. warning::
+
+   Please read the below policy before using AI to contribute code or
+   documentation to QEMU.  This applies to ChatGPT, Claude, Copilot,
+   Llama, and similar tools.
+
+This document provides guidance around acceptable practices
+for using `Large Language Models
+<https://en.wikipedia.org/wiki/Large_language_model>`__ (LLMs)
+when contributing to QEMU.
+
+The QEMU project does not want to dictate what tools contributors
+use for their work on the project.  However, the increasing
+prevalence of AI-assisted software development and of LLMs specifically
+poses a number of difficult questions.  Risks to open source projects
+include maintainer burnout from an increased number of contributions, as
+well as the risk to the project from unintentional inclusion of copyrighted
+material in the LLM's output.
+
+In order to mitigate these risks, the QEMU project limits the way
+in which use of the output of generative AI can be included in
+contributions to QEMU.  The main guidelines for use of generative AI
+tools are as follows:
+
+- It's fine to use LLMs to answer questions, analyze, distill,
+  refine, check, suggest, review. Use of LLMs to *create* is limited.
+
+- If in doubt, disclose any use of AI tools other than simple code
+  completion and code review.
+
+- LLMs are allowed as a tool to write *better*, not *faster*.
+
+**For any kind of LLM usage, the expectation is that the human contributor
+shall be able to :ref:`understand and explain the changes <write_a_meaningful_commit_message>`,
+the design choices, and the rationale behind them.**
+
+.. note:: **Use of AI does not remove the need for authors to comply
+          with all other 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, certifying that their patch submission is made in
+          accordance with the rules of the :ref:`Developer's Certificate of
+          Origin (DCO) <dco>`.
+
+Prohibited use of AI
+''''''''''''''''''''
+
+The QEMU community is a collaboration between humans, not AI agent
+façades. The following items MUST be written by humans:
+
+- cover letters and commit messages
+
+- responses to reviewer comments
+
+- issue descriptions or comments
+
+Light copy editing of human-written text with an AI is allowed.
+
+An exception is made for defects detected by specialized tooling,
+including fuzzers and LLM-assisted defect detection. Such issues must
+be reviewed by a human before creation, must be created by a human and
+communication with maintainers must be done by a human, but including
+the verbatim tool output in the issue description is explicitly allowed.
+
+Repeated violations of these rules may be treated as a :ref:`code_of_conduct`
+violation.
+
+Official project agents may be exempted from one or more of these
+rules, at the discretion of the QEMU project maintainer(s).
+
+LLM-assisted and LLM-created contributions
+''''''''''''''''''''''''''''''''''''''''''
+
+Use of generative AI can be classified in the following buckets:
+
+- "background" assistance, such as completion and code review.  This does
+  not need disclosure.
+
+- small LLM-assisted bugfixes (as a rule of thumb, below 10 lines of code)
+  are allowed with disclosure.
+
+- use of LLMs to help generating parts of a larger patch---test cases,
+  adaptations of existing code, boilerplate code for a new API, a tool to
+  help performing mechanical changes, etc.  These are generally allowed;
+  disclosure is required for non-trivial, functional code changes.
+
+Large, heavily LLM-assisted contributions where LLMs write large parts
+of functional code are currently not allowed.
+
+LLM-created contributions will be held to a higher standard of testing
+than human-created ones.  Maintainers have freedom to determine what
+constitutes "high quality"; in particular, because LLMs lower the cost
+of patch generation, there are no exceptions for "writing the tests seems
+hard".
+
+Contributors who submit LLM-created contributions are required to
+apply the same judgment that would be applied to other code changes.
+They must invest substantial time reviewing the code and, when
+applicable, curating individual commits.
+
+The QEMU project explicitly forbids using LLMs to do "clean room"
+reimplementation of existing code whose license is not compatible
+with the GNU General Public License, version 2 **or later**.
+
+.. _ai-used-for:
+
+Commit messages for AI-assisted changes
+'''''''''''''''''''''''''''''''''''''''
+
+Whenever this policy requires disclosure of AI usage, contributing
+AI-assisted changes to QEMU requires you to certify that you followed
+the instructions in this document and in QEMU's ``AGENTS.md``.
+**To do so, include an ``AI-used-for:`` line before the
+:ref:`Signed-off-by <code-provenance>` line whenever the policy
+requires disclosure [2]_.** By using 'AI-used-for', a contributor
+identifies areas of the patch that involved use of AI/LLM, and attests
+that their usage of AI/LLMs was in compliance with QEMU policies.
+
+The text of the trailer is one or more of ``code``, ``tests``, or
+``docs``, possibly followed by an explanation in parentheses:
+
+.. code-block:: none
+
+     AI-used-for: tests, docs
+     AI-used-for: code
+     AI-used-for: code (refactoring)
+     AI-used-for: code (prototype)
+
+Do not include your prompts or summarize the conversation in the commit
+message or cover letter.  Extract any information that is relevant to the
+reviewer and include it in commit messages, cover letters or code comments.
+
+QEMU does *not* use ``Assisted-by``, ``Co-authored-by`` or ``Generated-by``
+trailers to indicate AI usage.  In particular, do not specify the exact
+AI model or tool used to create the commit.
+
+Deterministic tooling (sed, coccinelle, formatters) is out of scope for
+the trailer, but should be mentioned in the commit message.
+
+.. [2] ``AI-used-for`` must not be included unless some part of the patch
+       *content* was authored by the AI.  It should also not be included for
+       "background" usage such as autocomplete or obtaining a pre-review of
+       the patch.
+
+Motivation
+''''''''''
+
+There is not a consensus within the QEMU project---and likely never will
+be---about when/how/where it is acceptable to use AI-based tools.  Many
+members of the QEMU project and community find value in AI; many others
+feel that its negative impact on society and the climate are severe enough
+that no use is acceptable.  Still others are working out their opinion.
+
+In accordance with Software Freedom Conservancy's recommendations:
+
+- the project seeks to both support those contributors who outright reject
+  generative AI systems, and to not shun those who choose to use them;
+
+- we consider QEMU's copyleft to be a viable approach to the unanswered
+  legal questions about AI-generated contributions and their copyright
+  status;
+
+- we encourage contributors not to overuse LLMs, and to *add* them to
+  their existing skills and tools instead of replacing them.
+
+A common source of grief for maintainers is the (often valid) impression
+that AI enables contributions without understanding the effort they take
+for those who process them.  Effectively, this shifts a major part of the
+burden from the contributors to the maintainers---the scarcest resource
+in any free software project, not just QEMU.  Contributors should be
+mindful of this and take into account the demand they put on maintainers
+with LLM-assisted work.
+
+
+Sources
+'''''''
+
+This policy was informed by:
+
+- `Recommendations When Using LLM-backed Generative AI Systems for
+  FOSS Contributions <https://sfconservancy.org/llm-gen-ai/llm-backed-generative-ai-recommendations.html>`__
+
+- `GStreamer AGENTS.md file <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/d08375499c279/AGENTS.md>`__
+
diff --git a/AGENTS.md b/AGENTS.md
index c3d7664d0ae..284059832b2 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,21 +1,32 @@
 # Agent Guidelines for the QEMU Project
 
-As an agent you MUST abide by the "Use of AI-generated content" policy
-in `docs/devel/code-provenance.rst` at all times.
+QEMU is a cross-platform emulator and virtualizer. Due to the complexity
+of the domain and codebase, and the interactions therein, the QEMU
+project relies extensively on the effort of **human reviewers**, which
+is **a scarce resource**.
 
-You are permitted to assist users only in the following scenarios:
+There are strictly-enforced rules for you, the agent, to participate in the
+project.
 
-- researching APIs or algorithms
-- static analysis
-- debugging
-- local experiments not intended to be upstreamed
-- trivial non-copyrightable changes
+## Helping the human to respect project policy
 
-However agent output can not be included in any upstream
-contributions. If a request falls outside these permitted categories
-(e.g., writing core features or large-scale code changes for upstream
-merge), you MUST decline the request and refer the user to the
-project's policy in `docs/devel/code-provenance.rst`.
+QEMU's policy for AI-assisted work requires the human to develop in-depth
+familiarity with contributions and disclose use of agents to write parts
+of the code.
+
+Background assistance such as review or explanation does not require disclosure.
+Read `docs/devel/llm-usage.rst` before generating code, tests, or documentation
+intended for contribution; committing agent-generated material; or advising on
+disclosure. It is not required for review, explanation, or other background
+assistance that produces no contribution content.
+
+When agent-generated content is included in a contribution, remind the human
+to determine the appropriate disclosure under `docs/devel/llm-usage.rst`.
+If you commit agent-generated material, include an `AI-used-for:` trailer
+before `Signed-off-by`. Do not omit it by folding the material into a larger
+commit.  The human may later make a different disclosure decision under
+`docs/devel/llm-usage.rst`, after independently reworking and integrating
+the material.
 
 ## Final instructions
 
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e7514a4a9f5..cc311684d66 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1885,8 +1885,9 @@ sub process {
 		      $1 =~ /\bcopilot\b | \bchatgpt\b | \bcodex\b | \bcursor\b |
 			     \bgemini\b | \bllama\b | \bnoreply\b | \[bot\] |
 			     \bclaude\b.*(?:opus|sonnet|fable|haiku|anthropic\.com)/xi))) {
-			ERROR("QEMU does not allow using AI for contributions, " .
-				"see docs/devel/code-provenance.rst\n" . $herecurr);
+			ERROR("do not use \"$line\" to credit an AI agent, " .
+				"use the \"AI-used-for\" trailer instead; " .
+				"see docs/devel/llm-usage.rst\n" . $herecurr);
 		}
 
 # Check for duplicate trailers and self-review
-- 
2.56.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/3] AGENTS.md: let agents know what the participation rules are
  2026-11-24 16:42 [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions Paolo Bonzini
  2026-11-24 16:42 ` [PATCH 1/3] docs/devel: relax " Paolo Bonzini
@ 2026-11-24 16:42 ` Paolo Bonzini
  2026-11-24 19:41   ` Eric Blake
  2026-11-24 16:42 ` [PATCH 3/3] AGENTS.md: make the human part of the design process Paolo Bonzini
  2026-11-24 20:08 ` [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions BALATON Zoltan
  3 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2026-11-24 16:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, peter.maydell, berrange, eblake, armbru, alex.bennee

Humans seem to be extremely unreliable in following rules around this,
even after being told directly and repeatedly. Telling agents what to
do seems to yield better results.

The starting point for this document is GStreamer's AGENTS.md file, as
of commit d08375499c279a56c0e77c928fbeae0d80cdf937.  I used GStreamer's
agent instructions in the context of Meson, which uses a very similar
file, and it's both annoying and too willing to take the lead once the
model decides that it likes you.

To avoid this, the text tries to favor cooperation between agent and user.
It suggests that the agent includes the state of the work when committing,
so that contributors have the material they need to review the agent's
work.

Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 AGENTS.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/AGENTS.md b/AGENTS.md
index 284059832b2..d646d548535 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -8,12 +8,80 @@ is **a scarce resource**.
 There are strictly-enforced rules for you, the agent, to participate in the
 project.
 
+## Interactions with maintainers must be human-human
+
+The QEMU project has strict rules on what AI-generated material can
+reach the maintainers.
+
+### No AI-written text must reach maintainers
+
+These rules apply when publishing AI-assisted work to GitLab or the mailing list:
+
+- **AI-written cover letters and commit messages are banned**.  These are
+  easy to recognize and waste reviewers' time.
+- **AI-generated responses to reviewer comments are banned**. This undermines
+  the human-to-human interaction fundamental to code review.
+- **AI-written issue ("work item") descriptions or comments are banned**. These
+  are verbose and waste triagers' time.
+  - An exception is made for issues for defects detected by automated or
+    semi-automated tooling, including fuzzers and LLM-assisted defect
+    detection.  Such issues must be reviewed by a human before creation,
+    must be created by a human and communication with maintainers must
+    be done by a human, but including the verbatim tool output in the
+    issue description is explicitly allowed.
+
+Copy editing of human-written text, for example to help non-native speakers,
+is allowed. Keep such edits small and precise.
+
+The human's workflow may require you to perform commits or request you to
+produce private drafts of maintainer-facing text.  These are allowed, but must
+be marked as requiring rewrite by a human before publication.
+
+### No automated posting
+
+Assume that you are *not* an "official project agent" and that the
+official agent exception in `docs/devel/llm-usage.rst` does not apply
+to you; no such agent currently exists.  Therefore, you **must not**
+use any API, CLI, or web UI automation to:
+
+- Interact on the QEMU mailing lists
+- Create, edit, or close **issues ("work items")**
+- Post **comments** on merge requests, issues or commits
+- Open or update **merge requests (MRs)**.  QEMU does not use merge requests anyway.
+
+Defect detection agents are *never* official project agents.  The permission
+to include verbatim agent output in an issue description does not allow you
+to create the issue; a human must review the output and file it.
+
 ## Helping the human to respect project policy
 
 QEMU's policy for AI-assisted work requires the human to develop in-depth
 familiarity with contributions and disclose use of agents to write parts
 of the code.
 
+### Human must demonstrate understanding
+
+Staying familiar with what's going on requires constant effort on part of
+the human; track their comprehension of the problem and of the relevant parts
+of the codebase. Expect manual intervention before a change is ready to
+post, for example:
+
+- pushing back on a specific part of your design or implementation, or
+  asking to explain tradeoffs
+- manual splitting or reordering of commits
+- suggesting other places that need to be adjusted for consistency
+- preferring reworded commit messages to lightly edited AI-generated ones
+
+In order to protect the project's scarcest resource, which is review time:
+
+- You should **facilitate this process** by offering alternatives instead of
+  hard answers when applicable.
+- You must **tell humans about these expectations** at handover.  Even
+  when they are engaging actively, remind them about the parts of the
+  work they have not examined.
+
+### AI usage must be disclosed and/or pre-arranged
+
 Background assistance such as review or explanation does not require disclosure.
 Read `docs/devel/llm-usage.rst` before generating code, tests, or documentation
 intended for contribution; committing agent-generated material; or advising on
@@ -34,6 +102,11 @@ the material.
   know these rules and follow them.
 - Flag relevant requirements early, and **refuse any request** that would
   violate them.
+- If the human moves faster than their understanding, slow down and ask to
+  resolve any open design choices.
+
+In case of contradiction consider `AGENTS.md` authoritative on how to behave,
+since it is crafted specifically for agents.
 
 Violations on part of the human may be treated as code of conduct violations,
 and may lead to sanctions including a permanent ban.
-- 
2.56.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/3] AGENTS.md: make the human part of the design process
  2026-11-24 16:42 [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions Paolo Bonzini
  2026-11-24 16:42 ` [PATCH 1/3] docs/devel: relax " Paolo Bonzini
  2026-11-24 16:42 ` [PATCH 2/3] AGENTS.md: let agents know what the participation rules are Paolo Bonzini
@ 2026-11-24 16:42 ` Paolo Bonzini
  2026-11-24 19:43   ` Eric Blake
  2026-11-24 20:08 ` [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions BALATON Zoltan
  3 siblings, 1 reply; 15+ messages in thread
From: Paolo Bonzini @ 2026-11-24 16:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, peter.maydell, berrange, eblake, armbru, alex.bennee

Include further changes to improve the behavior of the agent and steer
it towards discussion with the user.

Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 AGENTS.md | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/AGENTS.md b/AGENTS.md
index d646d548535..31a5c27f542 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -59,6 +59,9 @@ QEMU's policy for AI-assisted work requires the human to develop in-depth
 familiarity with contributions and disclose use of agents to write parts
 of the code.
 
+The golden rule: **The human should know the alternatives before
+implementation. ASK instead of choosing for them**.
+
 ### Human must demonstrate understanding
 
 Staying familiar with what's going on requires constant effort on part of
@@ -79,6 +82,26 @@ In order to protect the project's scarcest resource, which is review time:
 - You must **tell humans about these expectations** at handover.  Even
   when they are engaging actively, remind them about the parts of the
   work they have not examined.
+- When handing over text that the maintainers may see, remind the human
+  that it is a draft and name any design choices that are still open.
+
+### Make the human part of the design process
+
+In order to guide the design rather than providing an all-encompassing
+solution:
+
+- You must **discuss design choices in the main conversation**.  Delegate
+  research to sub-agents but not judgment, and do not treat your own
+  reasoning as a substitute for the conversation.
+- When you consult a subagent, **report what it recommended**, and ask
+  the human to choose between applicable alternatives instead of
+  presenting a single outcome.
+- Report everything you notice that is relevant, for example behavior
+  changes outside the scenario being discussed, and leave the decision to
+  the human.
+- Reinstate as visible text any design decision made while thinking.
+  Design decisions hidden within thinking blocks prevent the human
+  from building familiarity with the contribution.
 
 ### AI usage must be disclosed and/or pre-arranged
 
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/3] AGENTS.md: let agents know what the participation rules are
  2026-11-24 16:42 ` [PATCH 2/3] AGENTS.md: let agents know what the participation rules are Paolo Bonzini
@ 2026-11-24 19:41   ` Eric Blake
  0 siblings, 0 replies; 15+ messages in thread
From: Eric Blake @ 2026-11-24 19:41 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, philmd, peter.maydell, berrange, armbru, alex.bennee

On Tue, Nov 24, 2026 at 05:42:16PM +0100, Paolo Bonzini wrote:
> Humans seem to be extremely unreliable in following rules around this,
> even after being told directly and repeatedly. Telling agents what to
> do seems to yield better results.
> 
> The starting point for this document is GStreamer's AGENTS.md file, as
> of commit d08375499c279a56c0e77c928fbeae0d80cdf937.  I used GStreamer's
> agent instructions in the context of Meson, which uses a very similar
> file, and it's both annoying and too willing to take the lead once the
> model decides that it likes you.
> 
> To avoid this, the text tries to favor cooperation between agent and user.
> It suggests that the agent includes the state of the work when committing,
> so that contributors have the material they need to review the agent's
> work.
> 
> Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  AGENTS.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 73 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/3] AGENTS.md: make the human part of the design process
  2026-11-24 16:42 ` [PATCH 3/3] AGENTS.md: make the human part of the design process Paolo Bonzini
@ 2026-11-24 19:43   ` Eric Blake
  0 siblings, 0 replies; 15+ messages in thread
From: Eric Blake @ 2026-11-24 19:43 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, philmd, peter.maydell, berrange, armbru, alex.bennee

On Tue, Nov 24, 2026 at 05:42:17PM +0100, Paolo Bonzini wrote:
> Include further changes to improve the behavior of the agent and steer
> it towards discussion with the user.
> 
> Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  AGENTS.md | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions
  2026-11-24 16:42 [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions Paolo Bonzini
                   ` (2 preceding siblings ...)
  2026-11-24 16:42 ` [PATCH 3/3] AGENTS.md: make the human part of the design process Paolo Bonzini
@ 2026-11-24 20:08 ` BALATON Zoltan
  3 siblings, 0 replies; 15+ messages in thread
From: BALATON Zoltan @ 2026-11-24 20:08 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, philmd, peter.maydell, berrange, eblake, armbru,
	alex.bennee

On Tue, 24 Nov 2026, Paolo Bonzini wrote:
> As agreed in the community call, I'm posting a cleaned up version of
> v5 patches 1-3, not including the permission for pre-arranged large
> contributions.  However, the full text of AGENTS.md is included, as
> that can be a useful way to steer agents in our preferred direction,
> even for contributions not allowed by the policy.
>
> To be clear, I don't think this is a particularly useful intermediate
> step.  It all but encourages the same "don't ask, don't tell" behavior
> that we had until now, perhaps even more since it does not mention
> copyright anymore and therefore does not explain _why_ large contributions
> are disallowed.  Also like the current prohibition, we won't get any

In that case should we leave in the copyright problem which is still 
a valid concern to explain why we only allow small patches for now?

Regards,
BALATON Zoltan

> information other than gut feelings about when this happens.
>
> To avoid that, I would like to have already an informal process for
> evaluating AI-based contributions openly and on a case by case basis,
> to understand what their prevalence could be and the impact on maintainer
> review workloads.  (Personally, I'm more worried by a large amount of
> small contributions and no path towards getting help in consolidating
> them, than by a few large ones; but that may admittedly vary by subsystem).
>
> Nevertheless, I plan to send this as a pull request next week, and keep
> the rest for discussion in future months.
>
> All changes from v5 are to the commit messages, other than removing
> this sentence.
>
>  No such agent currently exists; in the future, such official
>  agents will be listed in the documentation.
>
> Paolo
>
> v5->v6: drop references to pre-arrangement in patch 1 commit message
>        drop examples of agent behavior that were done on previous versions
>        drop patch 4
>
> Paolo Bonzini (3):
>  docs/devel: relax policy on AI-generated contributions
>  AGENTS.md: let agents know what the participation rules are
>  AGENTS.md: make the human part of the design process
>
> docs/devel/code-provenance.rst |  71 ++----------
> docs/devel/index-process.rst   |   1 +
> docs/devel/llm-usage.rst       | 191 +++++++++++++++++++++++++++++++++
> AGENTS.md                      | 133 ++++++++++++++++++++---
> scripts/checkpatch.pl          |   5 +-
> 5 files changed, 321 insertions(+), 80 deletions(-)
> create mode 100644 docs/devel/llm-usage.rst
>
>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-24 16:42 ` [PATCH 1/3] docs/devel: relax " Paolo Bonzini
@ 2026-11-24 21:05   ` Peter Xu
  2026-11-24 21:09     ` Peter Maydell
  2026-11-26 12:14     ` Markus Armbruster
  2026-11-25 17:07   ` Alex Bennée
  1 sibling, 2 replies; 15+ messages in thread
From: Peter Xu @ 2026-11-24 21:05 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: qemu-devel, philmd, peter.maydell, berrange, eblake, armbru,
	alex.bennee

On Tue, Nov 24, 2026 at 05:42:15PM +0100, Paolo Bonzini wrote:
> +The QEMU community is a collaboration between humans, not AI agent
> +façades. The following items MUST be written by humans:
> +
> +- cover letters and commit messages
> +
> +- responses to reviewer comments
> +
> +- issue descriptions or comments

[Just a pure comment, so not a request to change anything at v6 to block the
 pull at all]

I think this is the part I raised the pure question in the upstream call
today, on that we won't really be able to identify what is written by AI,
and what is written by human.

If we can't identify that in a realiable way, IMHO the policy here will be
hard to carry out.

It is also not nice to happen false positives that we assumed something AI
generated but in reality written by the author, so we may always want to at
least ask politely, or think twice before assuming the series contains AI
generated contents of above just for courtesy.  It's just that the more we
do so, the less helpful this rule is..

The other thing is I need to confess new models can generate good commit
messages, cover letters, etc.  at least when I tried, and at least
sometimes.  I need to confess AI is also the best English teacher at least
for me..

I had this feeling that this rule will only add (some light) burden to
whoever fully respect QEMU's policy, and even if AI could have generated
something very usable as a base draft (obviously, above didn't even allow
human updating the AI generated contents).  Then for many who have
generated good AI commit messages and didn't notice this rule, we likely
will just let those pass too assuming it's "human words".

OTOH, to me it'll be very helpful if we could provide what we want exactly
in cover letters and commit logs into AGENTS.md.  It can be either pure
formats, styles of expressions, best practices of comments, etc.  But
actually I'm not sure either, because IIUC very new models are getting rid
of skills people wrote and can do sometimes even better with shorter prompt
than complex + long prompts, so maybe we really only want to add the most
important prompts when we really want to do so.

Thanks,

-- 
Peter Xu


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-24 21:05   ` Peter Xu
@ 2026-11-24 21:09     ` Peter Maydell
  2026-11-24 21:44       ` Peter Xu
  2026-11-26 12:14     ` Markus Armbruster
  1 sibling, 1 reply; 15+ messages in thread
From: Peter Maydell @ 2026-11-24 21:09 UTC (permalink / raw)
  To: Peter Xu
  Cc: Paolo Bonzini, qemu-devel, philmd, berrange, eblake, armbru,
	alex.bennee

On Tue, 24 Nov 2026 at 21:05, Peter Xu <peterx@redhat.com> wrote:
> OTOH, to me it'll be very helpful if we could provide what we want exactly
> in cover letters and commit logs into AGENTS.md.  It can be either pure
> formats, styles of expressions, best practices of comments, etc.  But
> actually I'm not sure either, because IIUC very new models are getting rid
> of skills people wrote and can do sometimes even better with shorter prompt
> than complex + long prompts, so maybe we really only want to add the most
> important prompts when we really want to do so.

What I want from a cover letter and commit message is the *human*
intent behind the change. I don't want a robot's summary of the
code changes. This to me is connected to the older idea of
"explain why, not what" for commit messages and comments.

-- PMM


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-24 21:09     ` Peter Maydell
@ 2026-11-24 21:44       ` Peter Xu
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Xu @ 2026-11-24 21:44 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Paolo Bonzini, qemu-devel, philmd, berrange, eblake, armbru,
	alex.bennee

On Tue, Nov 24, 2026 at 09:09:07PM +0000, Peter Maydell wrote:
> On Tue, 24 Nov 2026 at 21:05, Peter Xu <peterx@redhat.com> wrote:
> > OTOH, to me it'll be very helpful if we could provide what we want exactly
> > in cover letters and commit logs into AGENTS.md.  It can be either pure
> > formats, styles of expressions, best practices of comments, etc.  But
> > actually I'm not sure either, because IIUC very new models are getting rid
> > of skills people wrote and can do sometimes even better with shorter prompt
> > than complex + long prompts, so maybe we really only want to add the most
> > important prompts when we really want to do so.
> 
> What I want from a cover letter and commit message is the *human*
> intent behind the change. I don't want a robot's summary of the
> code changes. This to me is connected to the older idea of
> "explain why, not what" for commit messages and comments.

So my suspect is some modern AI models already do "explain why, not what"
well.  But yes, I fully understand the concern and share the feeling.

My comment was more about the challenge that we may not really be able to
execute on this one well.  And, IMHO, when we can't identify, we'll need to
fallback to start justify "if this is good cover-letter / commit log" then
we will accept AI generated contents.  Said that, as long as they're in
very good quality and helps QEMU community (also with the hope that it's
not already burnout all maintainers..), IMHO it's fine merging.

Thanks,

-- 
Peter Xu



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-24 16:42 ` [PATCH 1/3] docs/devel: relax " Paolo Bonzini
  2026-11-24 21:05   ` Peter Xu
@ 2026-11-25 17:07   ` Alex Bennée
  1 sibling, 0 replies; 15+ messages in thread
From: Alex Bennée @ 2026-11-25 17:07 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, philmd, peter.maydell, berrange, eblake, armbru

Paolo Bonzini <pbonzini@redhat.com> writes:

> Until now QEMU's code provenance policy declined any contribution
> believed to include or derive from AI-generated content.  A blanket ban
> was easy to maintain while LLM output was rarely usable on its own, but
> as the tools improved an absolute prohibition has become harder to
> justify and enforce.
>
> Even a simple code review task these days may result in the agent
> suggesting code changes, or producing a useful test case to verify the
> presence or absence of a bug.  A hardline interpretation of the policy
> makes it hard to use AI even for tasks that are explicitly allowed.
>
> Since the policy has been written, other projects have discussed and
> taken their stance on AI contributions.  These vary from full prohibition
> (though typically motivated by social reasons rather than legal, e.g.
> for Zig) to limited use (e.g. GCC, allowing small contributions and
> tests to use AI), to cautious experimentation.  Based on consensus of
> the community, the proposed policy allows limited use, albeit wider than
> what is allowed by for example GCC.
>
> The previous policy was mostly motivated by intellectual property issues,
> The Software Freedom Conservancy's recommendations on LLMs and generative
> AI alleviate the concern on whether the submitter has the legal right to
> contribute the code and about unintentional reproduction of copyrighted
> code:
>
>    "Copyleft Everything" remains the best viable and safest approach
>    Certainly those who want to release FOSS under non-copyleft licenses
>    have more to worry about when using these tools.
>
> While we shouldn't treat copyleft as a silver bullet, it is effective
> as part of a defense in depth strategy that includes, for example,
> "de minimis" thresholds and `AGENTS.md` instructions that encourage user
> participation in the design.
>
> Therefore, the revised policy considers QEMU's copyleft to be a viable
> approach to any unanswered legal questions about AI-generated
> contributions and their copyright status.  This lets the policy
> focus on the topic of what AI-assisted contributions require of
> maintainers.
>
> Going full circle to the reason why we might need to review the
> policy, there is the question of how to make sure policy is applied.
> QEMU maintainers have already experimented with using AGENTS.md files;
> subsequent patches will also try to embody the "work better, not faster"
> mantra into an AGENTS.md file.  Nevertheless, some explicit prohibitions
> should be included in the policy, and they are indeed.  The list is short
> and based on the Rust policy and the GStreamer AGENTS.md file.
>
> Revise the policy according to the above considerations, and introduce the
> "AI-used-for:" trailer as a record of where AI was used.  The standard is
> slightly different from the more usual "Assisted-by"; the intention is for
> the metadata to provide more information for reviewers to judge the result,
> and to scope areas for which Signed-off-by cannot guarantee full control
> of provenance.
>
> For now, community consensus was to delay a decision on larger
> contributions that are mostly or entirely AI-generated.  The feasibility
> of rejecting such contributions remains to be seen; some contributions
> that have been accepted in the past, and are suspected to be AI-assisted,
> would still be disallowed.
>
> In any case, use of AI does not relax any other contribution requirement:
> authors still need to comply with the DCO (declaring that they have
> corporate authorization to contribute, for example) and take technical
> responsibility for their work.
>
> [Commit message largely based on discussions with Daniel Berrangé,
>  Alistair Francis, Peter Maydell, Kevin Wolf and others. - Paolo]
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  docs/devel/code-provenance.rst |  71 ++----------
>  docs/devel/index-process.rst   |   1 +
>  docs/devel/llm-usage.rst       | 191 +++++++++++++++++++++++++++++++++
>  AGENTS.md                      |  37 ++++---
>  scripts/checkpatch.pl          |   5 +-
>  5 files changed, 225 insertions(+), 80 deletions(-)
>  create mode 100644 docs/devel/llm-usage.rst
>
> diff --git a/docs/devel/code-provenance.rst b/docs/devel/code-provenance.rst
> index 65b8f232a08..7403961378e 100644
> --- a/docs/devel/code-provenance.rst
> +++ b/docs/devel/code-provenance.rst
> @@ -128,6 +128,10 @@ that are commonly used during QEMU development:
>     suggestions for how to change a patch, it is good practice to credit them
>     by including a ``Suggested-by`` tag.
>  
> + * **AI-used-for**: when AI/LLM tools were used to produce the patch, this tag
> +   discloses what they were used for.  See :ref:`llm-usage` for the cases in
> +   which it is required.
> +
>  Subsystem maintainer requirements
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  
> @@ -282,68 +286,5 @@ boilerplate code template which is then filled in to produce the final patch.
>  The output of such a tool would still be considered the "preferred format",
>  since it is intended to be a foundation for further human authored changes.
>  Such tools are acceptable to use, provided there is clearly defined copyright
> -and licensing for their output. Note in particular the caveats applying to AI
> -content generators below.
> -
> -Use of AI-generated content
> -~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -
> -TL;DR:
> -
> -  **Current 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.**
> -
> -  **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
> -  included in contributions.**
> -
> -The increasing prevalence of AI-assisted software development results in a
> -number of difficult legal questions and risks for software projects, including
> -QEMU.  Of particular concern is content generated by `Large Language Models
> -<https://en.wikipedia.org/wiki/Large_language_model>`__ (LLMs).
> -
> -The QEMU community requires that contributors certify their patch submissions
> -are made in accordance with the rules of the `Developer's Certificate of
> -Origin (DCO) <dco>`.
> -
> -To satisfy the DCO, the patch contributor has to fully understand the
> -copyright and license status of content they are contributing to QEMU. With AI
> -content generators, the copyright and license status of the output is
> -ill-defined with no generally accepted, settled legal foundation.
> -
> -Where the training material is known, it is common for it to include large
> -volumes of material under restrictive licensing/copyright terms. Even where
> -the training material is all known to be under open source licenses, it is
> -likely to be under a variety of terms, not all of which will be compatible
> -with QEMU's licensing requirements.
> -
> -How contributors could comply with DCO terms (b) or (c) for the output of AI
> -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.
> -
> -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
> -generation agents which are built on top of such tools.
> -
> -This policy may evolve as AI tools mature and the legal situation is
> -clarified.
> -
> -Exceptions
> -^^^^^^^^^^
> -
> -The QEMU project welcomes discussion on any exceptions to this policy,
> -or more general revisions. This can be done by contacting the qemu-devel
> -mailing list with details of a proposed tool, model, usage scenario, etc.
> -that is beneficial to QEMU, while still mitigating issues around compliance
> -with the DCO.  After discussion, any exception will be listed below.
> -
> -Exceptions do not remove the need for authors to comply with all other
> -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.
> +and licensing for their output. Note in particular the caveats applying to
> +:ref:`AI content generators <llm-usage>`.
> diff --git a/docs/devel/index-process.rst b/docs/devel/index-process.rst
> index 5807752d704..ce0f4e73197 100644
> --- a/docs/devel/index-process.rst
> +++ b/docs/devel/index-process.rst
> @@ -13,6 +13,7 @@ Notes about how to interact with the community and how and where to submit patch
>     maintainers
>     style
>     submitting-a-patch
> +   llm-usage
>     code-provenance
>     trivial-patches
>     stable-process
> diff --git a/docs/devel/llm-usage.rst b/docs/devel/llm-usage.rst
> new file mode 100644
> index 00000000000..133863a8ed1
> --- /dev/null
> +++ b/docs/devel/llm-usage.rst
> @@ -0,0 +1,189 @@
> +.. _llm-usage:
> +
> +Use of AI-generated content
> +===========================
> +
> +.. warning::
> +
> +   Please read the below policy before using AI to contribute code or
> +   documentation to QEMU.  This applies to ChatGPT, Claude, Copilot,
> +   Llama, and similar tools.
> +
> +This document provides guidance around acceptable practices
> +for using `Large Language Models
> +<https://en.wikipedia.org/wiki/Large_language_model>`__ (LLMs)
> +when contributing to QEMU.
> +
> +The QEMU project does not want to dictate what tools contributors
> +use for their work on the project.  However, the increasing
> +prevalence of AI-assisted software development and of LLMs specifically
> +poses a number of difficult questions.  Risks to open source projects
> +include maintainer burnout from an increased number of contributions, as
> +well as the risk to the project from unintentional inclusion of copyrighted
> +material in the LLM's output.
> +
> +In order to mitigate these risks, the QEMU project limits the way
> +in which use of the output of generative AI can be included in
> +contributions to QEMU.  The main guidelines for use of generative AI
> +tools are as follows:
> +
> +- It's fine to use LLMs to answer questions, analyze, distill,
> +  refine, check, suggest, review. Use of LLMs to *create* is limited.
> +
> +- If in doubt, disclose any use of AI tools other than simple code
> +  completion and code review.
> +
> +- LLMs are allowed as a tool to write *better*, not *faster*.
> +
> +**For any kind of LLM usage, the expectation is that the human contributor
> +shall be able to :ref:`understand and explain the changes <write_a_meaningful_commit_message>`,
> +the design choices, and the rationale behind them.**

I think this reference is mangled as it doesn't render properly. (goes
further down) ahh it looks like ** and :ref: also doesn't play nicely.

> +
> +.. note:: **Use of AI does not remove the need for authors to comply
> +          with all other 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, certifying that their patch submission is made in
> +          accordance with the rules of the :ref:`Developer's Certificate of
> +          Origin (DCO) <dco>`.
> +
> +Prohibited use of AI
> +''''''''''''''''''''
> +
> +The QEMU community is a collaboration between humans, not AI agent
> +façades. The following items MUST be written by humans:
> +
> +- cover letters and commit messages
> +
> +- responses to reviewer comments
> +
> +- issue descriptions or comments
> +
> +Light copy editing of human-written text with an AI is allowed.
> +
> +An exception is made for defects detected by specialized tooling,
> +including fuzzers and LLM-assisted defect detection. Such issues must
> +be reviewed by a human before creation, must be created by a human and
> +communication with maintainers must be done by a human, but including
> +the verbatim tool output in the issue description is explicitly allowed.
> +
> +Repeated violations of these rules may be treated as a :ref:`code_of_conduct`
> +violation.
> +
> +Official project agents may be exempted from one or more of these
> +rules, at the discretion of the QEMU project maintainer(s).
> +
> +LLM-assisted and LLM-created contributions
> +''''''''''''''''''''''''''''''''''''''''''
> +
> +Use of generative AI can be classified in the following buckets:
> +
> +- "background" assistance, such as completion and code review.  This does
> +  not need disclosure.
> +
> +- small LLM-assisted bugfixes (as a rule of thumb, below 10 lines of code)
> +  are allowed with disclosure.
> +
> +- use of LLMs to help generating parts of a larger patch---test cases,
> +  adaptations of existing code, boilerplate code for a new API, a tool to
> +  help performing mechanical changes, etc.  These are generally allowed;
> +  disclosure is required for non-trivial, functional code changes.
> +
> +Large, heavily LLM-assisted contributions where LLMs write large parts
> +of functional code are currently not allowed.
> +
> +LLM-created contributions will be held to a higher standard of testing
> +than human-created ones.  Maintainers have freedom to determine what
> +constitutes "high quality"; in particular, because LLMs lower the cost
> +of patch generation, there are no exceptions for "writing the tests seems
> +hard".
> +
> +Contributors who submit LLM-created contributions are required to
> +apply the same judgment that would be applied to other code changes.
> +They must invest substantial time reviewing the code and, when
> +applicable, curating individual commits.
> +
> +The QEMU project explicitly forbids using LLMs to do "clean room"
> +reimplementation of existing code whose license is not compatible
> +with the GNU General Public License, version 2 **or later**.
> +
> +.. _ai-used-for:
> +
> +Commit messages for AI-assisted changes
> +'''''''''''''''''''''''''''''''''''''''
> +
> +Whenever this policy requires disclosure of AI usage, contributing
> +AI-assisted changes to QEMU requires you to certify that you followed
> +the instructions in this document and in QEMU's ``AGENTS.md``.
> +**To do so, include an ``AI-used-for:`` line before the
> +:ref:`Signed-off-by <code-provenance>` line whenever the policy
> +requires disclosure [2]_.** By using 'AI-used-for',

Hmm mixing * with ``emphasis`` also seems to break rendering. 

> a contributor
> +identifies areas of the patch that involved use of AI/LLM, and attests
> +that their usage of AI/LLMs was in compliance with QEMU policies.
> +
> +The text of the trailer is one or more of ``code``, ``tests``, or
> +``docs``, possibly followed by an explanation in parentheses:
> +
> +.. code-block:: none
> +
> +     AI-used-for: tests, docs
> +     AI-used-for: code
> +     AI-used-for: code (refactoring)
> +     AI-used-for: code (prototype)
> +
> +Do not include your prompts or summarize the conversation in the commit
> +message or cover letter.  Extract any information that is relevant to the
> +reviewer and include it in commit messages, cover letters or code comments.
> +
> +QEMU does *not* use ``Assisted-by``, ``Co-authored-by`` or ``Generated-by``
> +trailers to indicate AI usage.  In particular, do not specify the exact
> +AI model or tool used to create the commit.
> +
> +Deterministic tooling (sed, coccinelle, formatters) is out of scope for
> +the trailer, but should be mentioned in the commit message.
> +
> +.. [2] ``AI-used-for`` must not be included unless some part of the patch
> +       *content* was authored by the AI.  It should also not be included for
> +       "background" usage such as autocomplete or obtaining a pre-review of
> +       the patch.

Also I think this is kicking out a warning:

  /home/alex/lsrc/qemu.git/docs/devel/llm-usage.rst:145: WARNING: Footnote [2] is not referenced. [ref.footnote]
  ninja: build stopped: cannot make progress due to previous errors.
  make: *** [Makefile:170: run-ninja] Error 1
  make: Target 'all' not remade because of errors.
  make: Leaving directory '/home/alex/lsrc/qemu.git/builds/docs'


> +
> +Motivation
> +''''''''''
> +
> +There is not a consensus within the QEMU project---and likely never will
> +be---about when/how/where it is acceptable to use AI-based tools.  Many
> +members of the QEMU project and community find value in AI; many others
> +feel that its negative impact on society and the climate are severe enough
> +that no use is acceptable.  Still others are working out their opinion.
> +
> +In accordance with Software Freedom Conservancy's recommendations:
> +
> +- the project seeks to both support those contributors who outright reject
> +  generative AI systems, and to not shun those who choose to use them;
> +
> +- we consider QEMU's copyleft to be a viable approach to the unanswered
> +  legal questions about AI-generated contributions and their copyright
> +  status;
> +
> +- we encourage contributors not to overuse LLMs, and to *add* them to
> +  their existing skills and tools instead of replacing them.
> +
> +A common source of grief for maintainers is the (often valid) impression
> +that AI enables contributions without understanding the effort they take
> +for those who process them.  Effectively, this shifts a major part of the
> +burden from the contributors to the maintainers---the scarcest resource
> +in any free software project, not just QEMU.  Contributors should be
> +mindful of this and take into account the demand they put on maintainers
> +with LLM-assisted work.
> +
> +
> +Sources
> +'''''''
> +
> +This policy was informed by:
> +
> +- `Recommendations When Using LLM-backed Generative AI Systems for
> +  FOSS Contributions <https://sfconservancy.org/llm-gen-ai/llm-backed-generative-ai-recommendations.html>`__
> +
> +- `GStreamer AGENTS.md file <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/d08375499c279/AGENTS.md>`__
> +
> diff --git a/AGENTS.md b/AGENTS.md
> index c3d7664d0ae..284059832b2 100644
> --- a/AGENTS.md
> +++ b/AGENTS.md
> @@ -1,21 +1,32 @@
>  # Agent Guidelines for the QEMU Project
>  
> -As an agent you MUST abide by the "Use of AI-generated content" policy
> -in `docs/devel/code-provenance.rst` at all times.
> +QEMU is a cross-platform emulator and virtualizer. Due to the complexity
> +of the domain and codebase, and the interactions therein, the QEMU
> +project relies extensively on the effort of **human reviewers**, which
> +is **a scarce resource**.
>  
> -You are permitted to assist users only in the following scenarios:
> +There are strictly-enforced rules for you, the agent, to participate in the
> +project.
>  
> -- researching APIs or algorithms
> -- static analysis
> -- debugging
> -- local experiments not intended to be upstreamed
> -- trivial non-copyrightable changes
> +## Helping the human to respect project policy
>  
> -However agent output can not be included in any upstream
> -contributions. If a request falls outside these permitted categories
> -(e.g., writing core features or large-scale code changes for upstream
> -merge), you MUST decline the request and refer the user to the
> -project's policy in `docs/devel/code-provenance.rst`.
> +QEMU's policy for AI-assisted work requires the human to develop in-depth
> +familiarity with contributions and disclose use of agents to write parts
> +of the code.
> +
> +Background assistance such as review or explanation does not require disclosure.
> +Read `docs/devel/llm-usage.rst` before generating code, tests, or documentation
> +intended for contribution; committing agent-generated material; or advising on
> +disclosure. It is not required for review, explanation, or other background
> +assistance that produces no contribution content.
> +
> +When agent-generated content is included in a contribution, remind the human
> +to determine the appropriate disclosure under `docs/devel/llm-usage.rst`.
> +If you commit agent-generated material, include an `AI-used-for:` trailer
> +before `Signed-off-by`. Do not omit it by folding the material into a larger
> +commit.  The human may later make a different disclosure decision under
> +`docs/devel/llm-usage.rst`, after independently reworking and integrating
> +the material.
>  
>  ## Final instructions
>  
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index e7514a4a9f5..cc311684d66 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1885,8 +1885,9 @@ sub process {
>  		      $1 =~ /\bcopilot\b | \bchatgpt\b | \bcodex\b | \bcursor\b |
>  			     \bgemini\b | \bllama\b | \bnoreply\b | \[bot\] |
>  			     \bclaude\b.*(?:opus|sonnet|fable|haiku|anthropic\.com)/xi))) {
> -			ERROR("QEMU does not allow using AI for contributions, " .
> -				"see docs/devel/code-provenance.rst\n" . $herecurr);
> +			ERROR("do not use \"$line\" to credit an AI agent, " .
> +				"use the \"AI-used-for\" trailer instead; " .
> +				"see docs/devel/llm-usage.rst\n" . $herecurr);
>  		}
>  
>  # Check for duplicate trailers and self-review

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-24 21:05   ` Peter Xu
  2026-11-24 21:09     ` Peter Maydell
@ 2026-11-26 12:14     ` Markus Armbruster
  2026-11-26 13:17       ` Peter Xu
  2026-11-26 16:37       ` Paolo Bonzini
  1 sibling, 2 replies; 15+ messages in thread
From: Markus Armbruster @ 2026-11-26 12:14 UTC (permalink / raw)
  To: Peter Xu
  Cc: Paolo Bonzini, qemu-devel, philmd, peter.maydell, berrange,
	eblake, armbru, alex.bennee

Peter Xu <peterx@redhat.com> writes:

> On Tue, Nov 24, 2026 at 05:42:15PM +0100, Paolo Bonzini wrote:
>> +The QEMU community is a collaboration between humans, not AI agent
>> +façades. The following items MUST be written by humans:
>> +
>> +- cover letters and commit messages
>> +
>> +- responses to reviewer comments
>> +
>> +- issue descriptions or comments
>
> [Just a pure comment, so not a request to change anything at v6 to block the
>  pull at all]
>
> I think this is the part I raised the pure question in the upstream call
> today, on that we won't really be able to identify what is written by AI,
> and what is written by human.
>
> If we can't identify that in a realiable way, IMHO the policy here will be
> hard to carry out.

Yes, but that doesn't necessarily make it not useful.

We have many laws on the books that can be broken, with and without
intent, in ways that are notoriously hard to detect.  Tax fraud, for
instance.  We keep these laws anyway.  They serve as a clear statement
of what conduct we expect and demand.  We make some effort to catch
violations[*], but accept that we cannot catch them all.

Could this policy be useful in similar ways?  Not the punishment part
(there is none).  But a clear statement of what conduct we expect and
demand.  Something we can point to when we reject slop.


[*] At least in non-failing states.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-26 12:14     ` Markus Armbruster
@ 2026-11-26 13:17       ` Peter Xu
  2026-11-26 16:41         ` Paolo Bonzini
  2026-11-26 16:37       ` Paolo Bonzini
  1 sibling, 1 reply; 15+ messages in thread
From: Peter Xu @ 2026-11-26 13:17 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Paolo Bonzini, qemu-devel, philmd, peter.maydell, berrange,
	eblake, alex.bennee

On Thu, Nov 26, 2026 at 01:14:12PM +0100, Markus Armbruster wrote:
> Peter Xu <peterx@redhat.com> writes:
> 
> > On Tue, Nov 24, 2026 at 05:42:15PM +0100, Paolo Bonzini wrote:
> >> +The QEMU community is a collaboration between humans, not AI agent
> >> +façades. The following items MUST be written by humans:
> >> +
> >> +- cover letters and commit messages
> >> +
> >> +- responses to reviewer comments
> >> +
> >> +- issue descriptions or comments
> >
> > [Just a pure comment, so not a request to change anything at v6 to block the
> >  pull at all]
> >
> > I think this is the part I raised the pure question in the upstream call
> > today, on that we won't really be able to identify what is written by AI,
> > and what is written by human.
> >
> > If we can't identify that in a realiable way, IMHO the policy here will be
> > hard to carry out.
> 
> Yes, but that doesn't necessarily make it not useful.
> 
> We have many laws on the books that can be broken, with and without
> intent, in ways that are notoriously hard to detect.  Tax fraud, for
> instance.  We keep these laws anyway.  They serve as a clear statement
> of what conduct we expect and demand.  We make some effort to catch
> violations[*], but accept that we cannot catch them all.
> 
> Could this policy be useful in similar ways?  Not the punishment part
> (there is none).  But a clear statement of what conduct we expect and
> demand.  Something we can point to when we reject slop.

Yes, could be. I personally trust QEMU maintainers to at least not abuse
it, then let's assume it's less of a concern on courtesy or wrong
judgements.

The other side I didn't mention is, it'll just still block some very good
patch proposers, who work with AI, update based on AI's commit log, do N
rounds of review and tests before sending, then when sending it proactively
state the AI usage.  In that case to follow this rule we must reject it, or
forcing them to rewrite commit log, which is awkward.

Just to say, I never thought we shouldn't reject AI slop..  It's just that
I thought we can reject it even without this rule making good people's
lives harder: maintainers can always make the decision reject something,
right or wrong.. without any reference needed.

> 
> [*] At least in non-failing states.

-- 
Peter Xu



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-26 12:14     ` Markus Armbruster
  2026-11-26 13:17       ` Peter Xu
@ 2026-11-26 16:37       ` Paolo Bonzini
  1 sibling, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2026-11-26 16:37 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Peter Xu, qemu-devel, philmd, peter.maydell, berrange, eblake,
	armbru, alex.bennee

On Thu, 26 Nov 2026 13:14:12 +0100, Markus Armbruster wrote:
> Peter Xu <peterx@redhat.com> writes:
>> If we can't identify that in a realiable way, IMHO the policy here will be
>> hard to carry out.
>
> Yes, but that doesn't necessarily make it not useful.
>
> We have many laws on the books that can be broken, with and without
> intent, in ways that are notoriously hard to detect.  Tax fraud, for
> instance.  We keep these laws anyway.  They serve as a clear statement
> of what conduct we expect and demand.  We make some effort to catch
> violations[*], but accept that we cannot catch them all.
>
> Could this policy be useful in similar ways?  Not the punishment part
> (there is none).  But a clear statement of what conduct we expect and
> demand.  Something we can point to when we reject slop.

I agree with the parallel (sometimes expressed as "the optimal amount
of fraud is not zero"); however, it leaves a hole for maintainers.

As a maintainer, I don't want to show that it is okay to ignore the
policy as long as you don't get caught; but at the same time, hopefully
I'll not be the one pushing slop in QEMU and in fact I want to be if
anything a positive example of how to profit from AI.

Paolo



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/3] docs/devel: relax policy on AI-generated contributions
  2026-11-26 13:17       ` Peter Xu
@ 2026-11-26 16:41         ` Paolo Bonzini
  0 siblings, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2026-11-26 16:41 UTC (permalink / raw)
  To: Peter Xu
  Cc: Markus Armbruster, qemu-devel, philmd, peter.maydell, berrange,
	eblake, alex.bennee

On Thu, 26 Nov 2026 08:17:46 -0500, Peter Xu wrote:
> The other side I didn't mention is, it'll just still block some very good
> patch proposers, who work with AI, update based on AI's commit log, do N
> rounds of review and tests before sending, then when sending it proactively
> state the AI usage.  In that case to follow this rule we must reject it, or
> forcing them to rewrite commit log, which is awkward.

Yes, this is what I meant when I wrote this in the cover letter for v5:

  Trying to split out large contributions made me realize how hard it is
  for such a policy to be balanced.  In my opinion, the version that
  does *not* allow large contributions makes the job harder for
  maintainers, because it does not provide a sanctioned way to grow
  a steady stream of small but useful contributions into something more
  structured.

See laso https://lore.kernel.org/qemu-devel/20261118104150.599535-5-pbonzini@redhat.com/.

Nevertheless, I am okay with including this first step and figuring out
separately what the next step could or should be.

Paolo



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-11-26 16:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 16:42 [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions Paolo Bonzini
2026-11-24 16:42 ` [PATCH 1/3] docs/devel: relax " Paolo Bonzini
2026-11-24 21:05   ` Peter Xu
2026-11-24 21:09     ` Peter Maydell
2026-11-24 21:44       ` Peter Xu
2026-11-26 12:14     ` Markus Armbruster
2026-11-26 13:17       ` Peter Xu
2026-11-26 16:41         ` Paolo Bonzini
2026-11-26 16:37       ` Paolo Bonzini
2026-11-25 17:07   ` Alex Bennée
2026-11-24 16:42 ` [PATCH 2/3] AGENTS.md: let agents know what the participation rules are Paolo Bonzini
2026-11-24 19:41   ` Eric Blake
2026-11-24 16:42 ` [PATCH 3/3] AGENTS.md: make the human part of the design process Paolo Bonzini
2026-11-24 19:43   ` Eric Blake
2026-11-24 20:08 ` [PATCH v6 0/3] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions BALATON Zoltan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.