On this page
Which Code Hosting Platforms Ban AI-Generated Code?
Codeberg and SourceHut restrict AI-generated code, Stack Overflow bans ChatGPT answers. What each policy says, when it takes effect, and how enforcement works.
Quick answer
- Two major code hosts restrict AI-generated code: Codeberg (July 2026) and SourceHut (effective September 10, 2026).
- Codeberg bans projects that mostly consist of AI-written code; it is not a total ban.
- SourceHut bans content written with or facilitating LLMs — code, tickets, emails — and AI-feature software.
- Stack Overflow banned ChatGPT answers in December 2022, and the QEMU project declines AI-derived contributions.
- GitHub and GitLab do not ban AI code; enforcement everywhere is social, not technical.
Which platforms ban AI-generated code?
As of late 2026, the notable bans come from two community-governed code hosts — Codeberg and SourceHut — plus adjacent communities: Stack Overflow’s ban on ChatGPT answers (December 2022) and project-level policies like QEMU’s refusal of AI-derived contributions. The major forges — GitHub and GitLab — host AI-generated code without restriction. If you’re choosing where to host AI-assisted projects, the two to know are Codeberg and SourceHut.
What exactly does Codeberg ban?
In July 2026, Codeberg e.V. members voted on two motions. The first commits the platform to never use its users’ data to train LLMs. The second, passed 358 to 144, changes the terms of use to prohibit what it calls “vibe-coded projects”: projects that mostly consist of code written by generative AI tools such as Claude or OpenAI Codex. The nuance matters — Codeberg did not ban all AI usage, and its own announcement pushed back on that reading. Light AI assistance in an otherwise human-driven project is not what the vote targeted; a project that is mostly AI-written violates the terms. The stated motivation is resource strain from AI-generated projects and the platform’s belief that LLMs endanger the free-software ecosystem.
What exactly does SourceHut ban?
SourceHut announced its policy on August 27, 2026, effective for new projects after the standard two-week notice — September 10, 2026. The new terms prohibit “original content written with or which facilitates the use of LLMs (large language models) or other generative AI technologies,” covering source code, assets, tickets, and emails produced or assisted by these tools. Software that contains generative AI features, or directly enables them, is also not welcome. There are deliberate exceptions: mirrors of codebases with more lenient policies (like the Linux kernel) are allowed, and using LLMs privately for review or security analysis is discouraged but not prohibited. Enforcement is explicitly honor-system — no automated detection, no retroactive enforcement, and lying about AI use once discovered leads to account suspension.
What about Stack Overflow, QEMU, and the rest?
Stack Overflow’s moderators banned ChatGPT-generated answers in December 2022, citing the flood of plausible-but-wrong answers, and the Stack Exchange network later extended the stance to AI-written questions. The QEMU project maintains a policy of declining contributions believed to include or derive from AI-generated content. Other projects and communities have similar stances. These aren’t code-hosting bans in the Codeberg/SourceHut sense, but they matter if you contribute to those communities: AI-assisted contributions that you can’t or won’t disclose may be rejected.
Why do these policies exist — and why aren’t they enforced technically?
The stated reasons converge: resource strain (AI-generated projects burn CI minutes, storage, and bandwidth), quality (volumes of unmaintained AI-written code), and principle (the platforms believe LLMs exploit the open-source ecosystem without giving back). Enforcement is another matter — since reliable AI code detection doesn’t exist, neither platform can verify compliance automatically. SourceHut says outright it will not try, relying on the honor system and suspending accounts only when deception is discovered. These policies are community signals: they tell you what a platform values and what happens if you’re caught, not that an automated scanner will catch you.
Where this bites vibecoders
Vibecoders who default to Codeberg or SourceHut for ideological reasons can find their projects — built with AI — violating the host’s terms within months of the policy change. The practical takeaway: read the host’s AI policy before you build on it. If you’re building an AI-assisted project, GitHub and GitLab remain unrestricted. If you’re on Codeberg or SourceHut, expect AI-written code to be unwelcome, and assume disclosure — not detection — is the enforcement mechanism.
Where AI coding assistants get this wrong
- Recommending Codeberg or SourceHut as hosting without mentioning their AI-content policies.
- Treating “open source” hosting as policy-free, when community-governed hosts are the ones most likely to restrict AI code.
- Assuming enforcement is technical, when every current policy relies on the honor system.
- Not distinguishing Codeberg’s partial ban (mostly-AI projects) from SourceHut’s broader one (AI-assisted content of any kind).
Checklist
- Check your host’s terms for AI-content policy before pushing AI-assisted work.
- On Codeberg: keep AI assistance from dominating the project, or host elsewhere.
- On SourceHut after September 10, 2026: AI-assisted code, tickets, and emails are prohibited — migrate AI-heavy projects.
- On Stack Overflow and Q&A communities: don’t post AI-generated answers where they’re banned.
- In projects like QEMU with contribution policies: disclose or don’t submit.
- Remember enforcement is honor-system: the risk is discovery, not automated detection.
FAQ
Does Codeberg ban all AI-generated code?
No. In July 2026 Codeberg’s members voted to change its terms of use to prohibit projects that “mostly consist” of code written by generative AI tools, and to commit to never training LLMs on its data. AI-assisted work that doesn’t dominate a project isn’t banned — but a project that is mostly AI-written violates the terms.
What does SourceHut’s AI policy actually ban?
Starting September 10, 2026, SourceHut’s terms prohibit “original content written with or which facilitates the use of LLMs or other generative AI technologies” — including source code, assets, tickets, and emails produced or assisted by these tools, plus software that contains or enables generative AI features. Enforcement is honor-system based, with no automated detection.
Do GitHub or GitLab ban AI-generated code?
No. GitHub and GitLab host AI-written projects without restriction (GitHub even sells AI tooling). The bans so far come from smaller, community-governed platforms — Codeberg and SourceHut — and from Q&A and project communities like Stack Overflow and QEMU, not from the major forges.
How is an AI-code ban enforced if detection doesn’t work?
Largely it isn’t, automatically. SourceHut explicitly says it will not deploy automated detection and relies on the honor system, suspending accounts only when covert AI use is discovered. Codeberg’s policy is similarly hard to verify. These policies are signals about what a community wants, enforced socially rather than technically.
Related topics
- Can AI-Generated Code Be Detected?
- What Is Vibe Coding (and Where Does It Break Down)?
- What Is a Software Supply Chain Attack?
Sources
- Codeberg — Protecting our FLOSS commons from LLMs
- SourceHut — Changes to SourceHut’s terms of service regarding LLMs
- Stack Overflow Meta — Policy: Generative AI (e.g., ChatGPT) is banned
- The Verge — Stack Overflow temporarily bans ChatGPT answers
- Forgejo discussion — On the use of AI in the context of Forgejo (QEMU policy)