When you vibe-code an app, you make a lot of decisions without noticing. The biggest one is the programming language. You describe the product, the AI picks the stack, and from that moment you inherit everything that comes with it. The ecosystem, the defaults, and the security problems.

So which language does the AI actually pick? My guess before checking the data was JavaScript for the frontend and Python for the backend. Turns out the data mostly agrees, with one correction. Let’s go through it, then look at what each choice costs you in security, and then at one language the AI rarely picks but maybe should.


What the AI picks, according to real data

This is not a feeling, it has been measured.

LLMs default to Python. A study titled, honestly, LLMs Love Python tested what language models choose when the task does not force one. Every model they tested showed a strong preference for Python, both for solving tasks and for starting new projects, even when another language was the more suitable choice. A second study on programming language confusion found the same drift across 10 LLMs and 16 languages: when models wander off the requested language, they wander towards Python.

App builders default to TypeScript and React. Lovable generates React with Vite and TypeScript, backed by Supabase. v0 generates Next.js. Bolt scaffolds Next.js or Vite projects. If you used any of these tools, you are running TypeScript whether you know it or not.

And the whole industry follows. GitHub’s Octoverse 2025 report showed TypeScript became the most used language on GitHub in August 2025, the biggest language shift in over a decade, and GitHub credits AI-assisted coding for it. The year before, Octoverse 2024 showed Python overtaking JavaScript, driven by AI and data work. Nearly half of all new AI repositories start in Python.

So the verdict on my guess: right about Python on the backend, almost right about the frontend. It is not plain JavaScript anymore, it is TypeScript. Your vibe-coded app is almost certainly TypeScript in the browser and either TypeScript or Python on the server.

That is not a bad stack. But it ships with a bill, and nobody shows it to you at checkout.


The bill for TypeScript and Node

The language is fine. The package ecosystem is the problem.

npm is where the malware lives. Sonatype’s 2026 supply chain report counted more than 454,000 new malicious open source packages in 2025, and more than 99% of open source malware now lives on npm. Not because npm developers are careless, but because the ecosystem is the biggest, the dependency trees are the deepest, and until recently every package could run scripts on your machine during install.

We saw what that looks like in practice with the AntV attack, where 323 poisoned packages shipped in 22 minutes. And it is exactly why npm v12 is about to block install scripts by default.

The dependency tree is huge and nobody reads it. A fresh Next.js app pulls in hundreds of packages before you write a line of your own code. Every one of them is code you now run and trust. Typosquatting and slopsquatting, where attackers register package names that AI models hallucinate, feed on exactly this.

Types are not security. TypeScript catches a whole class of bugs at compile time, which is genuinely good. But the types disappear at runtime. An API endpoint typed to receive { amount: number } will happily receive { amount: -50, isAdmin: true } from an attacker, because nothing checks the shape of real incoming data unless you add a runtime validator. AI-generated code almost never adds one.


The bill for Python

Python’s problems are different. The ecosystem got safer, the language defaults did not.

The good news first. PyPI rolled out mandatory two-factor authentication and trusted publishing, and malware detections on PyPI dropped 43% according to the same Sonatype report. The Python packaging ecosystem is in better shape today than npm.

The language carries old traps. pickle deserializes data by executing it, so unpickling anything from a user is code execution by design. eval and exec show up in AI-generated code more than they should. Flask apps generated with debug=True ship a debugger console that can mean remote code execution in production. None of these are exotic, they are defaults and habits the model learned from decades of public tutorial code.

The model learned from old code. We covered the research in our vibe coding post: models reach for outdated crypto, custom password hashing instead of bcrypt or argon2, and one study found that asking AI to iteratively improve code made vulnerabilities increase by 37.6% after five rounds. Python’s enormous training corpus is full of code written before anyone cared.


What to do about it: patterns first, then controls

There are two layers here and people keep confusing them. Patterns are how you design the app. Controls are the tools and switches you turn on. You need both.

The patterns

We wrote about application security patterns before, and the five from that post map directly onto an AI-generated stack:

  • Input validation at the boundary. Every piece of data from outside gets checked before your logic touches it. In TypeScript that means a runtime validator like zod on every endpoint. In Python it means pydantic models, which FastAPI gives you almost for free. This single pattern kills the mass assignment and trusted-price bugs from our vibe-coded mistakes checklist.
  • Output encoding. React and modern template engines escape by default, which is why XSS went down. The pattern breaks when AI reaches for dangerouslySetInnerHTML or Python f-strings building HTML. Grep for both.
  • Secure session management. Random session IDs, short-lived tokens, real logout. AI-generated JWT code gets this wrong in predictable ways, see mistake 7 in the checklist.
  • Least privilege. The database user your app connects with does not need to drop tables. The API token does not need every scope. Applies identically in every language.
  • API gateway. One front door where auth, rate limiting and validation happen, instead of hoping every endpoint remembered. For a small SaaS this can simply be Cloudflare in front plus one middleware.

The controls

Then the concrete switches, most of which we covered in Harden Your GitHub:

None of this depends on which language the AI picked for you. All of it is free.


The language the AI does not pick: Go

Here is the part worth thinking about. The AI picks TypeScript and Python because they dominate its training data, not because they are the best choice for your product. If you get to choose, Go deserves a serious look for backend services.

The security case is real. CISA and the NSA published a joint guide on memory safe languages in June 2025, and Go is on the list. But for a SaaS backend the bigger wins are simpler ones. Go’s standard library covers HTTP, TLS, crypto and SQL, so a typical Go service has a handful of dependencies where a Node service has hundreds. Smaller tree, smaller supply chain attack surface. It compiles to a single static binary, so your container ships almost nothing an attacker can live off. Strict typing and explicit error handling mean fewer of the silent failure paths where security bugs hide. And the tooling is built in: the race detector ships with the toolchain, and gosec gives you SAST in one command.

The old objection is gone. The reason startups avoided Go was always the same: the team knows Python, learning a new language costs months. With LLMs that cost has mostly collapsed. The model writes idiomatic Go as readily as Python, and you review and learn as you go. There is even data pointing this direction: GitHub’s Octoverse shows developers moving towards typed languages precisely because AI works better with them. A study cited in the report found 94% of LLM compilation errors were type-check failures, which means a strict compiler is catching AI mistakes that a dynamic language would let through to production. Go’s compiler is exactly that kind of strict.

The honest caveat. Go does not fix authorization, leaked secrets, or business logic. Every mistake in our vibe-coded apps checklist is possible in Go too. Changing language buys you a smaller attack surface and a stricter compiler. It does not buy you out of doing security.


Bottom line

You will probably ship TypeScript and Python, because that is what the AI ships. That is fine. Just know what came in the box: the deepest malware ecosystem in software on one side, and a language full of friendly footguns on the other. Apply the patterns, turn on the controls, and if you are starting a fresh backend and get to choose, ask your AI for Go and see how far you get. You might be surprised.

Not sure what your AI-picked stack is exposing?

We review vibe-coded and AI-assisted codebases in any language. Stack choice, dependencies, patterns and controls, with a prioritised fix list your team can execute.

Book a free call

References