cd /news/artificial-intelligence/safety-of-llm-generated-code · home topics artificial-intelligence article
[ARTICLE · art-98621] src=discourse.haskell.org ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Safety of LLM generated code

A discussion on the Haskell Discourse forum highlights that AI-assisted developers produce commits at three to four times the rate of their peers but introduce security findings at 10x the rate, according to empirical research across Fortune 50 enterprises. The debate centers on the safety of LLM-generated code, with participants arguing that verifying code for hidden destructive bugs is challenging, especially when LLMs may ignore instructions, and that securing 'vibe-coded' applications requires treating it as a workflow-level security problem.

read2 min views2 publishedAug 16, 2026
Safety of LLM generated code
Image: Discourse (auto-discovered)

philh 1 That seems like probably a very different failure mode to me?

Like, the kind of bug that allows arbitrary file deletion in a program that’s intended to be able to delete specific files, is very different from the kind of bug that allows arbitrary file deletion in a program that’s not intended to be able to delete files. I’m imagining you were working on the first kind of program, and ychr is the second.

I’m imagining that ychr has a handful of uses for IO: reading files, mutable variables (IORef/MVar/STM/…), exceptions, printing to stdout/stderr. Maybe one or two I’m forgetting. But no writing to the filesystem, and no network access. Assuming that’s right (which it may well not be!) then I think “ruling out hidden destructive bugs to sufficient degree of confidence” isn’t all that difficult.

1 Like

I think our imagination is irrelevant when dealing with slop. And it doesn’t matter what you prompted. It’s known that LLMs sometimes ignore instructions and that unrelated code can make it into the implementation.

I don’t think any amount of effects system or safe haskell would convince me.

Either you own the output and understand it or you’re playing code roulette.

philh 3 I’m not imagining details about what the LLM generated, I’m imagining details about how to check what the LLM generated.

Like, if you know that a codebase shouldn’t have any IO at all, then checking it doesn’t is fairly straightforward. Do you agree with that?

1 Like

gregbm 4 How do I know your program doesn’t delete my home directory?

Same way you’d know for human-generated code on hackage, probably.

Speaking of which, what defenses does hackage have against malicious packages?

That’s a pretty strange way to dismiss the “lack of agency” issue. And I don’t think it can be taken seriously.

  • Empirical research across Fortune 50 enterprises found that AI-assisted developers produce commits at three to four times the rate of their peers but introduce security findings at 10x the rate, creating a security debt that accumulates faster than organizations can remediate it [7].

Our study suggests that securing vibe-coded appli-

cations requires treating vibe coding as a workflow-level security problem more than a code-generation problem

LLMs change the game here fundamentally sadly. They rework distributed trust because there is less of a hurdle of effort to get something compiling and plausibly working.

I see this myself in industry with junior devs. Before, they would get stuck and be unable to cut a PR that looked reasonable. Now, the LLM can give them that by default. But the LLM PRs have some pretty silly issues that trace back to the juniors’ lack of understanding.

gregbm 7 With regards to trusting code on hackage, I am more worried about intentionally-introduced malware than I am about vibecoded packages, so I would be interested in a verification mechanism that isn’t just scanning for signs of AI-generated code.

1 Like

Models can very well be compromised by state actors.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @haskell discourse 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/safety-of-llm-genera…] indexed:0 read:2min 2026-08-16 ·