GenAI

Prompt Injection and Data Leaks in AI Assistants: Your Provider's Safeguards, a Guardrail Product, or Your Own Controls

What prompt injection is, how instructions hidden in a web page, email or document can make an AI assistant leak data, and why no filter catches every attack. It compares the safeguards of Microsoft, Amazon and Google, separate guardrail products and open-source frameworks, and the controls you build into your own application, and gives published prices, tests to run before launch and questions to ask.

By amBrain11 min read

In this article

Prompt injection is an attack in which an AI assistant follows instructions that an attacker placed in the text it reads. The text can come from the user or from a web page, email, ticket or document the assistant processes. If the assistant can also reach private data and send anything out, a successful injection can become a data leak. There are three lines of defence: the safeguards your model or cloud provider offers, a separate guardrail product or open-source framework, and controls built into your own application. The first two make attacks succeed less often. Only the third sets hard limits on the damage, so you need more than one.

The short answer: turn on your provider's injection checks first and confirm which inputs they read, since documents and tool results are often left out. Add a separate guardrail product or framework when you run several models or clouds, or need one policy and one log. In every case, build your own controls into the application. Give the assistant minimal access, let data go only to listed places, and have a person approve sending, paying or deleting.

What is prompt injection, and how does the indirect kind reach an assistant?

The Open Worldwide Application Security Project (OWASP) is a nonprofit security foundation. It ranks prompt injection first in its 2025 Top 10 risks for applications built on large language models (LLMs). In a direct injection, the user types the instructions, for example by telling a support bot to ignore its rules. In an indirect one, they arrive inside content: “Indirect prompt injections occur when an LLM accepts input from external sources, such as websites or files.”

The attacker needs no access to your systems. Microsoft's Security Response Center gives two examples: an email sent to the victim and a shared document. The instructions in them “might be hidden from the user, for example using white text on a white background or non-printing Unicode characters”.

Why does a successful injection turn into a data leak?

A leak needs three conditions at once. Meta's “Agents Rule of Two”, inspired partly by Simon Willison's “lethal trifecta”, names them:

  • The assistant processes untrusted input, such as inbound email or web pages.
  • It can reach sensitive systems or private data.
  • It can change records or send data out.

Meta says an assistant should have no more than two of these in one session. When a task needs all three in the same session, the assistant “should not be permitted to operate autonomously and at a minimum requires supervision”.

Data can leave without an email tool. Microsoft describes a model that writes an image link whose web address carries stolen data. The user's browser loads the image and sends the data to the attacker “without any user interaction”. A clickable link leaks the same data once clicked, and a tool that writes somewhere public can leak it directly.

The US National Vulnerability Database records an injection flaw in Microsoft 365 Copilot that “allows an unauthorized attacker to disclose information over a network”. Microsoft rated its severity 9.3 out of 10. Rules in the model's instructions, the system prompt, do not reliably stop such leaks. OWASP's entry on sensitive information disclosure says they “may not always be honored and could be bypassed via prompt injection or other methods.”

Why can no filter catch every injection?

The UK's National Cyber Security Centre (NCSC) explains why: “Current large language models (LLMs) simply do not enforce a security boundary between instructions and data inside a prompt.” SQL injection, an older attack on databases, is stopped by never treating input as a command. A language model cannot do that, so the NCSC concludes that prompt injection “will remain a residual risk, and cannot be fully mitigated with a product or appliance”.

Model providers agree. Meta calls prompt injection “a fundamental, unsolved weakness in all LLMs.” Anthropic tested its Chrome browser extension against an internal adaptive attacker with 100 attempts per test environment. The attacker still succeeded in about 1% of attacks on Claude Opus 4.5 with Anthropic's improved safeguards. Anthropic says this level “still represents meaningful risk”.

Detection models, or classifiers, learn from attacks already seen. Meta says its Prompt Guard 2 classifier targets “explicit, known attack patterns” and lists “Vulnerability to Adaptive Attacks” among its limits. The NCSC advises buyers: “Beware any that claim they can ‘stop’ prompt injection, and instead look at those who understand how they reduce it.”

What do the safeguards from your model or cloud provider cover?

Microsoft, Amazon and Google sell injection checks that run next to the model.

Microsoft's Prompt Shields, part of Azure AI Content Safety, detect “User prompt attacks” and “Document attacks”. Microsoft defines the second as “Hidden instructions embedded in document content (documents, emails, web pages)”. In Microsoft's Foundry platform for models and agents, “Document attack detection is off by default”. When you call the service through its application programming interface (API), “the API doesn't itself block or route content”, so your code acts on the result. Its detection models are “primarily trained and evaluated on English content”. Microsoft's price list now calls the service Content Safety in Foundry Control Plane. It shows a free tier of 5,000 text records a month. The standard tier costs $0.375 per 1,000 text records, each of up to 1,000 characters, in most regions.

