Skip to content

Glossary

What is prompt injection?

Prompt injection is an attack in which instructions hidden in text an AI reads make it ignore its rules or leak information. The text can be typed by a user, or buried in a CV, an email, a document or a web page the AI is asked to process.

Two kinds

  • Direct: the attacker types the instruction into the AI themselves, for example telling a chatbot to ignore its rules.
  • Indirect: the instruction is hidden in content the AI reads on someone’s behalf, such as a CV, an email or a web page. The person using the AI never sees it.

Why it is hard to stop

An AI model reads instructions and data in the same stream of text, so it cannot reliably tell the two apart. There is no single setting that fixes this, which is why OWASP lists prompt injection first in its Top 10 for LLM applications.

The risk grows when the AI can act. An assistant that can read mail, call tools or reach internal systems turns a hidden instruction into a real action.

Defences that work together

  1. Treat every piece of outside text as untrusted, however it arrives.
  2. Check prompts before they reach the AI, and replies before they reach the person.
  3. Mask sensitive data so there is less to leak.
  4. Give agents and tools the least access they need, and no more.
  5. Test regularly with real attack techniques, and keep a log of what was blocked.

How NiyamR helps

NiyamR checks what leaves in a prompt and what gets in, with replies checked too, and covers agent and MCP security. AI Red Teaming tests the result the way an attacker would.

See AI Security

A 30-minute demo on a sample prompt shaped like your team's data.

Book a demo