3.1.4 · Lesson 4 of 15
Defense-in-Depth Against Prompt Attacks
Guard against jailbreaks, prompt injections, and system prompt exfiltration with layered controls around instructions and inputs.
WHAT
Guard against jailbreaks, prompt injections, and system prompt exfiltration attempts.
HOW
- Enable Prompt Attack / Jailbreak Filters in Bedrock Guardrails.
- Separate system instructions from untrusted user inputs using Converse API system roles.
- Do not concatenate user strings into the system prompt.
System role (trusted instructions)
User role (untrusted input)
↓
Converse API + Guardrails Prompt Attack filterEXAM TRAP
Passing user inputs directly inside the system prompt via string concatenation weakens isolation and invites injection.
Key points
- Prompt Attack / Jailbreak filters
- Separate system instructions from user input
- Converse API system roles
- Avoid raw string concatenation
- Defense-in-depth layering
Exam focus
Separate system instructions from untrusted user inputs using structured message roles — never rely on string concatenation alone.