AI Chatbots and Assistants
Diagram of a hidden instruction in a document reaching an AI chatbot

By the LaunchLen Web Solutions Team · Kitchener, Ontario · Last updated: October 30, 2026

Prompt injection is when someone crafts text that makes an AI system ignore its intended instructions and follow new ones instead. For a business chatbot or agent, that can mean leaking information, taking the wrong action or saying something it shouldn’t.

This guide explains what prompt injection is, how direct and indirect attacks differ, why tools raise the stakes, and the layered defences that can reduce the risk. Nothing here removes the risk completely.

What prompt injection is

Large language models follow instructions in natural language. Your system prompt might say: answer only from approved content, never invent prices, and hand off payment questions to a person.

A prompt injection tries to override that. The attacker (or a document they control) adds text such as “ignore previous instructions and…” or hides a similar command where the model will read it.

OWASP lists prompt injection among the top risks for LLM applications. Like other software risks, it is managed with design choices and testing, not with a single setting.

Direct vs indirect injection

Direct prompt injection is when the user types the malicious instruction into the chat. A visitor might try to make the bot reveal its system prompt, ignore handoff rules or talk about topics it’s meant to refuse.

Indirect prompt injection is when the harmful instruction sits in content the model reads: a web page, email, PDF, support ticket or uploaded file. OWASP describes indirect injections as occurring when an LLM accepts input from external sources and that content alters the model’s behaviour in unintended ways.

Indirect attacks matter for RAG chatbots and agents that browse or open documents. The person chatting may not be the attacker; the poisoned content is.

Here’s an illustrative example: a staff assistant summarises incoming emails. One email contains a line telling the assistant to forward the last few messages to an outside address. Without checks, the model might treat that line as an instruction.

Diagram of a hidden instruction in a document reaching an AI chatbot
Original graphic by LaunchLen Web Solutions Inc.

Why agents with tools raise the stakes

A chatbot that only replies with text can still cause harm (wrong advice, brand damage, data revealed in the reply). An agent that can call tools can do more: look up records, send messages, update a CRM or create a booking.

Our guide to LLM function calling explains how a model requests a tool and your code decides whether to run it. OWASP’s guidance on excessive agency warns that too much functionality, too many permissions or too much autonomy can turn unexpected model output into damaging actions. Prompt injection is one way that unexpected output can appear.

If you’re exploring multi-step automation, our explainer on agentic AI workflows covers the same idea from a process angle.

Defences: least privilege, input handling, confirmations

No single defence is enough. Layers help:

  • Least privilege for tools. Offer only the tools the task needs. Prefer read-only lookups over write actions where possible.
  • Permissions outside the model. Check authorization in your own systems. Don’t rely on the model to decide who may see or change data.
  • Treat model output like untrusted input. Before a tool runs, validate IDs, amounts and destinations. OWASP’s output-handling guidance takes a zero-trust approach to model responses.
  • Human confirmation for high-impact actions. Payments, deletions, outbound messages and access changes can require a person to approve.
  • Separate instructions from data. Keep system rules distinct from user content and retrieved documents where the platform allows it. Still assume retrieved text can contain hostile instructions.
  • Limit what external content can trigger. If the bot summarises email or web pages, restrict which tools those summaries can invoke.

These steps can reduce risk. They do not make systems fully safe on their own.

Testing and monitoring

Build prompt-injection cases into testing before launch and after changes:

  • Direct attempts to override rules, reveal instructions or skip handoffs.
  • Indirect cases: documents and pages that contain hidden instructions.
  • Tool-use cases: injections that try to trigger a send, delete or export.

After launch, review conversations and tool logs on a routine you set. Look for odd tool calls, refused topics that were answered anyway and new attack patterns. Add those cases to the test set.

We do not state a fixed place where logs live; that depends on the services a project uses, and it can be reviewed with you before build.

FAQ

Is prompt injection the same as jailbreaking?

Related, but not identical. Jailbreaking usually means getting a model to break its own safety rules in a general chat. Prompt injection is broader: it includes steering a business app’s instructions, often through content the model reads, not only through the chat box.

Can RAG stop prompt injection?

No. RAG can reduce made-up answers by grounding replies in your content, but that same retrieved content can carry injected instructions. Treat retrieved text as untrusted for control decisions.

Will better models fix this?

Stronger models and filters can help, but OWASP still treats prompt injection as a core risk. Design, permissions, confirmations and testing remain necessary.

Let’s work together on your project

Building a chatbot or agent that needs to stay within clear limits? We’re LaunchLen Web Solutions Inc.

Based in Kitchener, serving Waterloo Region and businesses across Ontario.

Our AI Solutions page explains how a RAG chatbot works in plain English, and the safeguards a build can include. Before any build, we can agree the scope, deliverables and reporting with you. Book a free consultation to get started.

How We Build a Custom WordPress Theme, From Design to Launch

How We Report on SEO: What We Measure and Why

Leave a comment

Your email address will not be published. Required fields are marked *

DROP US A LINE

Connect with LaunchLen Web Solutions Inc.

Ready to take the first step towards unlocking opportunities, realizing goals, and embracing innovation? We're here and eager to connect.

To More Inquiry
+1 226 899 4813

Your Success Starts Here!