An AI assistant can read a supplier email, search a policy folder, and prepare a draft purchase request in seconds. That convenience also creates a decision boundary. Some of the text reaching the assistant describes the job. Other text merely belongs to a document. A prompt injection attack tries to blur that difference.
The danger is not a dramatic sentence on a chat screen. It is an assistant treating untrusted material as a new order. A supplier email, web page, shared file, or tool response might contain words designed to divert a model from its assigned task. The model may then produce an unsafe answer, expose information, or prepare an action outside the user’s request.
This prompt injection attacks explained guide uses a modest procurement assistant as its running example. The assistant may read approved supplier emails and draft a purchase request. It cannot send messages, place orders, or alter supplier records. A named employee must inspect and approve any consequential step. That boundary makes the risk easier to understand and reduce.
Recognise when text can change roles
Large language models work with natural language. They do not receive a perfect technical wall between an instruction and a sentence inside a document. A product team may tell an assistant to summarise a supplier email. The email can still include text that attempts to change the task. OWASP describes prompt injection as input that alters an LLM application’s intended behaviour or output. [1]
A direct injection arrives from the person using the assistant. A user may try to steer the tool away from its permitted role. An indirect injection arrives inside material the assistant reads. The procurement employee might ask for a summary of an email that looks ordinary. Hidden or visible text inside that email could ask the assistant to ignore the summary task and perform something unrelated.
The attack becomes more serious when the assistant has access to sensitive files or connected tools. Microsoft notes that untrusted content can come from webpages, email, shared documents, tool results, and other inputs. A successful attack can lead to unauthorised information exposure or an action that the user did not intend. [3]
A safe design labels the purpose of each context item. Put the employee’s task, application rules, retrieved documents, and tool responses in separate sections. The application must decide which section can affect a decision; the model should not make that choice from wording alone.
One practical method is to store extracted document facts in named fields. The assistant can cite the email line or record from which each field was drawn during review. A reviewer then sees the proposed value and its origin without allowing the document to define the outcome.
Know the two routes that matter most
Direct prompt injection is visible to the assistant user. It can involve a request that conflicts with the tool’s purpose or permission limits. A support bot that only explains account status should not be persuaded to reveal internal instructions or private records. The request itself is the untrusted source.
Indirect prompt injection is easier to overlook because the harmful text may sit inside content that appears useful. A public webpage can contain an instruction aimed at a browsing assistant. A document uploaded to a knowledge base can attempt to manipulate a retrieval assistant. An email analysed for invoices can carry text that tries to redirect the next step.
Neither route means that every unusual instruction is an attack. Teams should look at the system’s actual authority. A read-only assistant that only produces a draft has less potential impact than an agent that can send external messages or modify a database. NIST recommends tailoring risk management to the relevant system, its context, and the severity of possible harm. [2]
The procurement assistant should therefore use a narrow task statement. It may extract supplier name, amount, currency, and stated delivery date. It must label missing information as missing. It must not treat supplier correspondence as approval to create an order. This design prevents a document from silently defining a new business rule.
Place enforcement outside the conversation
A warning inside a model message may reduce some unwanted behaviour, but it cannot enforce a business rule by itself. Keep spending limits, recipient checks, and approval requirements in the surrounding application. Software controls should decide whether a proposed purchase can proceed.
Assign a job to each input. The employee request defines the work. The supplier email supplies details for extraction. The policy document sets permitted conditions. A tool result reports a lookup. This arrangement gives reviewers a visible basis for judging a proposed draft.
The procurement assistant can use a simple permission card. It may read selected mailboxes, create a local draft, and present a structured summary. It cannot send a purchase request, change a vendor bank account, or open a payment workflow. Those actions require an authorised person and a fresh confirmation.
Least privilege limits the damage if an attack succeeds. It also makes ordinary mistakes less costly. A model may misunderstand a document without gaining authority to send it to a supplier. Microsoft’s guidance stresses that permissions, data governance, and explicit consent can reduce the impact even when an injection evades earlier checks. [3]
Set checks around the data, the output, and the action
Input checks should look for unexpected task changes, requests for sensitive material, hidden text, unusual encodings, or content that does not fit the stated job. These checks are useful signals, not a final verdict. An attacker can vary language, and legitimate content may contain technical instructions. Handle each alert in a way that matches the possible business consequence.
Output checks should examine what the assistant plans to return. In the procurement example, the output should contain expected fields such as supplier, item, amount, source reference, and an uncertainty label. An output that includes unrelated internal data, a new recipient, or an unsupported instruction should be stopped for review.
Action checks matter most. Before any message is sent or record is changed, show the human reviewer the proposed action, the source material, the account being used, and the reason for the action. Confirmation should refer to the actual result, not a vague button labelled “continue”. A reviewer needs enough context to reject a misleading draft.
Keep evidence beside the draft
A trustworthy draft records where each important value came from. The employee can then compare the proposed amount with the supplier email and the applicable purchasing rule. If a document requests something unusual, preserve the request as untrusted text. Do not convert it into an instruction without a human decision.
This evidence record also supports later investigation. The team can see which content entered the assistant, which policy was active, which permissions existed, and whether a person approved an action. That information is more useful than a bare statement that an AI tool “made a mistake”.
Triage suspicious behaviour without widening the problem
A suspected injection does not require an immediate public explanation of every internal control. First contain the path. Stop the affected draft or tool call. Preserve the relevant input and output securely. Then decide whether the event was a harmless task conflict, a failed attempt to influence the model, or an incident that affected data or an external action.
The procurement team might discover that an email asked the assistant to contact a new address. The safe response is not to let the assistant debate the request. The system should mark the email as untrusted, keep the draft unsent, and show the discrepancy to the employee. A separate security owner can decide whether broader investigation is required.
Logging should be focused. Record source type, timestamp, task, policy version, detected signals, proposed action, and final human decision. Avoid logging confidential document content more widely than necessary. A security log should help people reconstruct an event without becoming a new store of sensitive material.
Reduce harm even when detection misses an attack
A screening service will miss some hostile wording. The workflow should therefore remain safe when a suspicious document reaches the model. Scoped access, confirmation, output checks, and audit evidence limit the damage that can follow a missed signal.
Keep high-impact operations in a later stage than document reading. The procurement assistant can prepare a summary or internal draft first. Sending a message, changing payment details, or publishing a request must pass through a review screen that shows the exact proposed change.
Use short-lived credentials and narrow scopes for connected tools. If an assistant only needs to retrieve one supplier record, it should not hold a broad token that can edit every vendor. Review access when the workflow changes. A harmless search feature can become a higher-risk system when it gains the ability to email, purchase, or update records.
Teams should test the boundary before expanding access. Use safe internal test documents that contain benign conflicting instructions. Confirm that the assistant labels the content as untrusted, retains its assigned task, and avoids prohibited actions. Repeat the test when a new connector, data source, or tool permission is added.
Match the control to the possible harm
A useful prompt-injection review begins with a practical inventory. List the information the assistant can read, the systems it can reach, and the actions it can propose. A supplier mailbox, a contract folder, a purchase-request queue, and a payment tool create different risks. The controls should reflect the consequences of each connection.
Consider a reading-only assistant that can see draft purchase requests. A misleading document could still cause confusion, but it cannot complete a transaction. Now consider an assistant that can submit a request to a supplier. The same misleading document could create reputational damage, an unwanted commitment, or a financial loss. That change in authority deserves stronger confirmation and tighter permissions.
Keep sensitive sources separate where possible. The assistant that reviews public supplier brochures does not need access to payment records. The assistant that drafts an internal summary does not need a public email tool. Small permission choices make the environment easier to test. They also give a reviewer a clear answer when asked what an assistant can and cannot do.
The review should name an owner for each boundary. Product staff can define the intended task. Security staff can assess sensitive data and connected tools. Operations staff can define the approval step. No one person needs to solve every issue alone, yet every high-impact action needs a person who accepts responsibility for the rule. NIST’s risk guidance supports tailoring controls to the system’s context and the seriousness of possible outcomes. [2]
Make the business decision visible
Prompt injection needs workflow controls, not a clever sentence. Decide which sources the assistant may read, what it can prepare, what information it can access, and which outcomes need a person to approve. Capture those decisions in a concise design note for product, security, and operations owners.
For a small team, the first version can remain deliberately limited. Use the assistant to organise information and prepare a draft. Do not grant it authority to send, buy, publish, or alter records. Expand only after the team can explain the safeguards, test them, and review the evidence from actual use.
