← Back to blog

AI-generated code and cybersecurity in 2026

· Security research

When AI picks up speed

Since the start of this year alone, so many AI-related technology improvements have reached the market that it is getting harder to be surprised: expectations only keep rising.

It is hard to keep up with the Anthropic team and its Claude Code, which, according to marketing claims, “reads documentation, writes in several languages, runs tests itself and iterates until the product is ready for production” [1].

Alongside it, models are improving rapidly. Opus 4.7, introduced in April, scored 64.3% on SWE-Bench Pro (almost 11 points more than its predecessor) [2]. Claude Mythos, released only on a limited basis, drew even more attention. In the laboratory it proved capable not only of writing code: it independently found and exploited zero-day vulnerabilities in all the major operating systems and browsers, including a 17-year-old FreeBSD bug (CVE-2026-4747) that allows root access via NFS [3]. The company itself described this model as significantly more capable than Opus 4.7 in programming and did not release it widely, fearing that malicious actors would use it. It was a sign that AI is becoming ever more capable not only of writing code, but also of testing, protecting and exploiting vulnerabilities.

In the Fortune 500, 87% of companies have already adopted at least one vibe coding platform [4], and the number of App Store submissions jumped by 84% in a quarter [5].

Apple draws a line

Apple seems to be lagging in the AI race: Apple Intelligence no longer competes with the leading AI models on functionality. But the company has chosen to speak a different language: not about capabilities, but about quality.

In March 2026, Apple quietly blocked updates for several vibe coding products, including Replit and Vibecode, and simply removed the app Anything from the App Store [6].

The formal reason: guideline 2.5.2, which prohibits apps from executing code that changes their own functionality. Technically, these platforms display AI-generated apps through embedded web view components, and Apple treats this as dynamic code execution [7].

The real message is broader: Apple did not say “no to AI”, it said “no to poor-quality products”, regardless of who wrote them. The updated 2026 rules strengthen privacy and dynamic code requirements: many AI apps no longer even reach the user [8]. This is the first major platform owner to say clearly that responsibility for the consequences still lies with the maker, not with the model.

How much AI code is insecure?

When Veracode tested more than 100 large language models in 2025 and checked the code they generated in four programming languages, the result was unforgiving: 45% of code samples failed security tests and contained OWASP Top 10 vulnerabilities. AI-generated code contained 2.74 times more vulnerabilities than human-written code. Java was the riskiest language: 72% of tasks were not solved securely [9].

Apiiro’s enterprise study showed an even more dramatic trend: by June 2025, AI-generated code was producing more than 10,000 new security issues every month, ten times more than six months earlier. Privilege escalation paths increased by 322% and architectural flaws by 153% [10].

A Stanford University study (led by Dan Boneh) added an unpleasant nuance: programmers who worked with an AI assistant wrote less secure code than those who worked without one, but felt they were writing more secure code. A classic error-reinforcement loop: confidence grows faster than competence [11].

In the first quarter of 2026, independent scanning showed that 91.5% of vibe-coded applications contained at least one flaw related to AI hallucination. XSS vulnerabilities were found in 86% of AI code samples, and secrets (API keys, credentials) were leaked in 3.2% of AI commits (twice as often as in human-written ones) [12].

When the problems reach users

Two incidents this year illustrate well what happens when these problems move beyond the test environment.

Lovable, a vibe coding platform valued at USD 6.6 billion with eight million users. In a short time, three documented security incidents exposed source code, database credentials and thousands of user records. One BOLA (Broken Object Level Authorization) flaw stayed open for 48 days after a security researcher reported it: the company simply closed the report without proper review [13].

Moltbook, a social network for AI agents, built entirely through vibe coding. In February 2026, the security company Wiz found a misconfigured Supabase database exposed to the internet: 1.5 million API authentication tokens, 35,000 email addresses and private agent conversations, accessible to anyone [14]. The root cause: a Supabase API key left in client-side JavaScript code without an RLS (Row Level Security) policy. A five-minute configuration setting would have prevented the entire incident.

Important: in both incidents the problem was not the code logic, but configuration, infrastructure and processes, areas that nobody has really taught an AI model.

Secure code is not yet a secure product

The first thing worth accepting openly: AI-written code is rarely perfect. Even when it looks tidy, subtle bugs, unchecked edge cases and decisions that suit the general case but not your environment remain.

The second, sometimes even more important point: AI does not think about the other layers in which that code will run. Network segmentation, secrets management, identity policy, monitoring, compliance requirements: all of this lies outside the model’s field of view. It writes a function, but does not ask how it will integrate into the whole system.

And if AI is nevertheless used to address these layers too, the result often does not show the real state of affairs or simply misleads: the model offers textbook best practice that in your specific environment may be partly wrong, unnecessary or even in conflict with controls that are already in place. Context differs — network topology, legacy systems, existing protection layers — and AI cannot see it.

This is exactly where the role of security experts shows itself: they have a broader view — they connect code with infrastructure, assess which layers already compensate for code weaknesses and where the risk really lies. In our opinion, this is a question that everyone making decisions about AI-generated code in production should be thinking about today.

How do experts assess the real security of a system?

