Page MenuHomePhabricator

Revisit how LLM Paste Check is detecting pastes from Google LLM-generated text
Closed, ResolvedPublic

Description

Sorry to bother y'all, not sure whether this is the right place to mention this, but I think your Google checks need a bit of an update.

I just ran a test, dumping Google Search LLM-generated text (from desktop Chrome and Firefox) into https://tools.simonwillison.net/paste-rich-text, and it seems to be lacking any of the tags mentioned in this doco / as implemented in https://gerrit.wikimedia.org/g/VisualEditor/VisualEditor/+/master/src/ce/ve.ce.PasteSourceDetectorRegistry.js.

Instead, I think you should be looking for HTML elements containing the data-sfc-root and data-sfc-cp attributes, i.e. matching the XPath selector //*[@data-sfc-root or @data-sfc-cp].

How easy would this be to update? I know LLM Paste Check has already been rolled out on enwiki, and it's due to be rolled out everywhere else in six days' time. But if our Gemini checks aren't working properly, I don't think we're going to get a good read on effectiveness: I suspect Google Gemini is going to be the biggest single source of copy/pasted LLM text (at least on enwiki / outside China), given the convenience of accessing it via Google Search. (Edit: OK, as of Apr 2026, it's #2 after ChatGPT, per the plot posted above.)

