← AI Agents & RAG learning pathAI Agents & RAG · Module 9 of 10
Safety and security
Protect agents and RAG apps from misuse.
📖 Key ideas
- Prompt injection: instructions hidden in documents or web pages.
- Treat retrieved content as data, not instructions.
- Limit tool permissions and require approval for risky actions.
- Protect private data: access control per user in retrieval.
- Filter harmful inputs/outputs and log incidents.
💡 Real-life example: Securing an agent is giving a new employee building access only to the rooms they need.
Prompt injectionMalicious instructions in input
Least privilegeMinimum permissions needed
Data leakageExposing private information
GuardrailCheck that blocks unsafe behaviour