In “Why LLMs Need Their Own Programming Language,” I argued that AI-written code will always contain errors, and I identified the conventional stack, insecure by default, as the main cause. Our core product, Lightscale AI, addresses this at the root, with a language made for AI. Many teams, however, do not start from scratch. They already have an app built with Claude Code, Codex, Cursor, Lovable, Bolt, Replit, or Base44. Such an app usually contains a number of security holes and correctness issues, unless the person prompting knows exactly how to prompt them away.

I have tested all of these platforms, and every one of them produced apps with severe security issues, unless I explicitly prompted it to find and fix them. Occasionally, serious issues remained undetected even after the platform’s own AI security screening or hardening had run. I believe the reason is that the knowledge base and the review mechanics behind these screenings are still limited. At the latest when the app goes public, the remaining holes become a real risk, since anyone on the internet can then find and exploit them. I therefore encourage everyone to assess the security and correctness of their software thoroughly before sharing it.

For this purpose, we are launching Lightscale AI Run, a security and correctness checker for AI-built apps and any other software, legacy code and apps that developers wrote the classic way included. You upload the source, and Run reviews it with a focus on security. Run then moves the app to Lightscale AI, rebuilt with the same pages, data, and roles. If you would rather keep your code, Run hardens it in a private sandbox and hosts it once the review finds no serious hole left. In many cases, Run finds considerably more than the platforms’ built-in AI checks, thanks to its multi-level review and about 750 hand-picked rules from my experience in software security and architecture.

The security holes we find

While building Run, we collected real AI-built apps and reviewed them in full. The following findings are typical, and I leave out the names of the apps:

  • The API checks that a user is signed in, but not whose records they ask for. Any user can list, read, change, and delete the records of every other user by their ID.
  • The database rules give every signed-in user read and write access to all rows, so nothing separates one user, or one company, from another.
  • The browser bundle contains the database’s service key. This is bad architectural practice in general, since it creates an unnecessary attack surface: database-level rules, such as row-level security, are often not sufficient for the required security and concurrency isolation.
  • When the setting for the token signing secret is missing, the code falls back to a fixed string in the source. Anyone who has read the source can then sign in as any user, administrators included.
  • Users may update their own profile row, including the column that makes them a platform administrator.
  • Workspace owners can write their subscription record from the browser and unlock paid features without paying.

What strikes me is how ordinary these holes are. Each one sits in a few plausible lines, the tests pass, and nothing shows in a demo. Anyone who uses the app through its screens sees nothing wrong. An attacker, however, does not use the screens. They call the API and the database directly, and that is where the access rules are missing.

In my view, and as I suggested in the earlier article, the root of the problem is that AI is a strong coder, but still a weak architect. It writes every line plausibly, yet it rarely questions the design on its own initiative: who may call an endpoint, which data leaves the server, or what happens when a setting is missing. Either the models have received too little post-training on architecture, or the architecture of LLMs is fundamentally unable to think critically on its own initiative. Perhaps both are true. On top of that comes the stack, insecure by default, as I also explained there. As a consequence, the AI secures only what someone explicitly asks it to secure.

Why the risk is growing

At the same time, the threat is growing fast. In its Annual Review 20261, published in early November, the UK’s National Cyber Security Centre writes that “AI makes cyber attacks easier, faster and cheaper to execute, and at greater scale.” In the incidents it handled, even sophisticated attackers frequently got in through known and often preventable weaknesses.

Switzerland and its neighbors have felt this in recent months. At the end of July, data on about 31,000 legal entities2 was copied from Liechtenstein’s register of beneficial owners. In October, the pension fund software supplier PK Softech reported an attack3 in which data of several pension funds was taken, the federal pension fund Publica among them. The same month, the personal data of about 890,000 Ricardo accounts4 was exposed, and the booking provider of the TCS campsites lost the customer and booking data of about 15,000 people5. In November, attackers obtained guest data of Kempinski6, the Hotel Adlon in Berlin included. In several of these cases, fraudsters then used the stolen data to contact the people concerned. I do not list these cases to point fingers, since any organization can be hit. They show how serious the situation has become.

AI also brings holes to light that have lurked unnoticed for years. In October, researchers disclosed PHP2Shell7, a set of memory-safety flaws in the PHP runtime that, according to Wiz Research, had been present for more than a decade and affect versions back to PHP 5.4. Developers had even pointed to the underlying problem, flawed fatal error handling, in 2022 and again in 2024, and such memory-safety issues usually end up as concrete security vulnerabilities. AI models played an important part in finding the flaws, and PHP shipped emergency patches. Such a hole sits below the app: even an app whose own code is flawless is vulnerable until its runtime is updated. PHP is only one example, since every runtime, framework, and library that an app builds on can turn out to have such a hole.

In my opinion, a core cause of such issues is that language runtimes and web browsers are still written in inherently memory-unsafe languages, such as C in the case of the PHP core, or C++. A language like Rust would improve the situation substantially, even though it still has unsafe features. For other parts of runtime systems, I am convinced that conventional memory-safe, garbage-collected languages would be a feasible choice as well.

