Gapless

Security

The threat model for an enterprise AI assistant, what is new compared with traditional applications, and the layered controls that protect data and actions.

An AI assistant combines three things that are each risky on their own: broad read access to company data, the ability to take actions in other systems, and a component (the model) that follows instructions written in plain language, including instructions hidden in the data it reads. Security for this system is about making sure no single failure, especially a model being fooled, leads to a data leak or an unauthorized action.

What is new

Traditional web application security still applies: authentication, injection, access control, secrets, dependencies. On top of that, AI systems add:

New riskWhy it is different
Prompt injectionUntrusted text (documents, emails, web pages, user input) can change the model's behavior. There is no reliable way to escape it, unlike SQL injection
Over-broad retrievalA search index copies data from many systems. If permissions are not copied correctly, the assistant becomes a way around them
Model as a confused deputyThe model acts with the user's permissions, but can be manipulated into using them for an attacker's goals
Output as an attack vectorModel output rendered in a browser can exfiltrate data through images and links
Data in new placesPrompts and outputs land in traces, logs, caches, eval sets, and provider systems
Non-deterministic behaviorA defense that works 99 times may fail on the 100th phrasing

The OWASP Top 10 for LLM Applications is a useful checklist of these risks. This section covers how to defend against them in this architecture.

Threat model

Everything in the untrusted box can contain attacker-controlled text. That includes internal documents: any employee, contractor, or compromised account that can edit a wiki page can plant instructions for the assistant.

Actors

ActorGoalExample
Curious employeeSee data they are not entitled toAsking for salary data or another team's documents
Malicious insiderExfiltrate data, cause damagePlanting injection in a widely read page
External attacker with a footholdUse the assistant to move furtherSending an email with injected instructions to a user whose inbox the assistant reads
Other tenant (SaaS)Access another customer's dataProbing APIs, caches, shared resources
Attacker targeting costRun up your bill or deny serviceScripted expensive requests

Assets

  • Confidential documents and their permission boundaries.
  • Conversation content, which often contains sensitive data users pasted in.
  • Credentials for connected systems.
  • The ability to act in those systems.
  • Tenant isolation.
  • The budget.

Layered controls

No single control is enough. The design assumes the model will be fooled sometimes, and limits what a fooled model can do.

LayerControlStops
IdentitySSO, short sessions, SCIM deprovisioningStale and stolen accounts
Data accessPermission filtering inside retrieval, tenant isolationThe model ever seeing data the user cannot access
InputInjection classifiers, PII detectionSome attacks, early. Not reliable alone
PromptClear separation of instructions and data, injection-aware instructionsSome injection. Not reliable alone
ActionsRead vs write tools, human confirmation for writes, narrow scopes, delegated tokensA fooled model taking harmful actions
OutputSafe rendering, no external images, link checks, output filtersExfiltration and harmful content reaching users
LimitsRate limits, token budgets, agent step limitsAbuse and denial of wallet
DetectionAudit logs, anomaly alerts, red team canariesAttacks that get through, noticed quickly

The strongest controls are the ones that do not depend on the model behaving: data the model never receives, actions it cannot take without a human click, and output the browser will not execute.

Pages in this section

PageCovers
Access controlTenant isolation and document permissions end to end, and how to test them
Prompt injectionDirect and indirect injection, and the defenses that work
Data protectionEncryption, PII handling, secrets, and keeping sensitive data out of logs
Infrastructure securityNetwork design, provider security, supply chain, vulnerability management, and incident response

On this page