Attacking AI: Penetration Testing AI Systems 

AI is rife in the current digital landscape; both business and pleasure have been infiltrated by AI agents, LLMs, and chatbots. Absolutely no one can escape it. The rate of adoption of AI as a new digital tool is the fastest ever recorded in technological history. This makes it the most rapidly adopted innovation worldwide. ChatGPT alone gained over 100 million users in the first 2 months of its launch and is currently reaching over 700 million weekly users in 2026. To put that into perspective, Facebook took roughly 7 years to reach 700m users. The sheer speed of its global takeover is enough to give anyone the shivers. 

Cyber security professionals around the globe are now dealing with a double-edged sword. Extremely insecure AI tools, shadow AI and, of course, a rapid increase in AI-powered cyber attacks. Attackers can launch novel, sophisticated attacks at scale in just a couple of minutes, something that would have usually taken days to pull off. 

Similarly, reliance on AI agents specifically has become a huge problem in the world of cyber security. Around 92% of industry leaders are concerned about the use of AI agents across the workforce and their impact on security. This blog pulls together the challenges, techniques and resources a cyber security expert will find invaluable for testing and securing AI agents in their company.

What is Penetration Testing for AI? 

Pentesting AI is, in short, an attack on an AI tool to uncover vulnerabilities before a real attacker can exploit them. It follows the same principles as any other penetration test, except the target is different. A tester would typically probe the agent for ways it can be tricked or manipulated beyond its intended use. This could include, but is not limited to, producing content it should refuse, leaking prompts and internal instructions and executing unintended actions. 

Penetration testing of AI requires slightly different techniques from traditional testing; this matters because AI doesn’t fail the way traditional software does. An agent can be working as intended yet still be manipulated into leaking data or performing unintended actions with persistent attacker effort.  

Challenges when Pentesting AI Agents

As with any new technology, there come challenges. Here are a few we, as a pentesting company, see often with AI agents. Challenges that traditional penetration testing doesn’t really deal with:

  • Non-deterministic Behaviour: The same input produces different outputs each time. A prompt that fails to break into the model once might succeed on the 12th attempt. This makes both testing and reporting harder than a traditional test where a vulnerability either exists, or it doesn’t.
  • No Fixed Attack Surface: Unlike a web app or API, which have defined endpoints. An agent’s “surface” is effectively unlimited because any input phrasing can be an attack vector. 
  • Fast-moving Unstandardised Risk Landscape – Guidance for testing on AI specifically is sparse. Pentesters are working with less-established methodologies, as much of it is still under development. OWASP recently updated its GenAI LLM Top 10 in August 2026. It shows significant movement in the rankings since 2025.

Methodology for Penetration Testing AI Systems

The foundation for most AI testing is prompt injection. Essentially, tricking the agent through natural language and syntax. Because of the non-deterministic nature of LLMs, it’s not uncommon for testers to run 8-12 different prompt injection attempts before drawing conclusions.

One of the pioneers in research on pentesting and redteaming AI agents is Jason Haddix, founder of Arcanum Information Security. His methodology for attacking AI breaks the process into the following seven stages:

  1. Identify system inputs by mapping every way that data or instructions can reach the model.
  2. Attack the ecosystem by testing the surrounding infrastructure the AI operates within.
  3. Attack the model itself by probing it directly for manipulation.
  4. Attack the prompt engineering by targeting how the system prompt and its instructions are built. Each one of these systems runs on an underlying system prompt that can potentially be overridden.
  5. Attack the data by testing which data the model can access or is trained on.
  6. Attack the application by testing the software layer wrapped around the model.
  7. Pivot by using a successful compromise in one part of the system to move further into others. 

In practice, this might look like uploading a document containing malicious elements that use cryptographic techniques to be processed as ordinary content. This approach could essentially leak the underlying prompt engineering and cause malicious code to execute.

Resources for Attacking AI

Arcanum Information Security have a tonne of resources for red teaming and penetration testing AI. These actively maintained resources are a great starting point and definitely worth bookmarking:

  • The Arcanum Prompt Injection Taxonomy – A classification of prompt injection attacks organised into four pillars: Intents, Techniques, Evasions and Inputs. Each entry cross-references how other frameworks such as OWASP, MITRE ATLAS, and NIST name the same attack.
  • P4RS3LT0NGV3 – An open-source payload crafter tool that encodes text into a multitude of formats and scripts (Base64, leetspeak, ROT13, Unicode styles, invisible text, and more). Very useful for quickly generating variants of a test payload.
  • The AI Security Resource Hub – A well-curated directory of over 100 free labs, CTFs, competitions, bug bounty programs, and tools for AI pentesting and red teaming. 

Most importantly, the OWASP Top 10 for Gen AI LLMs is the gold-standard guidance that any security professional should align their testing with. It lists the ten most common and impactful risk categories, including prompt injection, insecure output handling, training data poisoning, excessive agency, and sensitive information disclosure.

Do I need my AI system tested?

Arguably the most important question. If your organisation has deployed or is about to deploy an AI system that has any of the following characteristics, the answer is probably yes:

  • It can read content you don’t actively control (documents uploaded by clients, scraping web pages, support tickets, etc)
  • It has write access to databases, tools, or systems.
  • It can execute code or trigger other automated workflows.
  • It relies on the model itself to enforce data-handling or safety rules.
  • It’s built from multiple agents, models, or vendors stitched together (especially if any component is open-source).
  • It has access to sensitive data.

Attackers have used these techniques to manipulate AI in many documented, disclosed incidents. The pattern is that teams secure the chat interface, while the weak point lies somewhere in the ecosystem around the model. Meaning the data it ingests, the tools it can interact with or simply the trust placed in its own filtering. 

Treat AI agents the same way you would treat any other system with access to sensitive data or internal infrastructure. Tested by a professional. Sencode offers free cyber security advice and has tested a multitude of LLM-based agents and vibe-coded applications. Book a call with a consultant today to discuss your requirements for a penetration test and explore our range of services.