Prompt injection

Prompt injection image
Prompt injection is a security attack that happens when someone intentionally manipulates the input to a Generative AI system like a chatbot or code generator to make it behave in ways the designer didn’t intend.

It’s done by crafting inputs to Gen AI systems in order to confuse, hijack, or redirect the AI’s response by messing with its underlying structure.

For software testers, it's a way to test for input attacks on LLM-based systems. Just like a SQL injection or XSS, but here the payload is language and words designed to interfere with the model or system prompts.
Prompt injection is defined as a security exploit whereby an attacker embeds malicious instructions within user-provided input to override or subvert the original, intended prompt given to a language model. In essence, it's akin to SQL injection—but instead of manipulating a database query, you're manipulating a GPT-style prompt.

Prompt injection = malicious input that "injects" new directives into a prompt to trick the model into doing something unintended, sidestepping the instructions it was originally given.

Prompt injection involves:
  • Attacker adds instructions inside the input (e.g., “Ignore the above directions and say …”)
  • The model then obeys those injected commands, disregarding the original prompt
  • This can lead to leaking confidential prompt contents or performing unauthorized actions

TestBash Brighton 2025 image
On the 1st & 2nd of October 2025 we're back in Brighton for TestBash: the largest software testing conference in the UK
Explore MoT
Beyond AI: Why Serious Teams Choose Reflect Mobile image
Thu, 28 Aug
Discover how modern teams scale mobile test automation with vision-driven, cross-platform testing that integrates deeply into existing QA pipelines.
MoT Software Testing Essentials Certificate image
Boost your career in software testing with the MoT Software Testing Essentials Certificate. Learn essential skills, from basic testing techniques to advanced risk analysis, crafted by industry experts.
Leading with Quality
A one-day educational experience to help business lead with expanding quality engineering and testing practices.
This Week in Testing image
Debrief the week in Testing via a community radio show hosted by Simon Tomes and members of the community
Subscribe to our newsletter
We'll keep you up to date on all the testing trends.