Amazon Bedrock Guardrails defines the injection its prompt attack filter catches as “User prompts designed to ignore and override instructions specified by the developer.” With Bedrock's InvokeModel calls, the user input must be tagged: “If there are no tags, prompt attacks for those use cases will not be filtered.” Amazon adds: “The prompt attack filter does not evaluate tool results.” Content filters, which include the prompt attack check, cost $0.15 per 1,000 text units of up to 1,000 characters. The prompt attack check alone costs $0.08 through a separate operation. The filter that blocks or masks personal data costs $0.10.

Google Cloud's Model Armor screens prompts, responses and uploaded documents for injection, sensitive data and malicious links, for AI deployed “in Google Cloud or other cloud providers”. It “inspects each prompt and response independently as a single-turn request”, without looking at earlier messages. It also “doesn't decode or inspect encoded content, such as prompts encoded in Base64”, a common way of writing data as letters, digits and a few symbols. Model Armor is free up to 2 million tokens a month, then $0.10 per additional 1 million tokens, at about four characters per token.

Providers also train their models to resist injection. Google says adversarial training “significantly enhanced our defenses against indirect prompt injection attacks in Gemini 2.5 models”. The open-source OpenAI Guardrails library, still in preview, has an injection check that looks for “Misaligned tool calls and tool outputs”.

What does a separate guardrail product or open-source framework add?

A separate guardrail layer can sit between your application and every model it calls, so one set of rules and one log cover them all.

NVIDIA's NeMo Guardrails is open source under the Apache 2.0 licence. It runs checks, which it calls rails, on user input, retrieved document chunks, tool calls and output. A retrieval rail “can reject a chunk, preventing it from being used to prompt the LLM”. Meta's Llama Prompt Guard 2 is a small classifier you run on your own servers. It reads 512 tokens at a time, so long documents must be split. Both are free to download. The costs are servers, added delay and the engineers who tune them.

Several commercial products have changed owners. Check Point completed its purchase of Lakera and sells its runtime protection as AI Agent Security. Palo Alto Networks bought Protect AI for its Prisma AIRS platform, and F5 bought CalypsoAI and sells F5 AI Guardrails. Their figures are their own claims. Check Point credits Lakera with “detection rates above 98 percent with sub-50ms latency and false positives below 0.5 percent”. None of the product pages read for this article shows a price. They offer demos, and Lakera lets you start for free.

Which controls do you have to build into the application yourself?

These controls do not try to spot the attack. They limit what a tricked assistant can reach and do. Microsoft's guidance starts from “Assume indirect prompt injection will happen”. OWASP says critical controls such as authorisation checks “must not be delegated to the LLM”.

  • Give the assistant only the tools and rights its task needs, within the signed-in user's own permissions. OWASP's entry on excessive agency describes a mail summariser that “may only require the ability to read emails”.
  • Keep untrusted content apart from instructions. Where the task allows, plan every tool call before any untrusted text is read. This is the “plan-then-execute” pattern, one of six in a paper by researchers from several companies and research institutes, Microsoft among them. An injection then “cannot force the LLM into executing a tool that is not part of the defined plan.” It can still change what the planned calls send, such as the text of an email.
  • Let data go only to listed places: approved email domains, approved web addresses (URLs), and images or links from your own domains. Google says Gemini's output filter “identifies external image URLs and will not render them”.
  • Have a person approve anything that sends, pays, deletes or changes records, after seeing the real recipient and content. Microsoft says that in Copilot in Outlook “the user must explicitly approve the generated text and send the email themselves.” Meta warns about “a user blindly confirming a warning interstitial”.
  • Keep secrets and access rules out of the system prompt, which OWASP says “should not be considered a secret, nor should it be used as a security control”.
  • Log the “full input and output of the LLM, as well as tool use”, as the NCSC suggests. Cap how many actions the assistant can take per hour or per day.

These controls have a price. CaMeL is a design from researchers at Google and ETH Zurich that separates the user's request from untrusted data. It completed 77% of tasks in the AgentDojo agent tests “with provable security”, against 84% for an undefended system.

When does each line of defence fit, and why combine them?

  • Your provider's safeguards fit as the first layer when the assistant runs on one cloud or model provider. They cost little per check and need no new contract.
  • A guardrail product or framework fits several models or clouds, or a security team that wants one policy and one log. Open-source tools can also screen text on your own servers.
  • Your own controls belong in every deployment. When the assistant meets all three of Meta's conditions, no classifier lowers the risk enough without them.

