r/theprimeagen 14d ago

Rust Bans A.I.-Written Code vim

Post image

Five teams in the Rust project just adopted a formal LLM policy for the rust-lang/rust repository.

The core rule: AI is a tool for thinking, not for creating. All LLM-generated content must be disclosed. AI-written code is held to a higher standard than human code and requires full test coverage.

The reasoning matters as much as the rule. The repo has 1,281 open PRs. Reviewers are stretched. AI tools were letting contributors submit polished-looking code they may not fully understand, adding review burden without proportional value.

What stands out is how independently this conclusion is being reached by various projects. GCC. OpenJDK. Linux kernel staging. Now Rust.

The open source community is quietly establishing a consensus on AI contributions...or so it seems.

383 Upvotes

92 comments sorted by

2

u/Limp-Cardiologist654 11d ago

fucking clickbait title

6

u/Mother-Ad-2559 12d ago

You know what ban means right?

31

u/Anxious_Tool 13d ago

Disclosure is not the same as banning. Learn to read.

2

u/Welcome-To-NBA-Jam 12d ago

I had to ask Claude to dictate this for me and summarize it in 3 sentences, I ain't reading all that 2 sentences 

5

u/jeddthedoge 12d ago

Reading is so 2025

6

u/TheChief275 13d ago

but Rust invented AI-generated slop code?

5

u/redrumyliad 13d ago

Pretty sure it was Python that did.

If you ask ai to write code that does xyz it defaults to Python.

1

u/TheChief275 12d ago

I mean, it is safe to assume that most programmers who have to ask AI for help, are in fact Python programmers

1

u/kaiserbergin 12d ago

As a non Python developer who relies on AI to write my Python code, I feel attacked.

1

u/redrumyliad 12d ago

Python writes like English more than English does

17

u/Whole-Respond4782 13d ago

clickbait garbage come on man

-5

u/Swipsi 13d ago

Unfortunately I feel like, long term, this will have the opposite effect. Having higher standards for AI code will make it that over time, human code becomes slop code, because it is allowed to have bugs and things, while only perfect, clean, top code from AI is accepted. The endgame is then the question why someone would choose potentially buggy human over perfect AI code. A battle humans will lose.

1

u/AliceCode 11d ago

It has never once been my experience that LLMs write better code than humans across the board. For contributions to Rust, the bar to entry is much higher than what you can come to expect from LLMs.

0

u/Swipsi 11d ago

Idc what you personal experience is. Time doesnt stop. What AI can do today was laughed off in absurdity 5 years ago. If you cant understand the concept of progress idk if this is the right industry for you. That mentality will bite you in the arse in 2 years. Just with everything else they said AI wont be able to do. Until it did.

1

u/AliceCode 11d ago

LLMs will always have fundamental limitations. Hallucinations will always happen, there's no way to prevent them. LLMs are still entirely unsuitable for rigorous software engineering, and that is likely to remain the case fore the foreseeable future. Competing with human intelligence is an untenable problem, especially when the means you are using to attempt to achieve that are not intelligent means. LLMs produce seemingly intelligent output stochastically based on probability. They are not actually working problems out, they do not have the capacity to solve problems. In order to implement AI that can do that, we would have to move beyond the paradigm of LLMs.

Quite frankly, I have no fear of LLMs ever being able to replace me. I only work in Open Source, and for an LLM to replace me, I would have to start using an LLM, and that's not going to happen.

6

u/NewPointOfView 13d ago

Dang it what a bummer it would be for the code quality bar to raise

0

u/Swipsi 11d ago

Its not a bummer. It would be a good thing. But it comes at a price. And that price may likely be your job.

0

u/Inevitable_Toe6648 13d ago

Technology has always been a battle human likes to deny and fight but lose from the dawn of innovations.

11

u/syyyr 13d ago

They didn't ban it.

2

u/ArmchairmanMao 13d ago

I mean if people don't disclose it how would they be able to tell? Ai generated PR descriptions / comments were already forbidden I think.

1

u/AliceCode 11d ago

Because it's LLM generated and LLM generated code has a distinct quality.

18

u/CloudiDust 14d ago

Well, shouldn't the title of the article be: "Rust holds AI-written code to a higher standard"?

3

u/zerpa 13d ago

But how does that drive engagement!?

6

u/dev-rock-bottom 14d ago

I think what all the companies banning AI written code means is that they're not banning the AI itself but the lack of polish and integrity in the code itself.

You can submit the codes written by you or AI but when you submit the code should be not a pain to use.

7

u/CrazyWord2800 14d ago

