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

MoT Professional Membership image
For the advancement of software testing and quality engineering
Explore MoT
Introducing TestRail 9.5: AI That Truly Understands Testing image
Thu, 18 Sep
See how easy it is to achieve 90% faster test case creation with TestRail's new intelligent test case generation tool
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.