How to protect an internal AI assistant from prompt injection
You protect an internal AI assistant from prompt injection in layers: limit what the assistant can reach, keep its instructions apart from the content it reads, check what goes in and what comes out, put a person in front of high-impact actions, and log everything. No single filter stops every injected instruction, so the goal is that a steered assistant still cannot do much harm.
Internal assistants are exposed because they read content written by people outside the company: emails, shared documents, support tickets, web pages and code. Any of these can carry an instruction the assistant may follow. OWASP lists prompt injection as the first risk for LLM applications.
How injection reaches an internal assistant
Direct injection is a user typing instructions to make the assistant misbehave. For an internal tool the bigger risk is indirect injection, where the instruction hides in content the assistant reads for someone else.
- Documents and wikis. A shared file contains text telling the assistant to ignore its rules or to include a link in every answer.
- Email and tickets. A message from outside asks the assistant, when summarising, to forward the thread or reveal earlier messages.
- Search results and web pages. A page the assistant retrieves carries hidden text aimed at the model.
- Tool output. A response from another system includes instructions the assistant then acts on.
The damage depends on what the assistant can reach. An assistant that can only answer in a chat window can leak what it can see. One that can send email, change records or call other tools can act for the attacker.
The layered defences
- Limit what it can reach. Give the assistant only the data and tools its job needs, under its own identity, and read-only where it only reads. Results should respect the reader's own permissions, so the assistant never shows a user a document they could not open themselves.
- Keep instructions apart from content. Put system instructions in their own channel, mark retrieved content clearly as data, and never let retrieved text change the assistant's access or rules.
- Check what goes in and what comes out. Screen retrieved content for instruction-like text, and screen answers for secrets, personal data and links to unknown sites before they reach the user.
- Put a person in front of high-impact actions. Sending messages outside the company, changing records, payments and deletions need a person to approve them.
- Log every call. Record the request, what was retrieved, the tool calls and the answer, so you can find out what happened after a report.
- Test before every release. Keep a set of injected instructions hidden in documents, emails and tickets, and run it whenever the model, the prompts or the tools change.
What not to rely on
Telling the model in its instructions to ignore injected text helps, and it fails under a determined attacker. Treat it as one layer. The same goes for any single filter: injected text can be rephrased, translated or split across documents. The layers that hold are the ones outside the model: access limits, approvals and logs.
How Aribot helps
Aribot threat models the assistant from its architecture diagram, including its data sources and tools, and adds the AI threats from OWASP, MITRE ATLAS and MAESTRO with the security requirement for each. When the assistant acts through tools, agent governance sizes its access to its task, checks every call over MCP, the API or the app, runs in watch only before blocking, can stop it on its next call, and keeps a tamper-evident audit record.
| Check | Done when |
|---|---|
| Access | The assistant has its own identity and only the data and tools its job needs |
| Permissions | Answers only include documents the asking user can open |
| Separation | System instructions and retrieved content travel separately |
| Screening | Inputs and outputs are checked before use |
| Approval | High-impact actions wait for a person |
| Logging | Every call is recorded where the assistant cannot change it |
| Testing | An injection test set runs before every release |
Questions people ask
- Can prompt injection be fully prevented?
- No method stops every injected instruction today. Layered defences keep the harm small when one gets through: limited access, approvals for high-impact actions and a full log.
- Is an internal assistant safer than a public one?
- It faces fewer direct attackers, and it usually reads more sensitive data and more outside content, such as email and shared files. Treat it with the same care.
- What is the first thing to fix?
- Access. Check what data and tools the assistant can reach today and cut everything its job does not need.
- How do I test for prompt injection?
- Hide instructions in the kinds of content the assistant reads, such as documents, emails and tickets, and check that it does not follow them. Run the same set before every release.
- Where do these defences come from?
- From the AI security pairs added in 2026 to Ayurak's Threat Modeling Framework, which pair each AI threat with the requirement that answers it, and from the OWASP Top 10 for LLM Applications.