O&O ConsultingBook a free call

Home / Insights / AI Risk and Governance

Prompt Injection: The Security Problem of AI Applications

Text from outside can hijack a language model's behaviour. Defence depends on system design.

O&O Consulting · · 2 min read

Program code on a screen

Conventional software keeps code and data apart. A language model receives both as text in one stream, and may follow instructions wherever they appear.

Direct and indirect

Direct injection is a user typing something like "ignore your previous instructions". Indirect injection is more serious: an instruction hidden in a web page, email or document that the system later processes. Greshake and colleagues demonstrated that such content could steer applications built on language models, including causing data to be leaked.

The user may see nothing unusual. The attacker never touches your system directly.

Reducing the damage an injection can doIllustrative diagram, not data
Weak designModel holds broad accessReads untrusted contentCan send data out aloneSafer designLeast privilege per toolUntrusted content isolatedHuman approval for actions
Weak designModel holds broadaccessReads untrustedcontentCan send data outaloneSafer designLeast privilege pertoolUntrusted contentisolatedHuman approval foractions

Diagram by O&O Consulting.

Why filtering is not enough

Detectors and warnings in the system prompt reduce success rates, but attacks can be rephrased endlessly, translated or encoded. No current filter provides a guarantee. The OWASP list of risks for language model applications places prompt injection first.

Design principles

  • Treat all model output as untrusted input to the next system.
  • Grant tools the narrowest permissions possible.
  • Do not combine, without checks, access to private data, exposure to untrusted content and the ability to communicate externally.
  • Require confirmation, showing exactly what will happen, before consequential actions.
  • Block automatic loading of links or images that could carry data out.
  • Enforce access control in ordinary code.

Test and monitor

Include hostile documents in your test set. Log tool calls and review anomalies. Decide in advance how to disable a feature quickly.

Limitations and open questions

Research is exploring architectures that separate a trusted planner from a component that reads untrusted data, and training that gives system instructions priority. These help, and none yet makes it safe to give an unsupervised model broad authority over sensitive resources.

References

This article is general information, not financial, legal or investment advice. AI research and rules change quickly; check the cited sources for the current position.