RAG and agents turn model output into application behavior.
Retrieval-augmented generation improves relevance, while agents let models take action. Both also introduce new trust boundaries that traditional application testing can miss.
Retrieval is an authorization problem
Documents should be filtered using the requesting user’s identity and permissions before they reach the model. Similarity search is not access control, and metadata filters must be tested for bypasses.
External content can become instructions
Retrieved pages, support tickets, documents, and emails may contain malicious instructions. Systems should treat retrieved content as untrusted data and restrict its ability to influence tools or system behavior.
Agents need deterministic boundaries
Models should not decide their own permissions. Tool access, parameters, approval requirements, transaction limits, and tenant boundaries must be enforced outside the model.
Memory changes the risk lifecycle
Conversation memory can preserve sensitive data, malicious instructions, or incorrect assumptions across sessions. Teams should define retention, isolation, deletion, and review controls.
Security review questions
- Can one user retrieve another user’s data?
- Can a document influence tool execution?
- Can the agent perform a high-impact action without approval?
- Can sensitive information persist in memory, logs, or traces?
- Can the application explain and audit why an action occurred?
