Prompt injection

Prompt injection is an attack where text that an AI model reads contains instructions that change what it does. The text can come from a user, or hide in content the AI fetches, such as a web page, an email, a support ticket or a product review.

Why it matters

OWASP ranks prompt injection first in its Top 10 for applications built on large language models.1 It matters most when an assistant is connected to tools that can act.

In May 2025, Invariant Labs showed that a planted issue on a public GitHub repository could make an AI agent connected through the official GitHub MCP server leak data from the user's private repositories.2 The server had no bug. The agent read text an attacker wrote and followed it.

In practice

  • Keep untrusted text away from conversations where the AI can act.
  • Use read-only access wherever a tool offers it.
  • Approve every action that sends, changes or pays.
  • Turn off tools that read customer-written text when you don't need them.
  • Log which assistant can reach which tool.

What the sources say

What to do about prompt injection, depending on who you are

If you've connected Claude or ChatGPT to your store

Reviews, order notes and support tickets are written by strangers. An assistant that reads them and can also edit products or send emails is the setup to avoid.

  1. Read customer text in a conversation with read-only tools.
  2. Act in a separate conversation without that text.
  3. Keep approval on for every change.

MCP security for online stores

If you're building an AI feature or agent

OWASP lists prompt injection as the top risk for LLM applications, and model alignment alone doesn't stop it. Limit what the model can do.

  1. Give the agent only the tools one task needs.
  2. Separate reading untrusted content from taking actions.
  3. Require a person to approve anything that moves money or data.

Go deeper

My guide to MCP security for online stores sets out six rules for connecting AI to a store.

MCP security for online storesAll 106 terms

Sources

  1. "OWASP Top 10 for LLM Applications 2025," OWASP GenAI Security Project. genai.owasp.org
  2. "GitHub MCP Exploited: Accessing private repositories via MCP," Invariant Labs, 26 May 2025. invariantlabs.ai

Related terms

Least privilege

Least privilege is the security rule of giving every person, tool or AI assistant only the access its job needs, and nothing more. If that access is misused or stolen, the damage stays small.

Learn the term

Model Context Protocol (MCP)

The Model Context Protocol, or MCP, is an open standard for connecting AI assistants to the tools and data where work happens. An MCP server exposes a system, such as a store, a CRM or a document folder, so an assistant like Claude can read it and act in it.

Learn the term

Shopping agent

A shopping agent is an AI assistant that shops for a person. It searches products, compares them, builds a cart and hands it to checkout. It can run on your own store or inside an outside AI app such as ChatGPT or Gemini.

Learn the term

Want this done for you?

Connecting AI to your store or tools? Book a call and I'll help you set safe limits.

Twenty minutes and nothing to sign. The three changes are yours to keep either way.

Book a 20-minute call