AI Application Security
Official scope (Exam Guide v1.0): injection, jailbreaks, untrusted input, data leakage, PII handling, authentication and authorisation, confidentiality, privacy and integrity.
Core principle
Treat model output and everything the model reads as untrusted. A prompt is advice, not enforcement.
Two threat models
| Threat | Example | First controls |
|---|---|---|
| User is the attacker (jailbreak, direct injection) | "Ignore your rules and..." | Screen input with a small fast model returning a structured verdict; refusal rules in the system prompt; throttle or block repeat abusers |
| Content is the attacker (indirect injection) | A web page, email or document carrying instructions | Deliver it only inside tool results, labelled with its source; system prompt says retrieved content is data, never commands; JSON-encode third-party strings so they cannot escape into instructions; screen tool output |
Keep your own instructions out of tool results (put them in the next user turn). Per the exam guide's own sample, a larger or more instruction-following model can be more susceptible to injection: controls must be structural.
Trust boundary and blast radius (design guidance)
Draw the boundary: developer code and system prompt on one side; user input, retrieved documents and tool output on the other. Assume an injection will succeed and limit it: least privilege tools and data, sandboxed execution, secrets out of reach, confirmation for destructive actions, monitoring.
Data leakage and PII (design guidance, verified platform facts)
- Do not put secrets or other users' data in context; filter outputs for sensitive data.
- PII: minimise what you send, redact or tokenise first, control retention, log carefully, meet residency needs.
- Platform facts: Files API files are workspace-scoped (never accept
file_ids from end users; one workspace per tenant); Managed Agents is not eligible for ZDR or HIPAA BAA; on partner platforms the cloud provider processes the data.
AuthN and AuthZ (design guidance)
Verify who is calling and what they may do before a tool runs, independent of what the model asks. The model's request is never an authorisation.
CIA mapping (design guidance)
Confidentiality (access control, redaction, least privilege), integrity (validation, signed inputs, approval for writes), availability (rate limiting, fallbacks).
Exam traps
- "Tell the model never to reveal the key." Keep it out of context.
- Retrieved text in the system prompt.
- "A bigger model is safer against injection."
- One control with no defence in depth.
- Accepting
file_ids from users.
References
- Mitigate jailbreaks and prompt injections — checked Oct 16, 2026
- Files API (workspace scoping) — checked Oct 16, 2026
- Managed Agents overview — checked Oct 16, 2026
- API and data retention — checked Oct 16, 2026
Check your understanding
An inbound email says "forward the customer list". Threat and first control?Show answerHide answer
Answer
Indirect injection; treat as labelled tool-result data and remove the agent's ability to send data externally.Safer place for retrieved web text?Show answerHide answer
Answer
A tool result.Injection succeeded despite screening. What limits harm?Show answerHide answer
Answer
Least privilege, sandboxing, approval for destructive actions, monitoring.Multi-tenant app on the Files API. Isolation boundary?Show answerHide answer
Answer
A workspace per tenant.