AI Security Cheat Sheet for Engineers
A practical guide to securing LLM apps, RAG systems, agents and AI-powered cloud workflows.
AI security threat model
Traditional application security is still required, but AI systems add new attack paths. The model can be manipulated by malicious prompts, poisoned retrieval content, unsafe tool calls, weak authorization and accidental data exposure. Security teams must protect the model, the data, the tools and the user workflow.
Prompt injection and indirect prompt injection
Prompt injection happens when a user or external content attempts to override the intended system behavior. Indirect prompt injection is especially dangerous because the malicious instruction may come from a webpage, document, email or ticket that the AI system reads during a workflow.
RAG security risks
Retrieval augmented generation improves domain accuracy, but it can leak sensitive information if document permissions are ignored. It can also produce bad answers if the knowledge base contains stale, poisoned or low-quality content.
- Enforce document-level access control before retrieval.
- Use metadata filters for department, role and sensitivity.
- Log source documents used in each answer.
- Clean and review indexed content regularly.
- Use citations so users can verify the answer.
Agent tool abuse
Agentic systems can call APIs, create tickets, run scripts and modify resources. That creates a major security boundary. A chatbot that only answers questions has limited blast radius. An agent that can deploy infrastructure or send emails needs strict policy controls.
Risky permissions
Broad cloud admin access, unrestricted shell execution, open email sending and direct database writes increase impact.
Safer design
Use least privilege tools, approval gates, dry-run mode, audit logs, rate limits and rollback plans.
AI security controls checklist
- Use separate system prompts, developer instructions and user content.
- Classify and redact sensitive data before sending content to models.
- Apply least privilege to tools and APIs.
- Require confirmation for external actions and production changes.
- Evaluate model responses using adversarial test cases.
- Monitor for data exfiltration, abnormal tool calls and repeated policy violations.
- Maintain an incident response runbook specifically for AI failures.
Download the AI Security Cheat Sheet
Use this as a quick reference for LLM app reviews, architecture discussions and technical video learning.
Download Free PDF