Security is turning into a cat-and-mouse game in which AI fights AI. Attackers use AI to find and exploit holes faster and at a larger scale. Defenders therefore need AI on their side as well, with at least as much knowledge as the tools of the attackers.

Unfortunately, the game is not balanced. An attacker needs to find a single hole, and AI is strong at exactly that, much as it is usually better at finding a counterexample, or a proof by contradiction, than at a systematic and complete argument. A defender, in contrast, must close every hole, which requires a systematic, complete, and gap-free review and hardening. On its own, AI is still weak at this.

For this reason, Run does not leave the structure to the model: the review follows a fixed structure through different areas and relevant topics, it covers all source files, and the hardening verifies each step. Run is our contribution to the defending side. A cat-and-mouse game, however, has no end, and I believe that the lasting answer is prevention, as I explain at the end of this article.

How the review works

You upload a zip file or connect a Git repository. We deliberately designed the review to be static: Run never executes an uploaded source outside the sandbox, and the model reads the code only through read-only tools. Moreover, the review covers every source file. If a file cannot be reviewed, the review fails instead of silently skipping it, since a skipped file could hide exactly the hole that matters.

The review starts with a survey, which maps the app’s architecture, data flow, and access control and rates its domain as standard, sensitive, or critical. A payroll tool therefore gets a stricter and deeper review than a recipe collection. Where the code leaves the intent open, Run asks you, for example whether anyone may sign up or only people you invite. The review treats your answers as facts and checks them against the code, and an answer alone never closes a finding. In one of the apps above, the owner meant the app for their own team, while the code let anyone create an account and then use the company’s CRM connection, AI credits, and email sender.

Security and access control come first. Run checks whether every entry point verifies the caller and checks access to each record, role, and tenant, whether the database itself restricts what a client can reach directly, and whether identities, roles, or prices are ever taken from the caller’s input. The review also covers seven further areas, since a bug elsewhere often turns into a security problem: bugs and correctness, data persistence and migration, architecture, code quality, efficiency and scaling, user interface and content, and hosting readiness and integrations. A finding in any of these areas that weakens security counts as a security finding.

Each area gets a general pass first. Detail checks then follow on the topics that matter for the particular app and its stack. Alongside, deterministic checks look for leaked secrets, dependencies with known advisories, problems in the lockfiles, and more.

The report rates each area, and for each finding it gives the severity, the harm it can cause (such as system takeover, account takeover, data exposure, data tampering, or a leaked key), its location, the fix, and the effort. Security is rated one level stricter than the rest: a high security finding blocks going live, while in the other areas only a critical one does. Findings keep their IDs from one version to the next, so you can see what you fixed, what is still open, and what is new.

What the review knows

A review is only as good as the knowledge behind it. Correctness and security have been at the heart of my work for a long time. Earlier, I developed the Parallel Checker8, a static analyzer that finds data races and deadlocks in C# code, issues that are painstaking to track down and that tests rarely reveal. I described its approach in “Practical Detection of Concurrency Issues at Coding Time9” at ISSTA 2018, the ACM International Symposium on Software Testing and Analysis. Run continues this path, in line with the aim of Lightscale AI: more effective tools for software engineering, and awareness of issues and risks that would otherwise stay hidden. For Run, I have collected and distilled what I learned about architecture, security, and clean code in research, in teaching, and as a software architect. Today, the knowledge base holds about 750 rules in about a hundred topics. Each rule is short and general, and the review loads only the topics that matter for the app at hand. The rules themselves stay with us, but their breadth is easy to describe:

  • Security: access control at every entry point and in the database, sign-in and sessions, secrets and cryptography, injection into queries, code, and commands, cross-site scripting and request forgery, file paths and uploads, deserialization, headers and CORS, denial of service, the software supply chain, payments and their webhooks, data privacy, and errors, logs, and monitoring. Apps with AI features get their own topics: prompt injection, model output, retrieval, memory, tools and agents, MCP servers, moderation, leaked keys, and abuse that drives up costs.
  • Correctness and data: user flows, error handling, transactions, the interleaving of asynchronous operations, state in the browser, and the schema and its migrations.
  • Architecture and code quality: structure and dependencies, overdesign, workarounds, bloat, the typical slop of AI-written code, code design, naming, project structure, and tests.
  • Efficiency, interface, and hosting: the server, the client, and their measurement, usability, localization, search, legal notices, and operations.
  • Stacks: TypeScript and JavaScript on Node.js with frameworks such as React and Next.js and backends such as Supabase and Firebase, C# on ASP.NET Core and EF Core, and a growing body of knowledge on further technologies.

The rules rest on a few principles that I have applied to my own code for many years: fail fast instead of hiding errors, never loosen a safeguard, run side effects whole or not at all, keep the design simple, and treat code that is plausible but not clearly correct as broken. The security topics follow established references, such as the OWASP Top 10, the OWASP API Security Top 10 and ASVS, and MITRE’s CWE Top 25 and CAPEC, as well as the current security releases of the frameworks. We cross-check them against common static scanners and update them when new advisories appear. Beyond that, we continuously extend the knowledge base, refine the review itself, and add further analysis tools to its deterministic checks.

