[TASK] Add TYPO3 Policy on AI generated code - #47
Conversation
Co-authored-by: Martin Helmich <martin.helmich@typo3.org>
Combine the "Research Notes" and "Landscape Analysis" appendices into a single "Appendix C: Landscape Analysis and Research Notes", removing the duplicated enumeration of how other projects handle AI code. Add sources for previously uncited claims: the survival-analysis and CodeRabbit code-quality studies, the DCO, and the US Copyright Office copyrightability report. Point the introduction's cross-reference at the merged appendix. Correct the Linux kernel row to match its coding-assistants guidelines: it recommends an "Assisted-by" tag (not "Co-developed-by") and keeps Signed-off-by / DCO certification human-only. Reword the SPDX monitoring item to "machine-readable conventions for disclosing AI involvement in source code"; SPDX has no specification for identifying AI-generated code (its AI profile is an AI-BOM for models). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Incorporate the TYPO3 Association Board's statement on GPL and AI-generated code (8 July 2026): GPL compatibility depends on provenance, not the tool used, and a DCO sign-off is recommended as a lightweight, auditable alternative to a CLA. - Add core principle 3.6 on DCO sign-off, complementary to the AI-assisted disclosure tag - Expand 3.5 with the provenance-not-tool stance and cite the board statement - Add a sign-off step to the contributor checklist and CONTRIBUTING.md template - Replace the stale CLA reference in the frameworks section with the DCO the policy proposes Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This pull request is classified as a formal change. This means it needs an formally documented decision by the TYPO3 Association Board, which must be documented in a new file under ❌ A formal change must add a new decision record under |
jweiland
left a comment
There was a problem hiding this comment.
Good work! Just a minor cosmetical correction (double space in line 80)
garvinhicking
left a comment
There was a problem hiding this comment.
Thanks for this draft, I think this is well-crafted and has a good focus.
Even though I have a rather special view on this topic I would be able to get behind this draft here. That's a serious achievement. ;-)
Maybe the focus currently is a lot on "code contribution" but also applies a lot to documentation too (it is named, I'm ware). Maybe we could highlight some specific areas for documentation concerns, but that could happen in a follow-up.
|
Thanks, good to start with something like this. However, I found it too heavily framed around AI. Most of what is written applies not only to AI-generated/contributed code, but to contributions in general. In some places, it even states that a rule applies only when the code is AI-generated, which makes no sense to me. Am I the only one? One may even think that everything in this document applies only to AI generated/contributed code as it is named AICodePolicy. |
|
|
||
| Disclosure is required when AI tools have generated the structural logic or substantial portions of the contributed code. It is not required for incidental use such as IDE autocompletion, syntax suggestions, code formatting, or using AI to understand existing code. | ||
|
|
||
| The recommended disclosure mechanism is a tag in the commit message or pull request description: ``AI-assisted: [tool name]`` (e.g., ``AI-assisted: Claude claude-opus-4-20250514`` or ``AI-assisted: GitHub Copilot``). This follows the pattern established by the Linux kernel community and is intentionally lightweight. |
There was a problem hiding this comment.
How should this be handled for coding agents or tools that use multiple LLMs?
AI-assisted: OpenHands does not reveal much about which models were actually involved. Nor does it give any valuable information IMO.
There was a problem hiding this comment.
If you work on a larger change with e.g. 10 sub-agents, they can run in a lot of different models, I don't know if we should list all models.
There was a problem hiding this comment.
I actually came here for the same thing. I use Claude Code, Pi and OpenCode with different models, so neither tool nor model alone give you any indication.
Maybe we should boil it down to "Development was assisted by AI"?
There was a problem hiding this comment.
I wonder whether a tool like https://github.com/git-ai-project/git-ai can help us here. This would at least automate a lot of the documentation.
There was a problem hiding this comment.
I am not sure if https://github.com/git-ai-project/git-ai can deliver this.
There was a problem hiding this comment.
It tracks AI usage during development and adds the attribution via a git note to the commit: https://usegitai.com/docs/get-started/how-git-ai-works#2-attribution-attaches-on-commit
Might be easier for regular contributors to use something like this, instead of the attribution via the commit message as it doesn't affect their workflows so much.
I feel the same. I'm not using AI, but would say most parts are true without AI as well. We could rephrase some parts, mostly by removing mentioning of AI, and would establish a more general applied rule which might survive other future changes as well. I could try to come up with a PR to rephrase those parts if you like, and already asked for. Just let me know. In general, I highly appreciate the following things (to also provide positive feedback):
I love this transparency and actively asking for feedback. Thank you very much. |
|
Disclosure: I used AI assistance solely to improve the English phrasing and structure of this commentary. The arguments, opinions, and underlying line of reasoning are entirely my own. Without AI, the English would simply be less polished; the text would likely be longer, harder to read, and potentially prone to misunderstandings. AI-assisted development introduces real risks. AI can invent APIs, produce plausible but incorrect logic, generate superficial tests, and introduce architectural or security flaws. Poorly supervised coding agents may create such defects faster and at a larger scale than individual developers. However, this does not justify different quality rules based on an AI-assisted label. We do not reliably know the competence, diligence, or sources of conventional contributors either. Human-written code may be based on outdated documentation, copied snippets, misunderstood advice, or simple overconfidence. We do not classify contributors by their presumed professionalism and then apply different standards; we assess the submitted work and its risk. An AI-assisted label may also reinforce pre-existing attitudes in either direction. Reviewers may scrutinise labelled contributions more harshly, or trust them more because they associate AI with productivity or technical sophistication. In both cases, the label risks shifting attention from evidence to expectations. The appropriate response is therefore universal, risk-based quality gates: meaningful tests, API verification, deeper review for security-sensitive or architectural changes, clear contributor responsibility, and provenance certification for all contributions. We have seen a similar pattern with object-oriented programming, automated testing, static analysis, and CI/CD. Their adoption did not create poor architecture, weak tests, or inadequate review; it exposed existing weaknesses and forced engineering practices to mature. AI likewise introduces new error patterns and changes their frequency and scale, but the fundamental remedy remains the same: stronger contribution and review standards for everyone. |
|
|
||
| Contributors are expected to disclose when a contribution has been substantially generated or co-developed using AI tools. This disclosure serves the community in several important ways: it provides valuable context for code reviewers, it builds a shared understanding of how AI tools perform in the TYPO3 ecosystem, and it creates an audit trail should legal questions arise in the future. | ||
|
|
||
| Disclosure is required when AI tools have generated the structural logic or substantial portions of the contributed code. It is not required for incidental use such as IDE autocompletion, syntax suggestions, code formatting, or using AI to understand existing code. |
There was a problem hiding this comment.
How can we measure or ask for exposure of this "requirement" as maintainers?
|
|
||
| Contributors are expected to disclose when a contribution has been substantially generated or co-developed using AI tools. This disclosure serves the community in several important ways: it provides valuable context for code reviewers, it builds a shared understanding of how AI tools perform in the TYPO3 ecosystem, and it creates an audit trail should legal questions arise in the future. | ||
|
|
||
| Disclosure is required when AI tools have generated the structural logic or substantial portions of the contributed code. It is not required for incidental use such as IDE autocompletion, syntax suggestions, code formatting, or using AI to understand existing code. |
There was a problem hiding this comment.
AI can be involved in drafting a sketch or plan, but not in coding. We should clarify this.
There was a problem hiding this comment.
I'd be fine with not declaring it if the code was fully written by a human, but following concepts created by an AI. I would trust someone who still codes themselves to understand the concept at least to a degree that ensures they know what this is about.
|
|
||
| Disclosure is required when AI tools have generated the structural logic or substantial portions of the contributed code. It is not required for incidental use such as IDE autocompletion, syntax suggestions, code formatting, or using AI to understand existing code. | ||
|
|
||
| The recommended disclosure mechanism is a tag in the commit message or pull request description: ``AI-assisted: [tool name]`` (e.g., ``AI-assisted: Claude claude-opus-4-20250514`` or ``AI-assisted: GitHub Copilot``). This follows the pattern established by the Linux kernel community and is intentionally lightweight. |
There was a problem hiding this comment.
If you work on a larger change with e.g. 10 sub-agents, they can run in a lot of different models, I don't know if we should list all models.
| 1. Purpose and Scope | ||
| ==================== | ||
|
|
||
| The rapid adoption of AI-assisted development tools across the software industry requires the TYPO3 ecosystem to establish clear, pragmatic guidelines for contributions to TYPO3 open source extensions. This policy aims to balance innovation and developer productivity with quality assurance, legal clarity, and community trust. |
There was a problem hiding this comment.
you mention "extensions" and a lot of times below as well, however, it should be "code in the TYPO3 ecosystem"
There was a problem hiding this comment.
True; IIRC, the original intent of this was to explicitly scope this to extensions, but that premise softened a bit during later rounds of editing. Putting this on the todo list.
Co-authored-by: Jochen Weiland <jweiland@jweiland.net>
Co-authored-by: Garvin Hicking <blog@garv.in>
@CybotTM @DanielSiepmann True, because the question "What's your take on AI-generated code?" was the initial trigger for this, so the whole thing is kind-of hyperfocused on that. 😅 Upon re-reading the whole thing, I do agree that some parts of it (for example, everything regarding to code provenance and such) are applicable to any kind of contribution, regardless if AI-assisted or not. Maybe it might make sense to split this into a general "Contribution Policy", and then a specific one (building on that) for AI-assisted contributions? 🤔 |
|
|
||
| Contributors are expected to disclose when a contribution has been substantially generated or co-developed using AI tools. This disclosure serves the community in several important ways: it provides valuable context for code reviewers, it builds a shared understanding of how AI tools perform in the TYPO3 ecosystem, and it creates an audit trail should legal questions arise in the future. | ||
|
|
||
| Disclosure is required when AI tools have generated the structural logic or substantial portions of the contributed code. It is not required for incidental use such as IDE autocompletion, syntax suggestions, code formatting, or using AI to understand existing code. |
There was a problem hiding this comment.
I'd be fine with not declaring it if the code was fully written by a human, but following concepts created by an AI. I would trust someone who still codes themselves to understand the concept at least to a degree that ensures they know what this is about.
|
|
||
| Disclosure is required when AI tools have generated the structural logic or substantial portions of the contributed code. It is not required for incidental use such as IDE autocompletion, syntax suggestions, code formatting, or using AI to understand existing code. | ||
|
|
||
| The recommended disclosure mechanism is a tag in the commit message or pull request description: ``AI-assisted: [tool name]`` (e.g., ``AI-assisted: Claude claude-opus-4-20250514`` or ``AI-assisted: GitHub Copilot``). This follows the pattern established by the Linux kernel community and is intentionally lightweight. |
There was a problem hiding this comment.
I actually came here for the same thing. I use Claude Code, Pi and OpenCode with different models, so neither tool nor model alone give you any indication.
Maybe we should boil it down to "Development was assisted by AI"?
|
|
||
| - An IDE’s built-in AI features provided autocompletion or syntax suggestions. | ||
| - An AI tool was used to understand or explain existing code. | ||
| - An AI tool assisted with formatting, linting fixes, or mechanical refactoring. |
There was a problem hiding this comment.
I'm a bit skeptical about "mechanical refactoring" here, since that is also prone to errors and would need more careful review IMO.
| 6.3 Format | ||
| ---------- | ||
|
|
||
| In commit messages, add a trailer line: `AI-assisted: [tool identifier]` |
There was a problem hiding this comment.
The Git docs themselves actually call these "trailers" or "trailer lines".1
Footnotes
Fully understandable and no complain from my side, only a suggestion :)
I like the addition to split this up. That would allow people not using AI to skip the AI specific part. |
Co-authored-by: Andreas Wolf <dev@a-w.io>
|
Nice work. 👍 Yes to splitting: I agree this would make sense as a general Contribution Policy with an addendum concerning AI-assisted contributions. Generalize more: It would also be great if the general contribution policy and the AI-specific could be made less specifically code-related. Contributions of articles on news.typo3.com face the same copyright infringement risks as code, but the contribution workflow isn't commit-based. AI is equally both a blessing and a curse for reviewers, depending on context. What about verbosity? Unless I've overlooked it, the policy draft does not address a common problem with some AI-based contribution: unnecessary verbosity, for example in commit messages. Contributions should not just be quick to make, but also easy to review. (The reviewer shouldn't spend more time reviewing than the real individual behind the contribution spent creating the patch.) That's a qualitative consideration that ensures there's a human in the loop on the contributor side. |
|
IMO there is no need for a "TYPO3 Policy on AI-Generated Code" (in this form and with this framing). A general AI policy would make more sense, derived from this policy:
A general Contribution Policy, AI review guidelines, and maybe even AI harness guidelines should be separate documents. IMO much more helpful would be working on the projects' harnesses (for AI and humans). Making the rules visible where they matter and enforcing them where they count. Strong and mechanical enforced guidelines also help new contributors (with or without AI). Btw. Linux does apply their rules to all code generation tools, which would also apply to rector, fractor, aso in our ecosystem. |
What this is
This PR introduces a draft on a TYPO3 Association Policy on AI generated code, which is open for community review.
What the draft proposes
AI-assisted: [tool name]tag when AI generated structural code (following the Linux kernel pattern), with clear guidance on when disclosure is and isn't expected.Signed-off-by:Developer Certificate of Origin sign-off as a lightweight, auditable alternative to a CLA (which TYPO3 does not require).CONTRIBUTING.mdand commit-message templates.This is a draft — please help shape it
Nothing here is final. The document is explicitly a living document, and this PR is opened to invite community review and discussion before anything is proposed for adoption.
How to contribute to this draft
Two easy ways to get involved:
task/ai-policybranch (notmain). Direct edits to the wording are encouraged; it's often easier to react to a concrete suggestion than to prose in a comment thread.Every section is open for revision. If you disagree with a principle, want to sharpen a definition, or think a whole section should change, please say so — that's exactly what this review phase is for.
Identified to-dos