← AI Agents & RAG learning path
AI Agents & RAG · Module 9 of 10

Safety and security

Protect agents and RAG apps from misuse.

📖 Key ideas

  1. Prompt injection: instructions hidden in documents or web pages.
  2. Treat retrieved content as data, not instructions.
  3. Limit tool permissions and require approval for risky actions.
  4. Protect private data: access control per user in retrieval.
  5. 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