AI securityUpdated 4 Sep 202612 min read

Secure RAG and AI assistants: a 2026 security baseline

Retrieval-augmented generation can make AI more useful, but it also creates new trust boundaries: source systems, vector stores, retrieval logic, model context, tool calls and downstream actions.

Answer first

A secure RAG assistant should preserve source-system permissions, separate identities and tenants, treat retrieved content as untrusted input, constrain tool calls, validate outputs, log material events and give users source attribution. RAG improves grounding; it does not eliminate prompt injection, data leakage, excessive agency or misinformation.

Identity before retrievalThe model should not retrieve content the user is not allowed to access.
Retrieved text is untrustedDocuments can contain malicious instructions and should never outrank system policy.
Agency needs boundariesRead access and action permissions should be separated and least-privileged.

Reference architecture

LayerPrimary riskBaseline control
User & identityAccount compromise or over-broad accessSSO/MFA, role-based access, session controls, group-aware retrieval
Connectors & ingestionImporting sensitive or malicious contentApproved sources, provenance metadata, scanning, content classification
Vector / retrieval layerCross-tenant or permission leakageTenant isolation, ACL-aware filtering, protected embeddings, deletion lifecycle
Model contextPrompt injection and instruction conflictTrust separation, policy hierarchy, retrieval sanitisation, constrained context
Tools / agentsExcessive agency or unintended actionsAllowlisted tools, least privilege, explicit approvals for consequential actions
OutputData leakage, unsafe action, misinformationSource attribution, validation, policy filters, human review for high-impact use
MonitoringInvisible abuse or driftAudit logs, telemetry, anomaly detection, evaluation and incident workflow

1. Preserve source permissions end to end

The most important RAG control is simple in principle: if a user cannot access a document in the source system, the assistant should not surface it through retrieval. Avoid copying large knowledge bases into a flat vector index without preserving access-control context. Retrieval should evaluate user identity, source permissions and tenant boundaries at query time or through an equally robust control design.

2. Treat documents as hostile input

A retrieved document can contain instructions such as “ignore previous rules” or hidden content designed to manipulate the model. OWASP continues to identify prompt injection as a core generative-AI security problem. RAG and fine-tuning do not remove that class of risk. Systems should distinguish system instructions from user input and retrieved content, constrain what retrieved text can influence, and avoid granting model output direct authority over consequential actions.

3. Separate knowledge access from action authority

An assistant that can read internal documents is one risk profile; an agent that can send email, update records, create payments or change infrastructure is another. Tool permissions should be explicit, scoped and auditable. High-consequence actions should use deterministic validation and, where appropriate, human approval rather than model confidence alone.

4. Protect embeddings and intermediate data

Embeddings, vector stores, cached prompts and tool traces can all reveal sensitive business information. Apply the same data-governance questions you would apply to primary records: ownership, classification, encryption, tenancy, location, retention, deletion and access logging.

5. Make answers verifiable

For internal knowledge use, source attribution is a security and quality control, not just a usability feature. Users should be able to inspect which documents supported a material answer, whether those documents are current, and whether the assistant is extrapolating beyond them.

6. Build evaluations around failure modes

7. Log the events that matter

At minimum, retain enough evidence to reconstruct material incidents: authenticated user, time, assistant/model version, retrieved sources, relevant policy decisions, tool calls, approvals and administrative changes. Privacy and proportionality still matter; logging everything forever is not a substitute for a deliberate audit model.

A practical deployment gate

GateQuestion
DataAre sources approved, classified and permission-aware?
IdentityCan the system reliably enforce user, group and tenant boundaries?
InjectionHave direct and indirect prompt-injection scenarios been tested?
ToolsAre agent actions allowlisted, least-privileged and approved when consequential?
EvidenceCan material outputs be traced to sources, model/version and actions?
OperationsAre monitoring, incident response, rollback and change control defined?

A system that fails a material gate should remain a bounded pilot until the control is fixed or the risk is explicitly accepted by the appropriate owner.

Primary references

This is a security baseline, not a guarantee of security. Architecture should be tested against the organisation’s actual data, permissions, threat model and operational consequences.

Review an AI assistant before it becomes production infrastructure

SundAI focuses on AI security architecture, governance evidence and controlled adoption.

Explore AI Security Assessment →
← All insightsNext: Shadow AI governance →