Listen from this lesson
Open the complete chapter audiobook at this lesson. You can move to any section from the player.
Roles help, but they do not enforce permissions
Many chat systems distinguish system, developer, user and tool messages with roles or other structure. Those markers matter; the input is not necessarily one unmarked format. Nevertheless, a model can mishandle instructions embedded in material it was meant to analyse.
Training can improve which instructions a model prioritises. It is not a substitute for independent access and action checks. Untrusted document text can try to redirect an assistant even when it is clearly labelled as content.
This is prompt injection. Defences include trained instruction priorities, input handling, monitoring and containment. Their effectiveness must be tested on the actual system; no prompt should be treated as an enforceable permission boundary.
Direct and indirect
Direct injection is an instruction entered through a user-facing input to redirect the system. Depending on its access, this can also endanger private data or actions; it is not necessarily just an annoyance.
Indirect injection puts hostile instructions in material the assistant processes on a user’s behalf, such as:
- A CV containing concealed instructions to recommend the candidate, if the extraction pipeline includes that text.
- A web page whose retrieved content includes hostile instructions.
- An email the assistant summarises.
- A calendar invitation, shared document, code repository or product review.
The attacker may influence material the assistant will read without being the authorised user. Their success depends on the pipeline, model behaviour, available data and permitted actions.
Why it gets worse when the model can act
A model that only writes text can be made to write something wrong. A model that can send emails, run code, open files, make purchases or call other services can be made to do something wrong.
Research has demonstrated indirect attacks against real and experimental LLM applications, including data-theft and tool-manipulation risks. The exact route matters. A demonstration against one configuration is not proof that every assistant or every email can exfiltrate data.
This is why the guidance for anyone connecting an assistant to their own accounts is conservative and worth following:
- Give it the narrowest access that lets it do the job. Read-only where possible.
- Require appropriate authorisation and checks before consequential actions, including sending, paying, deleting or sharing.
- Treat access to untrusted content and private data together as a risk that needs tested controls.
- Treat external text as untrusted input, rather than allowing it to grant permissions.
The everyday version: scams
Generated content can also assist scams. This is related to AI misuse, but a forged voice or fluent phishing message is not itself a prompt-injection attack.
Voice cloning. The FTC warned in 2023 that a short online audio sample could help a scammer imitate a loved one. Sample requirements and quality vary by system. A familiar-sounding voice alone does not authenticate an urgent request.
Verify through a trusted route. Pause an unexpected urgent request and contact the person using an independently known number or another established channel. A private family check can help, but it may be exposed or guessed. Do not treat a voice, caller ID or code word as a perfect guarantee.
Fluent text at scale. Bad grammar has never been a reliable authentication test. Language tools can help attackers produce polished messages, but polish does not establish legitimacy or prove that a message was generated.
Look for requests that need independent verification: unexpected contact, manufactured urgency, secrecy, unusual payment routes or unsolicited links. These are warning signs, not proof by themselves. Good grammar does not remove the need to check.
The sentence to remember
Treat external text as material to evaluate, not automatic authority. Use the product’s defined instruction roles, keep tool access narrow and check consequential actions through independent controls. Colleagues’ files and familiar websites can still contain untrusted instructions.
Check your understanding
Why can instructions embedded in a retrieved document remain a risk even when a chat system labels message roles?
Pick the one you would defend. Your answer stays private.
Your place and first choices stay on this browser. Classroom credit is recorded separately.
Stuck on something?Ask Meenal, your AI tutor