Safety for Prompt Engineerings
Safety covers the risks of deploying prompts in real products. Prompt injection hides instructions in user or document text to hijack the model, jailbreaks try to bypass rules, and models may leak data or produce harmful or false content. Defences combine input handling, least-privilege tools, output checks and human review.
Stage: Quality and Safety · Part of the Prompt Engineering roadmap · Last reviewed 19 November 2026
What to learn in Safety
- Explain direct and indirect prompt injection with an example of each
- Limit tool permissions so a hijacked model cannot do damage
- Filter or check outputs before showing them or acting on them
- Avoid placing secrets in prompts where they could be extracted
- Add human approval for high-impact actions
Safety interview questions
What is indirect prompt injection?
It is an attack where hostile instructions are hidden in content the model reads, such as a web page, email or PDF, rather than typed by the user. The model may obey them. Treat retrieved content as untrusted data and limit what actions it can trigger.
Can a system prompt alone stop jailbreaks?
No. Instructions in a system prompt reduce misuse but can be bypassed with clever input. Real protection layers several controls: input and output filters, limited tool access, monitoring, and server-side checks that do not depend on the model obeying.
Where Safety fits in the Prompt Engineering roadmap
Safety belongs to the Quality and Safety stage (intermediate level). Make it dependable.
Other units in this stage
Back to the full Prompt Engineering roadmap