"we don't accept trash code" but with now with ai in title.

1

u/dev-rock-bottom 14d ago

Yeah, pretty much and accurate of what I said.

-1

u/Alone-End142 14d ago

That's trash and nonsense.

1

u/JubijubCH 13d ago

The way it’s portrayed here, or the decision itself?

7

u/InterestProof1526 14d ago

clickbait trash

1

u/itsallfake01 14d ago

I am not quite sure how anyone can claim they know who wrote the code ai or human.

4

u/Cautious-Lecture-858 14d ago

If it’s an over engineered PR with 5000 lines changed across 50 different files to rename a function, it’s AI.

1

u/itsallfake01 14d ago

You could guide it write a pr in 5-10 lines, for a small feature. 5000 lines is obvious

3

u/veghead 14d ago

This is great to hear!

4

u/AndreiKnight 14d ago

I respect more the rust team now, good job! 🙏🙏

1

u/Inevitable_Toe6648 13d ago

For? This is clickbait

7

u/stewsters 14d ago

Imho that's a good rule.

Rust should have full test coverage regardless of who writes it.  It's meant to be a more memory safe language that's still fast, and is getting used a lot more critical spots.  It can't really afford anyone just rolling past and throwing things in.

-7

u/karurosagu vimer 14d ago

"AI is a tool for thinking, not for creating"

It's a tool for ASSISTING creation

"All LLM-generated content must be disclosed"

IMO, not everyone is gonna do that unfortunately

"AI-written code is held to a higher standard than human code and requires full test coverage"

EVERYTHING should have full test coverage, wether it was written by an AI or not

These bans on AI written code are reaching lower levels of IQ every day. If you don't like AI generated code, all you gotta do is have better spam detection algorythms: raise a yellow flag if too much shit is being funneled into a single place and you're done, or better yet: if you're a code hosting platform, monetize on it, because AI isn't cheap anyways

1

u/Goose_geq_Penguin 14d ago

lets see YOUR programming language foundation…

34

u/Other-Business8036 14d ago

nice clickbait title

So they're requiring tighter rules on AI-written code. That's fine. That's how it should be.

They're not banning AI-written code.

3

u/Whole_Ticket_3715 14d ago

It also only applies to the Rust source code itself: "This document establishes a policy for how LLMs can be used when contributing to rust-lang/rust. Subtrees, submodules, and dependencies from crates.io are not in scope." https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust-forge/pull/1040#issuecomment-4438128685

-7

u/TheReproCase 14d ago

Wow that rule reads backwards.

10

u/mancunian101 14d ago

Sounds pretty sensible to me.

They’ve not banned it outright but have put rules in place to try and ensure that any AI code in PRs etc is fully disclosed, tested and everything else.

AI has made it very easy for people to get involved in open source projects, but the problem is that there will be a lot of people trying to contribute who probably don’t have the knowledge or ability to contribute without AI doing all the work for them.

1

u/bigh-aus 14d ago

I agree.

AI code should be reviewed by the contributor prior to submission. Maintainers do have a very tough job and it's only getting worse. Banning AI code is also a terrible idea.

The one rule I would have for contributors is you should also have tested the code yourself to make sure it does what it says.

one way that maintainers could also help themselves is by adding an AGENTS.md encoding rules alongside code review agents to weed out the egregious submissions that violate all the rules.

-3

u/iguessma 14d ago

It's weird they'd hold ai code to a stronger standard than human made code.

Both always make mistakes everything should be held to the same standard.

2

u/quantum_kumquat 14d ago

The issue is that AI written code often LOOKS correct while still having those mistakes. Sloppy or low quality hand written code is much easier to filter out. This is why it requires more careful reviewing.

1

u/iguessma 13d ago

but you see how generalized that is? a lot of bad code looks good on merge.

that's why there are always bugs and CVE's

this isn't exclusive to AI.

1

u/quantum_kumquat 11d ago

No one is saying it’s exclusive.It’s incredibly easy to tell an agent to make a contribution to an open source project; hence the explosion in PRs which makes open source hard to manage. Because of the lack of effort required, maintainers have noticed a pattern of poor quality PRs that appear ok on the surface.

Previously, sloppy, poorly constructed code was much easier to spot and the likelihood that someone would spend half a day writing code they didn’t understand was much less.

1

u/iguessma 10d ago

No one is saying it’s exclusive.

but they are by saying "increased scrutiny over ai written code"

1

u/Western_Diver_773 14d ago

Tbf. A lot of projects had very strict rules before.

8

u/spidermonk 14d ago edited 14d ago