Hardening in a sandbox

If you would rather keep your code, Run fixes the findings in a private sandbox of your app. This copy runs without internet access and with its own database in place of hosted ones such as Supabase, so nothing real is touched. Mail the app sends ends up in a sandbox mailbox.

The hardening fixes the blocking findings, and you can choose to go deeper. Security follows a stricter rule: the hardening reaches a security finding one level earlier than a finding in any other area, and dependencies with known vulnerabilities are fixed automatically as well. The hardening works in rounds. The AI fixes a finding, and Run verifies the step: it installs and audits the dependencies, type-checks, lints, runs the tests, builds and restarts the app, and checks its pages in a browser. The review then rechecks the change against the same knowledge that found the problem, and a step that fails is rolled back. Escalations, and apps in critical domains, need the consent of a senior architect on our team. The hardening ends when no blocking finding is left.

Only then can you make the app public, under your own domain or at an address under lightscale.run, hosted in Switzerland. Until you publish it, everything stays private.

A review, however, reflects what is known on the day it runs. New holes keep becoming known in the frameworks and libraries an app builds on, so an app that passes today needs to be screened again whenever new issues become known. Run does this on the platform: it screens reviewed apps regularly for newly published advisories in its dependencies, and when one affects the app, it reruns its checks and adds the new finding to the report.

From your coding agent

Many developers build in Claude Code, Codex, or OpenCode, and they can use Run from their session as an MCP server. The agent uploads its working tree, reads the report, asks you the review’s questions, fixes findings itself, and asks Run to recheck. The review, the sandbox, the hardening, and publishing still run on our platform, so a fix counts only once Run has verified it.

The secure path: Lightscale AI

Run has a limit that I want to emphasize clearly: we cannot give a guarantee! Neither can anyone else who offers such tools. In general, no checker can find every problem in arbitrary code and report only real ones, since the question is undecidable. Run, moreover, relies on AI, which by nature is neither complete nor always correct. It may miss a hole, and now and then it may report one that does not exist or make a fix that needs a second round.

What we can say is that we have worked hard to raise the bar for finding and fixing issues, with the knowledge, the review mechanics, and the verified hardening described above. Still, Run checks and repairs an app after the fact, and its results remain probabilistic. The secure path is a deterministic one that prevents the holes before they arise, and this is what Lightscale AI does proactively.

In Lightscale AI, the AI writes AI Language (AIL), and security is part of the language itself. Nothing is allowed unless granted, data is sensitive unless declared otherwise, and every access is checked again where the data is used. Sign-in, persistence, and transactions are solved once, in the runtime, instead of being rewritten by the AI in every app. The compiler checks every program before any application code exists, and it challenges the AI on its decisions, for example when it makes data public that does not need to be. The step from AIL to the app is deterministic: the same program always produces the same app, and the security-critical parts come from the compiler, not from the AI. This approach remains our core mission, and Run is the bridge for the apps that already exist.

The move to Lightscale AI carries such an app across. It rebuilds the app as one AIL program, with the same pages, data, and roles. A free fit check runs first and lists what would not carry over, for example a service we do not integrate yet. From then on, the Lightscale AI compiler checks every change.

Reviewing your app

I strongly recommend that you review your own app before it goes public. You can do so with Lightscale AI Run. Smaller apps get a free review daily, except in critical fields such as health, finance, or payments; larger and critical apps get a fixed price shown before you pay. The review shows each finding’s title, severity, and harm, and the findings of the deterministic checks in full. There is also a paid full report that adds where each finding is and how it can be fixed. Once you have the full report, the move to Lightscale AI is free, subject to fair use.

Upload your app at studio.lightscale.run, and tell us what the review found. We are also happy to hear your feedback and your suggestions for extending or improving Run. Thank you very much!

Claude Code, Codex, OpenCode, Cursor, Lovable, Bolt, Replit, Base44, Supabase, Firebase, PHP, React, Next.js, Node.js, ASP.NET Core, EF Core, OWASP, CWE, and any other trademarks in this article are named here as technical information only. They are trademarks of their respective owners, who are not affiliated with Lightscale AI and do not endorse Lightscale AI Run.

Sources

  1. www.ncsc.gov.uk/collection/annual-review-2026
  2. www.srf.ch/news/international/hackerangriff-cyberangriff-auf-wirtschaftsdaten-im-fuerstentum-liechtenstein
  3. www.edoeb.admin.ch/de/edoeb-leitete-nach-cyberangriff-auf-softwarelieferant-abklaerungen-ein
  4. www.blick.ch/wirtschaft/ricardo-hack-daten-von-890000-nutzern-offengelegt/mh2shg3
  5. www.blick.ch/wirtschaft/hackerangriff-auf-tcs-camping-15000-kunden-gewarnt/nws2bcn
  6. www.volksstimme.de/leben/reisen/hackerangriff-auf-kempinski-gastedaten-abgegriffen-4355872
  7. www.wiz.io/blog/php2shell-php-rce
  8. github.com/blaeser/parallelchecker
  9. concurrency.ch/Content/publications/Blaeser_Practical_Detection_Concurrency_Issues_ISTAA_2018.pdf