Prompt injection enters a business AI workflow whenever the model reads text that someone else controls, such as an email or uploaded document, and treats part of it as an instruction. The danger grows when the model can then send messages, update records or call tools in the workflow.
Key takeaways
- Prompt injection happens when text inside data an AI step reads is treated as an instruction.
- Emails, attachments, web pages, CRM fields and tool outputs are all routes into a workflow.
- A system prompt alone does not enforce security, so permissions and approvals must do that work.
- Irreversible actions such as payments and outbound messages need a human check or hard limits.
What is prompt injection in a business workflow?
Prompt injection is a failure mode in which text inside the data a model processes changes what the model does. In a business automation, the instructions should come from the builder, but the data often comes from customers, suppliers, public websites or other systems.
A typical automation has three parts: a system prompt written by the builder, a task such as classifying a request or drafting a reply, and the material the model must work on. Prompt injection occurs when that material contains language the model treats as a command. The model has no dependable way to separate a sentence that describes a task from one that asks it to do something else.
Direct and indirect injection
Direct injection comes from the person typing into the model, such as a user of a chatbot trying to override its rules. Indirect injection matters more for automation, because the attacker places text in a document, email or web page that the workflow later reads. The attacker may never interact with your system at all.
The OWASP project lists prompt injection as its first risk in its Top 10 for Large Language Model Applications, which makes it a sensible reference when you plan controls. OWASP Top 10 for Large Language Model Applications
Where does untrusted text enter an AI workflow?
Untrusted text enters through any input the workflow reads without a person checking it first. In most business automations the routes are inbound messages, uploaded documents, web content, database fields and the outputs of other tools.
Inbound emails and forms
Customer emails, contact forms and support tickets are written by people you do not control. A triage step that summarises or routes them reads attacker-controlled text by design. Any sentence in the body can be phrased as an instruction, so the message itself is the first entry point to check.
Documents and attachments
PDFs, Word files and spreadsheets can contain text people never see, such as white-on-white text, comments, tracked changes or metadata. Optical character recognition also extracts text from scanned images, so a human reviewer and the model may see different content. Extraction pipelines should be treated as untrusted input handling.
Web pages and scraped data
Research or price-monitoring agents that fetch web pages read whatever the page owner publishes. A page can contain instructions aimed at automated readers, so content from the open web should never carry the same authority as your own configuration.
CRM fields and stored records
Free-text fields filled in by prospects or suppliers may be read by an AI step months later. Trust does not reset when data moves into your database. A record that was safe to store can become an input that changes behaviour when a new workflow reads it. Integration projects, such as those covered by our system integration services, are a common place where such records start flowing into new steps.
Tool and API outputs
The output of another system is untrusted if that system passes along external text. An enrichment API returning company descriptions, or a ticketing tool exposing customer comments, extends the attack surface into your workflow without any new user interface.
Why can a language model act on text it was only meant to read?
A language model receives instructions and data as one sequence of text. Nothing in that input is marked as a command in a way the model is guaranteed to respect, so it can give weight to any imperative sentence it encounters.
The model produces output by predicting likely continuations of that sequence, shaped by training that makes it responsive to instructions. That training is what makes assistants useful, and it is also why an instruction hidden in a document can compete with the instruction the builder wrote. The behaviour is probabilistic, so the same input may succeed or fail on different runs.
Delimiters such as XML tags, role labels and warnings help the model distinguish content from instructions in ordinary cases. They are not a security boundary, because an attacker who knows the format can imitate it. Treat these measures as a way to reduce accidents, not as a guarantee.
Hypothetical examples of injected text in business automations
Here are two hypothetical scenarios:
- Scenario A, quote triage. A tool reads inbound quote requests, assigns a priority and drafts a reply. One email contains a line asking the assistant to mark it urgent and to include the full customer list in the reply. Where this fails: the drafting step can read the customer list and write to outbound mail without a human review.
- Scenario B, supplier invoices. An extraction step reads supplier PDFs and writes the supplier name, amount and bank account into the accounting system. One PDF has hidden text telling the model to replace the bank account on the record. Where this fails: the extraction writes bank-detail changes straight to the ledger.
In both cases the model does what it was built to do, which is read text and produce output. The failure lies in permissions and missing checkpoints, so the fixes below target those rather than the wording of the prompt.
Which controls reduce the risk, and where do they fail?
The strongest controls limit what the model is allowed to do, instead of relying on it to refuse harmful text. Separate reading from acting, restrict tools to what each step needs, and require approval for actions that cannot be undone.
A practical checklist
- List every step that reads external text, and every action that step can take.
- Give each step only the tools and fields it needs, with read and write rights scoped separately.
- Constrain model output to fixed fields and allowed values, and validate them in code before any write.
- Require a person to approve payments, bank-detail changes, bulk messages and deletions.
- Keep a log of every tool call and model output so incidents can be traced.
- Test with adversarial inputs in a staging environment that uses production permissions.
Comparing common controls
| Control | What it reduces | Where it fails |
|---|---|---|
| Phrase filtering on inputs | Obvious instruction strings | Rephrased or encoded text passes, and blocklists need constant upkeep |
| Fixed output schema | Free-form actions taken from text | A valid field value can still carry a wrong decision |
| Least-privilege tool access | Damage from a successful injection | Fails when a broad account is reused across steps |
| Human approval for high-impact actions | Irreversible payments and messages | Reviewers can rubber-stamp approvals when volume is high |
| Separate reading and acting steps | Mixing untrusted text with privileged context | Adds design effort, handoffs and latency |
| Logging and monitoring | Undetected misuse and slow investigation | Detects problems after the fact rather than preventing them |
No single row solves the problem. Phrase filtering is easy to add but weak alone, while least privilege and approval steps do most of the protective work. Combine them and review the combination each time a tool or data source changes.
Does GDPR or the EU AI Act apply to these workflows?
Often yes, if the workflow processes personal data or the system falls within the scope of the AI Act. Whether a specific system is covered depends on its facts, so the official texts are the place to start.
The GDPR requires appropriate technical and organisational measures for the security of personal data, which covers workflows where injected text could cause unauthorised disclosure. Read the regulation itself at Regulation (EU) 2016/679 (GDPR) on EUR-Lex.
The EU AI Act, Regulation (EU) 2024/1689, sets obligations that depend on the risk category of an AI system, and its high-risk requirements include robustness and cybersecurity. Its text is available at Regulation (EU) 2024/1689 on EUR-Lex.
This article is general information and not legal or tax advice.
Rui Codex provides technical implementation support for AI automation and does not give legal, tax or compliance advice. Teams that need technical measures for AI systems can read about our AI Act technical measures service and discuss the design with a qualified adviser.
How should a team start securing an existing automation?
Start with an inventory of every place the workflow reads external text, then remove any write permission the step does not need. This order reduces the damage from a successful injection before you attempt to detect one.
- Map each input source and classify it as internal, partner or public.
- Record every action the workflow can take, and mark those that are irreversible.
- Remove or scope tool access, then add validation between the model output and the system of record.
- Add approval steps for high-impact actions and test the whole path with adversarial inputs.
An inventory of this kind can surface steps that nobody reviewed after launch. A review of AI automation services can help scope the work, and connector permissions are often where broad access is granted, so they belong in the same review. Rui Codex is led by a founder with 200+ projects delivered and 12+ years of hands-on experience.
Frequently Asked Questions
Is prompt injection the same as a jailbreak?
Prompt injection is when text in the data an automation processes redirects the model's task, while a jailbreak is usually a user trying to bypass the model's own safety behaviour. In business workflows the attacker is often a third party who never touches the chat interface, and the target is the workflow's permissions. The controls differ, so you limit actions and data access rather than relying on the model to refuse.
Can a good system prompt stop prompt injection?
No single system prompt is a reliable security boundary. Instructions such as ignoring commands found in an email reduce accidental compliance but cannot guarantee it, because the model still reads the untrusted text as part of the same input. Use the system prompt to shape behaviour, and enforce critical limits in code, permissions and approval steps outside the model.
Which automations carry the highest risk?
The highest risk applies to workflows that read external text and can take an action with effects outside the system, such as sending email, changing payment details, deleting records or calling external APIs. A summariser that only displays its output carries less risk. Map each step by what it reads and what it can change, then prioritise steps where both are true.
Do I need to sanitise every input?
Sanitising helps with obvious artefacts such as hidden text, unusual encodings and oversized inputs, but it cannot identify every harmful sentence. Treat it as one layer among several. The more reliable approach is to minimise what the model sees, constrain its output to fixed fields and restrict what each step can do.
How do I test an automation for prompt injection?
Build a test set of realistic inputs that contain instructions aimed at the model, such as requests to change fields, reveal data or send messages. Run them against a staging copy with the same permissions as production, and record every tool call. Repeat the tests after each prompt or model change, because behaviour can shift.
Conclusion
Untrusted text reaches an AI workflow through the same channels a business already uses to receive information: email, documents, web content, records and tool outputs. Prompt wording helps, but durable protection comes from limiting what each step can read and do, validating outputs before they reach a system of record, and keeping people in the loop for actions that cannot be undone. Start by mapping the inputs and actions of one workflow, then extend the same review to the rest. To discuss an automation that already runs, request a project consultation or email info@ruicodex.com.
Sources
- Regulation (EU) 2016/679 (General Data Protection Regulation) - Publications Office of the European Union, EUR-Lex
- Regulation (EU) 2024/1689 (Artificial Intelligence Act) - Publications Office of the European Union, EUR-Lex
- OWASP Top 10 for Large Language Model Applications - OWASP Foundation