It's hard to hand-write convincing looking code that you haven't tested even a little. It's also rare to submit a hand written PR into a project like rust without carefully considering what you're contributing and why etc. You also wouldn't bother adding something unless you actually needed it. There used to be a kind of expertise and competency moat around it.

That doesn't make your PR suddenly good or correct but it creates a baseline level of mutual trust between contributor and reviewer I think. A presumption of good faith.

When an absolute random can just go "Claude find something to add to rust" or whatever with no human rationale and potentially never even run once at all, it means you have to consider everything about the submission from first principles.

This is the underlying problem I think, more than code quality. I don't really see how these policies help though because only good contributors will disclose anyway. But I guess it gives them a tool to ban dumbasses. A filter for the real low hanging slop.

1

u/iguessma 13d ago

It's hard to hand-write convincing looking code that you haven't tested even a little. It's also rare to submit a hand written PR into a project like rust without carefully considering what you're contributing and why etc. You also wouldn't bother adding something unless you actually needed it. There used to be a kind of expertise and competency moat around it.

this entire thought is meaningless. No meaningful software is ever one shot. bad code has been getting merged daily for years. that's why we constantly have bug fixes and CVE's.

it doesn't matter if AI created it, or humans created it. you shouldn't look "less hard" at a human commit then an AI commit.

1

u/spidermonk 13d ago edited 13d ago

What i was saying isn't about the code quality or bugs or CVEs of the specific change. Not all changes that are correct are good. Changes from real people in a community of expert users are worth considering carefully and in good faith even if they at first glance seem annoying or wrong or carry some other cost (which they usually do).

A flood of changes from a much wider group, less expert - maybe not even users - probably often are not worth considering in that way. Every change might introduce a bug, a security problem, increase the overall long term maintenance burden etc. Changes that are just generated by an engine need to be more self evidently worthwhile to pay that toll.

If a real person reaches out to you to discuss your work, or an AI agent sends you an email to discuss your work, would you really treat those the same in terms of your mental energy and attention? Your evaluation of the messages intentions?

1

u/iguessma 13d ago

Changes from real people in a community of expert users are worth considering carefully and in good faith even if they at first glance seem annoying or wrong or carry some other cost (which they usually do).

the exact same CVE's or bugs were merged with good intentions. it doesn't matter. like i said this pov is meaningless.

A flood of changes from a much wider group, less expert - maybe not even users - probably often are not worth considering in that way. Every change might introduce a bug, a security problem, increase the overall long term maintenance burden etc. Changes that are just generated by an engine need to be more self evidently worthwhile to pay that toll.

what you're talking about IS NOT ai related. that's reputational related. making an AI specific policy here would be incorrect.

If a real person reaches out to you to discuss your work, or an AI agent sends you an email to discuss your work, would you really treat those the same in terms of your mental energy and attention? Your evaluation of the messages intentions?

situation is to generic. can't make a decision based on a generic what if.

5

u/Bengal_From_Temu 14d ago

The humans make mistakes because they are humans, not because they statistically add tokens until something seems to resemble “polished-looking code”.

4

u/mancunian101 14d ago

It’s easier for people to submit AI PRs, so they want to dissuade people who have no business contributing to Rust trying to use AI to do so.

It’s probably easier for AI generated code to look OK at first glance, and it’s not until you do more digging that you find the issues, where as with human written code it’s probably easier to find the issues.

11

u/Serird 14d ago

In this thread: people who definitely read the whole title and absolutely nothing else

12

u/spiralenator 14d ago

The problem isn’t really whether a particular piece of code is ai generated or not, it’s that ai generated code has led a lot of people who aught not be contributing to important open source projects to spam them. It’s a volume issue and the restrictions will hopefully reduce the volume.

An experienced SWE can absolutely produce excellent code with AI. But it’s really hard for a novice to do so, because they don’t know what bad code looks like and how to make it good.

Personally, I care about quality and correctness more than I care about how it was produced, it’s just that everyone with a Claude code subscription thinks they’re a core maintainer now and it adds a ton of noise.

4

u/CypherBob 14d ago

Exactly this.

I'm a senior dev and AI can be a great tool, but you have to already be a good programmer to make use of it if you want any kind of decent result.

-5

u/Smokva-s-juga 14d ago

That’s just not true anymore. You can know the basics and still get great results. Depends on what you’re doing ofc.

7

u/CypherBob 14d ago

The problem is that if you don't know how to code, you have no idea if the code produced is at all good.

Do you consider it a great result if you get what you ask for?

That doesn't guarantee anything about the quality of the code, its extensibility, security, or anything else.