(NB. Looks like Gemini proper, https://gemini.google.com, might also have updated its metadata; on running a test query here, I'm now seeing id="model-response-message-contentr_, which isn't in the current list of checks.)


Derived Requirements

  1. Ensure the Potential AI-generated content Check recognizes text generated by Google Search AI Overview and AI Mode when the content is copied and pasted into VisualEditor, including whole-paragraph and partial selections and content copied using the available copy button.
  2. Ensure Gemini-generated content from the Gemini website continues to be recognized when copied and pasted into VisualEditor using the updated metadata, while regular Google Search results without LLM-generated content do not trigger the Check.
  3. Ensure existing LLM Paste Check detection for other supported AI sources continues to work after the Google and Gemini detector updates.

Test Case 1: Verify Google Search AI Overview content triggers the LLM Paste Check

  1. Open Google Search in Chrome.
  2. Perform a search that displays an AI Overview.
  3. Select and copy a complete paragraph from the AI Overview.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅❓❌⬜ AC1: Content copied from a Google Search AI Overview triggers the Potential AI-generated content Check.

Test Case 2: Verify partial Google Search AI Overview selections trigger the LLM Paste Check

  1. Open Google Search in Chrome.
  2. Perform a search that displays an AI Overview.
  3. Select and copy only part of a paragraph from the AI Overview.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅❓❌⬜ AC2: A qualifying partial selection copied from a Google Search AI Overview triggers the Potential AI-generated content Check.

Test Case 3: Verify Google Search AI Mode content triggers the LLM Paste Check

  1. Open Google Search AI Mode in Chrome.
  2. Submit a query that produces AI-generated text.
  3. Select and copy a qualifying portion of the generated response.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅❓❌⬜ AC3: Qualifying content copied from Google Search AI Mode triggers the Potential AI-generated content Check.

Test Case 4: Verify Google Search AI-generated content copied with the copy button triggers the LLM Paste Check

  1. Open Google Search in Chrome.
  2. Perform a search that displays an AI Overview or AI-generated response with a copy button.
  3. Use the copy button to copy the generated response.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅❓❌⬜ AC4: Content copied using the Google Search AI-generated response copy button triggers the Potential AI-generated content Check.

Test Case 5: Verify updated Gemini metadata triggers the LLM Paste Check

  1. Open the Gemini website in Chrome.
  2. Generate a response containing a qualifying paragraph.
  3. Copy the complete response, a partial selection, or use the response copy button.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅❓❌⬜ AC5: Qualifying content copied from the Gemini website using its supported copy methods triggers the Potential AI-generated content Check.

Test Case 6: Verify regular Google Search results do not trigger the LLM Paste Check

  1. Open Google Search in Chrome.
  2. Perform a search that does not display AI-generated content.
  3. Select and copy a qualifying paragraph from a regular search result.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check does not appear.
  7. ✅❓❌⬜ AC6: Qualifying content copied from a regular Google Search result without LLM-generated content does not trigger the Potential AI-generated content Check.

Test Case 7: Verify existing LLM Paste Check detection remains functional for other AI sources

  1. Open ChatGPT, Claude, DeepSeek, Microsoft Copilot, and Grok in Chrome.
  2. Copy qualifying generated content from each source using a supported selection or copy method.
  3. Open the provided test page in VisualEditor.
  4. Paste the copied content from each source.
  5. Verify the expected LLM Paste Check behavior remains unchanged for each source.
  6. ✅❓❌⬜ AC7: Existing LLM Paste Check detection continues to function for supported AI sources other than Google Search and Gemini.

QA Results - PROD

Event Timeline

I did some checks in Chrome of various chatbots, testing copying whole paragraphs, partial paragraphs, and using the copy button.

SourceBeforeNew marker
Google Search (AI Overview / AI Mode)not detecteddata-sfc-root attribute (counted as gemini)
Gemini websitestill detected (data-path-to-node)also id="model-response-message-content…" on the copy button's output
Copilotno longer detected: the <hash>-content-N IDs are goneits copy handler adds a <style> block with the link colour #464feb
DeepSeekdetected only when the whole message is selected (ds-markdown-paragraph)the quote-cjk-patch font, in the inline styles Chrome copies, which also covers paragraph and partial selections
ChatGPTdetected for selections (data-start/data-end)also images.openai.com image sources, for copy-button pastes with images (it's a lot more image-happy than any of the others)
Claudedetected only when the whole message is selected (font-claude-)X

I checked copying from regular google search results, and they don't trip that new data-sfc-root detector. The deekseek quote-cjk-patch one looks pretty generic, but it requires something fairly specific to actually be set up to get copied. Same for the Copilot color -- <style> in copied-html doesn't happen naturally, a website has to deliberately override the browser to make it show up.

I looked at Grok again, and couldn't find any new developments. It remains extremely clean in output.

Change #1348999 had a related patch set uploaded (by DLynch; author: DLynch):

[VisualEditor/VisualEditor@master] Update LLM paste source detectors for new markup

https://gerrit.wikimedia.org/r/1348999

Change #1348999 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Update LLM paste source detectors for new markup

https://gerrit.wikimedia.org/r/1348999

@DLynch: how often do you think we ought to revisit the outputs of these various chatbot – as you helpfully did in T440010#12391647 – on a regular basis?

Hard to say -- I agree it's worth checking in on them, and I have a little tool for dumping the data now, but I don't really have a baseline for how often they're going to change. (There's also whole layers I didn't test this time -- I didn't e.g. install their phone apps and see what happened when I copied from there.)

@DLynch Please review AC4, thanks!

UPDATE: T440010#12403137

Test Result - PROD

Status: ✅ PASS
Environment: PROD
OS: macOS Tahoe 26.6.2
Browser: Chrome 153
Device: MBA
Emulated Device: NA
Test Artifact(s):

https://en.wikipedia.org/wiki/User:GMikesell-WMF/sandbox

Test Steps

Test Case 1: Verify Google Search AI Overview content triggers the LLM Paste Check

  1. Open Google Search in Chrome.
  2. Perform a search that displays an AI Overview.
  3. Select and copy a complete paragraph from the AI Overview.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅ AC1: Content copied from a Google Search AI Overview triggers the Potential AI-generated content Check.
AI-CopyVideo-Paste
2026-10-06_09-37-38.png (1,344×832 px, 201 KB)

Test Case 2: Verify partial Google Search AI Overview selections trigger the LLM Paste Check

  1. Open Google Search in Chrome.
  2. Perform a search that displays an AI Overview.
  3. Select and copy only part of a paragraph from the AI Overview.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅AC2: A qualifying partial selection copied from a Google Search AI Overview triggers the Potential AI-generated content Check.
AI-CopyVideo-Paste
2026-10-06_09-41-26.png (1,182×670 px, 173 KB)

Test Case 3: Verify Google Search AI Mode content triggers the LLM Paste Check

  1. Open Google Search AI Mode in Chrome.
  2. Submit a query that produces AI-generated text.
  3. Select and copy a qualifying portion of the generated response.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅ AC3: Qualifying content copied from Google Search AI Mode triggers the Potential AI-generated content Check.
AI-CopyVideo-Paste
2026-10-06_09-45-05.png (1,376×1,051 px, 419 KB)

Test Case 4: Verify Google Search AI-generated content copied with the copy button triggers the LLM Paste Check

  1. Open Google Search in Chrome.
  2. Perform a search that displays an AI Overview or AI-generated response with a copy button.
  3. Use the copy button to copy the generated response.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅ AC4: Content copied using the Google Search AI-generated response copy button triggers the Potential AI-generated content Check.
  • When I clicked on the copy button and tried to paste it in the Sandbox, it just pasted nothing as seen in the video.

UPDATE: T440010#12403137

AI-CopyVideo-Paste
2026-10-06_09-52-47.png (964×727 px, 139 KB)

Test Case 5: Verify updated Gemini metadata triggers the LLM Paste Check

  1. Open the Gemini website in Chrome.
  2. Generate a response containing a qualifying paragraph.
  3. Copy the complete response, a partial selection, or use the response copy button.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check appears.
  7. ✅AC5: Qualifying content copied from the Gemini website using its supported copy methods triggers the Potential AI-generated content Check.

**Covered in https://phabricator.wikimedia.org/T420258#12402183**

Test Case 6: Verify regular Google Search results do not trigger the LLM Paste Check

  1. Open Google Search in Chrome.
  2. Perform a search that does not display AI-generated content.
  3. Select and copy a qualifying paragraph from a regular search result.
  4. Open the provided test page in VisualEditor.
  5. Paste the copied content using Cmd+V.
  6. Verify the Potential AI-generated content Check does not appear.
  7. ✅ AC6: Qualifying content copied from a regular Google Search result without LLM-generated content does not trigger the Potential AI-generated content Check.
AI-CopyVideo-Paste
2026-10-06_09-58-54.png (1,223×759 px, 101 KB)

Test Case 7: Verify existing LLM Paste Check detection remains functional for other AI sources

  1. Open ChatGPT, Claude, DeepSeek, Microsoft Copilot, and Grok in Chrome.
  2. Copy qualifying generated content from each source using a supported selection or copy method.
  3. Open the provided test page in VisualEditor.
  4. Paste the copied content from each source.
  5. Verify the expected LLM Paste Check behavior remains unchanged for each source.
  6. ✅AC7: Existing LLM Paste Check detection continues to function for supported AI sources other than Google Search and Gemini.

**covered in https://phabricator.wikimedia.org/T420258#12402183**

Pasting nothing is also fine, really. It presumably included something in the response which made it all get sanitized away.

Ah, got it. That makes sense. I’ll consider the empty paste acceptable here since like you said, it is getting sanitized away. Thanks for the clarification! I'll mark this as Resolved. Thanks for all your work!

GMikesell-WMF edited projects, added: Verified; removed: Editing QA.
GMikesell-WMF updated the task description. (Show Details)

Change #1354492 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (53d34384f)

https://gerrit.wikimedia.org/r/1354492

Change #1354492 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (53d34384f)

https://gerrit.wikimedia.org/r/1354492