Microsoft's own guidance says “No single solution is sufficient” and pairs detection with deterministic controls, which always behave the same way. The NCSC adds: “If the system's security cannot tolerate the remaining risk, it may not be a good use case for LLMs.”

At the list prices above, checking one million texts of 1,000 characters each costs about $375 on Azure's standard tier. On Bedrock it costs $150 with the content filters or $80 with the separate prompt attack check. Model Armor charges about $25 after the free allowance. The checks differ, so treat these figures as rough guides. Microsoft warns that such checks “may occasionally block legitimate actions, impacting user experience.”

What should you test before launch?

OWASP advises testing while “treating the model as an untrusted user”. Test the whole assistant with your own content, tools and permissions:

  • Plant instructions in every input: chat, uploaded files, retrieved documents, inbound email, web pages and tool results. Include hidden text and every language your clients use.
  • Try encoded text, instructions split across files, and long documents with the instructions far from the start.
  • Plant a test secret and try to get it out through image links, clickable links, outbound email, web requests and shared systems.
  • Sign in as one client and try to read another client's data.
  • Measure false positives, harmless messages flagged as attacks, on real traffic. Google suggests starting Model Armor in “Inspect only” mode, which logs without blocking.

Open-source scanners automate part of this. NVIDIA's garak probes for “data leakage, prompt injection” and other failures. Microsoft's PyRIT combines “automated scans, adaptive multi-turn attacks, and human-led testing.” Promptfoo says it “is now part of OpenAI” and stays open source. It runs red-team tests, or simulated attacks, from the command line. Repeat the tests after every change of model, prompt or tool.

What happens if the assistant leaks personal data?

Under the EU's General Data Protection Regulation (GDPR), a leak through the assistant can be a personal data breach. Article 4 of the original text defines one as “a breach of security leading to the accidental or unlawful destruction, loss, alteration, unauthorised disclosure of, or access to, personal data”. Article 33 requires the controller to notify the supervisory authority “without undue delay and, where feasible, not later than 72 hours after having become aware of it”. The exception is a breach that is unlikely to result in a risk to people's rights and freedoms. Your logs show what left and when.

What should you ask a vendor or a development firm?

  • Which inputs does your check read: user messages, documents, email, tool results? Which checks are off by default?
  • Does the check block, or must our code act on its verdict? What happens when it is down?
  • On which attacks, languages and traffic were your detection and false positive figures measured? Will you test on our content?
  • Where is our text screened, what do you store, and for how long?
  • How much delay does each check add?
  • Which tools can the assistant call, with whose permissions, and where can it send data?
  • Which actions need approval, and what does the approver see?
  • If you build it for us, who owns the code, tests and logs, and which parts are your reusable components?

Where does amBrain fit?

amBrain publishes this blog. On its own product, it says: “Our own product, aigo, runs on AI agents that research, write, check and measure from one shared memory of company facts. A person approves everything that goes out.” On client work with a language model, it says: “We have taken an LLM integration to production inside a client's FinTech perimeter: extracting and normalising unstructured broker and venue notices — corporate actions, instrument and margin changes — into structured records the trading system consumes.”

In its own words: “amBrain has been building software since 2019.” On how it works with clients, it says: “Three formats: full delivery, a dedicated team, or engineers embedded in your team.” Its line on ownership is “The client keeps full ownership of the product and the code, except our reusable components.” Ask for the list of those components by name before you sign.

None of the amBrain lines quoted here is about prompt-injection defence, and none says that amBrain builds guardrails or agents for clients or reviews their security.

This article is not a case study and describes no client work beyond the FinTech line quoted above, which says nothing about how that project was secured. The other quotations come from published pages of the organisations, companies and projects named above, research papers on arXiv, the US National Vulnerability Database and legislation.gov.uk, read on 13 November 2026. The article claims no relationship between amBrain and any of them, recommends none of their products and gives no amBrain prices or timelines.

It is not legal advice either. Ask a lawyer how data protection law applies to your assistant and what your breach plan must cover. If amBrain is on your shortlist, ask it the same questions as any other firm.

Topics

  • Prompt Injection
  • AI Security
  • Guardrails
  • Build or Buy

Putting a language model into production?

Send the design or the problem you are solving, and the numbers you already have.

Tell us about your project

We'll respond within 24 hours with a clear action plan.

Have a design like this on the table?

We'll respond within 24 hours with a clear action plan.

Free project intro call · 30 minutes