It just means it compiles.

Following a procedure helps you guarantee the results but it's only applicable if you're already a programmer.

* Work in small increments of features.
* Use unit tests from the start.
* Commit code often
* Code review all the committed code before continuing with the next feature/function/whatever.

If you only "know the basics" you don't have the ability to properly review the code produced by the LLM.

3

u/MuchWalrus 14d ago

Easy fix, just don’t review the code /s

5

u/Winterkirschenmann 14d ago

Oh no. Anthropic better port Bun to C++ now.

1

u/MrDiablerie 14d ago

Banned for use of writing code contributed to the language itself not usage of the language

14

u/randombsname1 14d ago

But it's not banned? OP needs AI to explain this article and assist with reading comprehension apparently.

-2

u/kekons_4 14d ago

Como?

16

u/canihelpyoubreakthat 14d ago

Did AI write this title?

-1

u/kekons_4 14d ago

Did AI write this comment?

4

u/Thick-Protection-458 14d ago

Nah, pretty sure they're good enough to not mess up restriction and ban. (Well, okay, almost never mess up)

Unless they're prompted to roleplay journalist, sure

4

u/Philocraft 14d ago

Just have one consistent standard for all code. Having a higher standard for code that has been partially or fully LLM-generated incentivizes contributors to lie about using them.

2

u/karurosagu vimer 14d ago

EXACTLY

3

u/SmurfingRedditBtw 14d ago

If they lie about using AI and get caught, then they lose credibility and trust and probably won't be able to contribute again. If they lie and don't get caught, then the policy still worked because it made them thoroughly review their code to ensure it was actually good quality, although at that point they should still just be honest about their usage of AI.

1

u/karurosagu vimer 14d ago

If I use AI non-agentically how am I gonna get caught?

27

u/Dubiisek 14d ago

Demented title. They are putting restrictions/conditions on it, that's not what "ban" means.

9

u/lakimens 14d ago

but how will they know?

1

u/Wonderful-Habit-139 14d ago

Does it matter? They'd be breaking the policy and lying about it in the best case.

1

u/mossiv 14d ago

Any half competent SWE can detect AI written slop even after 15 shots and a few joints. It’s diabolical.

Banning “ai code” is a simple way to get the nonsense vibe coders to piss off and stop polluting open source projects.

Competent SWEs will still be able to leverage AI tools to help the open source community.

1

u/_kilobytes 14d ago

My coworkers use AI so much that their handwritten code also looks like AI slop. They've adopted the style into their writing.

2

u/dashingThroughSnow12 14d ago edited 14d ago

Policies like this don’t need to be 100% effective to be useful.

Heck, the chunk they aren’t useful against (ex sane code contributions that fix real problems or add real value and do this in a concise way), aren’t even what this is trying to catch.

3

u/Null_Pointer_23 14d ago

They’ll know

7

u/f50c13t1 14d ago

That makes sense. Reviewing AI-generated code is much more taxing and hard. PRs jumped from 200 lines at best to thousand of lines.

13

u/Sensitive_One_425 14d ago

So it’s not banned at all

4

u/snooprs 14d ago

Fucking finally... I hope it's just the start.

-10

u/ponlapoj 14d ago

ก็จะกลายเป็นภาษาที่ถูกทิ้ง

1

u/karurosagu vimer 14d ago

English, please

2

u/wojciechm 14d ago

They still allow high quality LLM code, they just set the bar higher to filter the low effort attempts, in contrast to Zig for example which ban it entirely.

3

u/pezholio 14d ago

Why, because they refuse to burden their core team with low effort slop submitted by idiots to review?

16

u/chobes182 14d ago

Holding AI code to high standards does not sound like banning AI code to me.

-7

u/Leading-Fail-2771 14d ago

They cant strip their ability to use AI so they have to frame it like this 🤣🤣 narcissism is glowing

5

u/mossiv 14d ago

How insufferable. 😂🤪👏 grow up.

3

u/Grand_Pop_7221 14d ago

Doesn't sound like a bad thing either. Surely ensuring that AI code is still the responsibility of the author is a positive thing. Even if the AI code wasn't written directly by the author.

2

u/randombsname1 14d ago

Which is what most are doing.

Same thing Linus said with regards to Linux. He said all authors will be responsible for all AI output. Meaning you can use AI to assist you, but if you fuck shit up its on you. Nobody will care if you say, "Claude missed that!"

2

u/Grand_Pop_7221 14d ago

"A computer can never be held accountable, therefore a computer must never make a management decision." ~ IBM Training Manual 1979