* [PATCH] checkpatch: reject trailers that credit an AI agent
@ 2026-09-03 10:04 Paolo Bonzini
2026-09-03 10:14 ` Daniel P. Berrangé
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Paolo Bonzini @ 2026-09-03 10:04 UTC (permalink / raw)
To: qemu-devel; +Cc: Daniel P. Berrangé
The QEMU community has broad consent to not accept assisted-by and similar
trailers, and much less fake co-authored-bys, independent of any AI policy.
Implement this in checkpatch.pl already, so that there is another way for
contributors to discover the AI policy.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/checkpatch.pl | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 03f35e75012..90cb40dfe1f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1811,6 +1811,18 @@ sub process {
}
}
+# Reject trailers that credit an AI agent.
+ if ($realfile =~ /^$/ &&
+ ($line =~ /🤖/ ||
+ $line =~ /^\s*(?:Assisted|Generated)-by:/i ||
+ ($line =~ /^\s*Co-authored-by:\s*(.*?)\s*$/i &&
+ $1 =~ /\bcopilot\b | \bchatgpt\b | \bcodex\b | \bcursor\b | \[bot\] |
+ \bllama\b | \bgemini\b.*(?:pro|flash|ultra|google\.com) |
+ \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);
+ }
+
# Check SPDX-License-Identifier references a permitted license
if (($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) &&
$rawline !~ /^-/) {
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] checkpatch: reject trailers that credit an AI agent
2026-09-03 10:04 [PATCH] checkpatch: reject trailers that credit an AI agent Paolo Bonzini
@ 2026-09-03 10:14 ` Daniel P. Berrangé
2026-09-03 10:19 ` Paolo Bonzini
2026-09-03 11:57 ` Marc-André Lureau
2026-09-03 12:15 ` Philippe Mathieu-Daudé
2 siblings, 1 reply; 9+ messages in thread
From: Daniel P. Berrangé @ 2026-09-03 10:14 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Thu, Sep 03, 2026 at 12:04:40PM +0200, Paolo Bonzini wrote:
> The QEMU community has broad consent to not accept assisted-by and similar
> trailers, and much less fake co-authored-bys, independent of any AI policy.
> Implement this in checkpatch.pl already, so that there is another way for
> contributors to discover the AI policy.
>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> scripts/checkpatch.pl | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 03f35e75012..90cb40dfe1f 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1811,6 +1811,18 @@ sub process {
> }
> }
>
> +# Reject trailers that credit an AI agent.
> + if ($realfile =~ /^$/ &&
> + ($line =~ /🤖/ ||
Oh wow, is that something people actually do :-)
> + $line =~ /^\s*(?:Assisted|Generated)-by:/i ||
> + ($line =~ /^\s*Co-authored-by:\s*(.*?)\s*$/i &&
> + $1 =~ /\bcopilot\b | \bchatgpt\b | \bcodex\b | \bcursor\b | \[bot\] |
> + \bllama\b | \bgemini\b.*(?:pro|flash|ultra|google\.com) |
> + \bclaude\b.*(?:opus|sonnet|fable|haiku|anthropic\.com)/xi))) {
I presume the qualifiers after gemini/claude are a mitigation against
accidentally matching a real person's name ?
> + ERROR("QEMU does not allow using AI for contributions, " .
> + "see docs/devel/code-provenance.rst\n" . $herecurr);
> + }
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] checkpatch: reject trailers that credit an AI agent
2026-09-03 10:14 ` Daniel P. Berrangé
@ 2026-09-03 10:19 ` Paolo Bonzini
2026-09-03 10:25 ` Daniel P. Berrangé
0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2026-09-03 10:19 UTC (permalink / raw)
To: Daniel P. Berrangé; +Cc: qemu-devel
On 9/3/26 12:14, Daniel P. Berrangé wrote:
>> +# Reject trailers that credit an AI agent.
>> + if ($realfile =~ /^$/ &&
>> + ($line =~ /🤖/ ||
>
> Oh wow, is that something people actually do :-)
IIRC it's more in pull requests but it was fun to add.
>> + $line =~ /^\s*(?:Assisted|Generated)-by:/i ||
>> + ($line =~ /^\s*Co-authored-by:\s*(.*?)\s*$/i &&
>> + $1 =~ /\bcopilot\b | \bchatgpt\b | \bcodex\b | \bcursor\b | \[bot\] |
>> + \bllama\b | \bgemini\b.*(?:pro|flash|ultra|google\.com) |
>> + \bclaude\b.*(?:opus|sonnet|fable|haiku|anthropic\.com)/xi))) {
>
> I presume the qualifiers after gemini/claude are a mitigation against
> accidentally matching a real person's name ?
For Claude yes, for Gemini I guess it's not really needed. BTW I have
no idea which coding harnesses use Co-authored-by specifically so this
is really just a guess.
Paolo
>> + ERROR("QEMU does not allow using AI for contributions, " .
>> + "see docs/devel/code-provenance.rst\n" . $herecurr);
>> + }
>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>
>
> With regards,
> Daniel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] checkpatch: reject trailers that credit an AI agent
2026-09-03 10:19 ` Paolo Bonzini
@ 2026-09-03 10:25 ` Daniel P. Berrangé
2026-09-03 10:29 ` Paolo Bonzini
0 siblings, 1 reply; 9+ messages in thread
From: Daniel P. Berrangé @ 2026-09-03 10:25 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Thu, Sep 03, 2026 at 12:19:11PM +0200, Paolo Bonzini wrote:
> On 9/3/26 12:14, Daniel P. Berrangé wrote:
> > > +# Reject trailers that credit an AI agent.
> > > + if ($realfile =~ /^$/ &&
> > > + ($line =~ /🤖/ ||
> >
> > Oh wow, is that something people actually do :-)
>
> IIRC it's more in pull requests but it was fun to add.
>
> > > + $line =~ /^\s*(?:Assisted|Generated)-by:/i ||
> > > + ($line =~ /^\s*Co-authored-by:\s*(.*?)\s*$/i &&
> > > + $1 =~ /\bcopilot\b | \bchatgpt\b | \bcodex\b | \bcursor\b | \[bot\] |
> > > + \bllama\b | \bgemini\b.*(?:pro|flash|ultra|google\.com) |
> > > + \bclaude\b.*(?:opus|sonnet|fable|haiku|anthropic\.com)/xi))) {
> >
> > I presume the qualifiers after gemini/claude are a mitigation against
> > accidentally matching a real person's name ?
>
> For Claude yes, for Gemini I guess it's not really needed. BTW I have no
> idea which coding harnesses use Co-authored-by specifically so this is
> really just a guess.
I expect Co-authored-by is often added by the contributor themselves
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] checkpatch: reject trailers that credit an AI agent
2026-09-03 10:25 ` Daniel P. Berrangé
@ 2026-09-03 10:29 ` Paolo Bonzini
0 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2026-09-03 10:29 UTC (permalink / raw)
To: Daniel P. Berrangé; +Cc: qemu-devel
On Thu, Sep 3, 2026 at 12:26 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> > For Claude yes, for Gemini I guess it's not really needed. BTW I have no
> > idea which coding harnesses use Co-authored-by specifically so this is
> > really just a guess.
>
> I expect Co-authored-by is often added by the contributor themselves
$ strings ~/bin/codex |grep -i Co-authored-by
- Commit messages must end with `Co-authored-by: Codex <noreply@openai.com>`.
Straight from the system prompt. *puke*
Claude Code also has "Co-Authored-By: ${d3o(at())} <noreply@anthropic.com>"
Adding "noreply" to the list is probably a good idea too.
Paolo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] checkpatch: reject trailers that credit an AI agent
2026-09-03 10:04 [PATCH] checkpatch: reject trailers that credit an AI agent Paolo Bonzini
2026-09-03 10:14 ` Daniel P. Berrangé
@ 2026-09-03 11:57 ` Marc-André Lureau
2026-09-03 12:15 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 9+ messages in thread
From: Marc-André Lureau @ 2026-09-03 11:57 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, Daniel P. Berrangé
Hi
On Thu, Sep 3, 2026 at 2:05 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The QEMU community has broad consent to not accept assisted-by and similar
> trailers, and much less fake co-authored-bys, independent of any AI policy.
> Implement this in checkpatch.pl already, so that there is another way for
> contributors to discover the AI policy.
>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> scripts/checkpatch.pl | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 03f35e75012..90cb40dfe1f 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1811,6 +1811,18 @@ sub process {
> }
> }
>
> +# Reject trailers that credit an AI agent.
> + if ($realfile =~ /^$/ &&
> + ($line =~ /🤖/ ||
> + $line =~ /^\s*(?:Assisted|Generated)-by:/i ||
> + ($line =~ /^\s*Co-authored-by:\s*(.*?)\s*$/i &&
> + $1 =~ /\bcopilot\b | \bchatgpt\b | \bcodex\b | \bcursor\b | \[bot\] |
> + \bllama\b | \bgemini\b.*(?:pro|flash|ultra|google\.com) |
> + \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);
> + }
> +
> # Check SPDX-License-Identifier references a permitted license
> if (($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) &&
> $rawline !~ /^-/) {
> --
lgtm,
on subject of trailer checks, I would also kindly ask for review:
https://patchew.org/QEMU/20260727161157.2112984-1-marcandre.lureau@redhat.com/
thanks!
--
Marc-André Lureau
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] checkpatch: reject trailers that credit an AI agent
2026-09-03 10:04 [PATCH] checkpatch: reject trailers that credit an AI agent Paolo Bonzini
2026-09-03 10:14 ` Daniel P. Berrangé
2026-09-03 11:57 ` Marc-André Lureau
@ 2026-09-03 12:15 ` Philippe Mathieu-Daudé
2026-09-03 12:35 ` Marc-André Lureau
2026-09-03 13:30 ` Peter Maydell
2 siblings, 2 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-09-03 12:15 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: Daniel P. Berrangé, Peter Maydell
On 3/9/26 12:04, Paolo Bonzini wrote:
> The QEMU community has broad consent to not accept assisted-by and similar
> trailers, and much less fake co-authored-bys, independent of any AI policy.
> Implement this in checkpatch.pl already, so that there is another way for
> contributors to discover the AI policy.
>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> scripts/checkpatch.pl | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 03f35e75012..90cb40dfe1f 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1811,6 +1811,18 @@ sub process {
> }
> }
>
> +# Reject trailers that credit an AI agent.
> + if ($realfile =~ /^$/ &&
> + ($line =~ /🤖/ ||
Few years ago Peter was concerned about using non-ASCII because
it was not displaying correctly on his terminal:
https://lore.kernel.org/qemu-devel/CAFEAcA-CJwcE9k+TqQ-vDrevzZPV_+CXAr1j9QfR_ivJTJ3e2w@mail.gmail.com/
(that was using Ubuntu 22.04 which we don't support anymore).
Should we still worry about non-ASCII in the repository? Having
a quick look at the OS versions we support it seems all of them
are ready to handle UTF-8 chars. Anyway I saw various utf-8
emoji symbols in gitlab issues, and it is likely someone will
paste one along with the report when filling commit description
for a fix, so they'll end up displayed in a terminal via git-log.
> + $line =~ /^\s*(?:Assisted|Generated)-by:/i ||
> + ($line =~ /^\s*Co-authored-by:\s*(.*?)\s*$/i &&
> + $1 =~ /\bcopilot\b | \bchatgpt\b | \bcodex\b | \bcursor\b | \[bot\] |
> + \bllama\b | \bgemini\b.*(?:pro|flash|ultra|google\.com) |
> + \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);
> + }
> +
> # Check SPDX-License-Identifier references a permitted license
> if (($rawline =~ m,SPDX-License-Identifier: (.*?)(\*/)?\s*$,) &&
> $rawline !~ /^-/) {
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] checkpatch: reject trailers that credit an AI agent
2026-09-03 12:15 ` Philippe Mathieu-Daudé
@ 2026-09-03 12:35 ` Marc-André Lureau
2026-09-03 13:30 ` Peter Maydell
1 sibling, 0 replies; 9+ messages in thread
From: Marc-André Lureau @ 2026-09-03 12:35 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Paolo Bonzini, qemu-devel, Daniel P. Berrangé, Peter Maydell
Hi
On Thu, Sep 3, 2026 at 4:17 PM Philippe Mathieu-Daudé
<philmd@oss.qualcomm.com> wrote:
>
> On 3/9/26 12:04, Paolo Bonzini wrote:
> > The QEMU community has broad consent to not accept assisted-by and similar
> > trailers, and much less fake co-authored-bys, independent of any AI policy.
> > Implement this in checkpatch.pl already, so that there is another way for
> > contributors to discover the AI policy.
> >
> > Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> > scripts/checkpatch.pl | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 03f35e75012..90cb40dfe1f 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -1811,6 +1811,18 @@ sub process {
> > }
> > }
> >
> > +# Reject trailers that credit an AI agent.
> > + if ($realfile =~ /^$/ &&
> > + ($line =~ /🤖/ ||
>
> Few years ago Peter was concerned about using non-ASCII because
> it was not displaying correctly on his terminal:
> https://lore.kernel.org/qemu-devel/CAFEAcA-CJwcE9k+TqQ-vDrevzZPV_+CXAr1j9QfR_ivJTJ3e2w@mail.gmail.com/
> (that was using Ubuntu 22.04 which we don't support anymore).
> Should we still worry about non-ASCII in the repository? Having
> a quick look at the OS versions we support it seems all of them
> are ready to handle UTF-8 chars. Anyway I saw various utf-8
> emoji symbols in gitlab issues, and it is likely someone will
> paste one along with the report when filling commit description
> for a fix, so they'll end up displayed in a terminal via git-log.
>
Some projects actually enforce the usage of emoji in commit
messages/titles (Zeeshan's projects, at least). I personally don't
care. It can help, sure, just like icons do. I would much rather have
tags to help classify commits and allow people to display them however
they like, with some tools, though. For that, conventional commits
help somewhat. Just my 2c
--
Marc-André Lureau
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] checkpatch: reject trailers that credit an AI agent
2026-09-03 12:15 ` Philippe Mathieu-Daudé
2026-09-03 12:35 ` Marc-André Lureau
@ 2026-09-03 13:30 ` Peter Maydell
1 sibling, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2026-09-03 13:30 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Paolo Bonzini, qemu-devel, Daniel P. Berrangé
On Thu, 3 Sept 2026 at 13:15, Philippe Mathieu-Daudé
<philmd@oss.qualcomm.com> wrote:
>
> On 3/9/26 12:04, Paolo Bonzini wrote:
> > The QEMU community has broad consent to not accept assisted-by and similar
> > trailers, and much less fake co-authored-bys, independent of any AI policy.
> > Implement this in checkpatch.pl already, so that there is another way for
> > contributors to discover the AI policy.
> > +# Reject trailers that credit an AI agent.
> > + if ($realfile =~ /^$/ &&
> > + ($line =~ /🤖/ ||
>
> Few years ago Peter was concerned about using non-ASCII because
> it was not displaying correctly on his terminal:
> https://lore.kernel.org/qemu-devel/CAFEAcA-CJwcE9k+TqQ-vDrevzZPV_+CXAr1j9QfR_ivJTJ3e2w@mail.gmail.com/
> (that was using Ubuntu 22.04 which we don't support anymore).
> Should we still worry about non-ASCII in the repository? Having
> a quick look at the OS versions we support it seems all of them
> are ready to handle UTF-8 chars. Anyway I saw various utf-8
> emoji symbols in gitlab issues, and it is likely someone will
> paste one along with the report when filling commit description
> for a fix, so they'll end up displayed in a terminal via git-log.
An emoji in checkpatch because we're specifically looking for it
is probably be fine. Though I guess it's implicitly assuming the
user's locale is UTF-8, which I'm not sure it will be. We seem tu
use \xNN escape sequences elsewhere in this script where we
need to look for oddball non-ASCII, and that would be safer I guess.
In the thread above I was mostly pushing back because that
was a suggestion of using an emoji in *an executable filename*,
which is going to be exposed to many more people than a string
in a script to be run by developers.
thanks
-- PMM
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-09-03 13:31 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 10:04 [PATCH] checkpatch: reject trailers that credit an AI agent Paolo Bonzini
2026-09-03 10:14 ` Daniel P. Berrangé
2026-09-03 10:19 ` Paolo Bonzini
2026-09-03 10:25 ` Daniel P. Berrangé
2026-09-03 10:29 ` Paolo Bonzini
2026-09-03 11:57 ` Marc-André Lureau
2026-09-03 12:15 ` Philippe Mathieu-Daudé
2026-09-03 12:35 ` Marc-André Lureau
2026-09-03 13:30 ` Peter Maydell
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.