Since AI does not see the full picture, a system has to be assessed from the outside: by observing how it actually behaves, not what the code says. Security experts take two complementary steps for this.

1. DAST testing in the production environment. Unexpected, malformed and malicious requests are sent to the running application: manipulated parameters, unauthorised access attempts, edge-case inputs. We observe how the system reacts, what it returns, whether it reveals internal information through error messages, and whether it properly authorises access to deeper objects. This brings out vulnerabilities that look innocent in the code but become an attack vector in the real application.

2. Infrastructure state check. At the same time, the environment in which the code runs is assessed: network segmentation, WAF rules, identity management, secrets storage, audit logs, backups, update status. Not because AI makes mistakes in these areas, but because these very layers either compensate for code weaknesses or leave them open to attack.

By combining both views — the real behaviour of the system and the state of the infrastructure — a report can be prepared with specific, context-appropriate recommendations: what to fix in the code, what to change in the configuration, what to strengthen in the firewall, where additional monitoring is needed. This is material the team can act on, not the general textbook guidance that AI would return.

How does infrastructure help contain risk?

It is important to say up front what infrastructure does not do: it does not turn insecure code into secure code and does not relieve you of the duty to fix that code. Its role is different: it is a layer made up of many components, each designed to manage a particular category of threat: some repel network attacks, others stop automated scanners, others limit the damage if something still got inside, and others record anomalies.

As for vulnerabilities found during an assessment, tools such as a WAF allow you to quickly block them as a temporary fix until the team ships the final solution in code. Audit logs and a SIEM, in turn, show whether anyone is trying to exploit that vulnerability and allow you to respond proactively, before the damage has had time to spread.

The tools this protective layer most often consists of:

  • Web Application Firewall (WAF). Filters unwanted and malicious requests at layer 7 — SQL injection, XSS and other known patterns — even when those flaws are still present in the code itself.
  • Bot protection. Stops automated scanners looking for vulnerabilities and prevents content scraping.
  • Network segmentation. Even if a single node in the DMZ is compromised, an attacker cannot easily jump into the internal network and reach more sensitive systems (pivoting).
  • Principle of least privilege. A compromised service can reach only what it actually needs — not the whole database and not all API keys.
  • Audit logs and SIEM. Record events, make it possible to spot anomalies and respond before serious damage has occurred.
  • Backups and immutable infrastructure templates. Make it possible to restore a system within minutes after a compromise or an error.

This is defence in depth: if one layer fails, the others stop the attack. The infrastructure as a whole is properly chosen and configured layers that reduce risk in a way that stays practically unnoticeable to the user: no additional friction, slowness or more complicated sign-in. Simply fewer opportunities for what we do not want to happen.

Conclusions

The myth of AI as the solution to everything is dangerous not because the models are bad: Claude Opus 4.7, Mythos or GPT-family models really do speed up an experienced programmer’s work. The myth is dangerous because the full context between layers is not visible.

Regulatory action of the Apple kind will only become more common. NIS2, DORA and emerging AI regulations will increasingly require organisations to be able to demonstrate their control layers, not merely trust the code.

In practice, this means that alongside static code analysis (SAST), DAST (Dynamic Application Security Testing) is becoming ever more important: testing a running application with unexpected requests that AI did not think of. DAST does not assess code line by line, but observes how the system actually behaves during an attack, what it returns when it receives malformed input, whether it reveals internal information through error messages, and whether it properly authorises requests to deeper objects. This is where the vulnerabilities that neither the AI assistant nor the programmer anticipated while writing the code most often come to light.

The Atakos vektorius team helps organisations prepare several layers of this context at once:

  • DAST vulnerability assessment: dynamic testing of a running application with unexpected requests, revealing what cannot be seen in the code.
  • WAF configuration and management: a protective layer that stops attacks and automated scanners even when vulnerabilities remain in the code itself.
  • Training for IT engineers and developers: practical security testing and web application hacking techniques.

If you are considering AI-generated code in your system, have questions that worry you, or something simply is not working as it should — let’s talk.

Sources

  1. Claude Code as autonomous software engineer — Startup Fortune
  2. Anthropic launches Claude Opus 4.7 — SiliconANGLE
  3. Claude Mythos Preview — Anthropic
  4. Vibe Coding Security Risks: Enterprise Guide 2026 — BeyondScale
  5. Vibe coding drove an 84% jump in App Store submissions — TNW
  6. Apple Pulls Vibe Coding App 'Anything' — MacRumors
  7. Apple blocks updates for AI coding apps — AppleInsider
  8. Apple Tightens App Store Rules for AI-Built Apps — Adalo
  9. 2025 GenAI Code Security Report — Veracode
  10. 4x Velocity, 10x Vulnerabilities — Apiiro
  11. Dan Boneh on AI making code buggier — Stanford EE
  12. AI Coding Security Vulnerability Statistics 2026 — SQ Magazine
  13. Lovable security crisis — TNW
  14. Hacking Moltbook: AI Social Network Reveals 1.5M API Keys — Wiz

Want to know the state of your system?

We offer a free check of your website for potential vulnerabilities or other security gaps.

Sign up for a free scan