Skip to main content
🔐 Security Engineering

Enterprise AI Security: 7 Attack Vectors and How to Defend Against Them

Most enterprise AI teams treat prompt injection as the whole of security. In production there are seven distinct attack vectors, and each needs its own defensive layer. This article draws on the systems we build and run in regulated industries.

By Emil Slavin · 11 June 2026 · 13 min read

⚡
TL;DR

Enterprise AI security is more than prompt injection: it is seven attack vectors and six baseline controls around the model. The OWASP Top 10 for LLM Applications names the risks; this article shows how each one is closed in production: authorization in code, ACL at the RAG layer, a private network, masking before data reaches the provider, and an audit trail on every answer.

10
OWASP LLM risks
7
attack vectors
6
baseline controls
13 min
read time

1. Prompt Injection

The best-known attack vector. A malicious user puts instructions into the input that make the LLM ignore the system prompt, reveal its contents, leak sensitive data from the RAG context, or carry out unauthorized actions through function calling.

Defenses:

  • Input sanitization: detect known attack patterns before the input reaches the LLM.
  • Separation: system instructions sit in a separate API role, never concatenated with user input.
  • Output filtering: detect known leak patterns in the response before it goes back to the user.
  • Privilege minimization: the LLM never gets direct database access. Always through function calls with authorization.

2. Indirect Prompt Injection

The sneakier variant: the injection comes not from the user but from a document that RAG retrieved. An attacker plants instructions in a document that will be indexed later, and when someone asks a relevant question, the LLM reads the malicious instructions as part of its context.

Defenses:

  • Provenance tracking: every chunk in the RAG index knows its source and who uploaded it.
  • Trust levels: classify sources by trustworthiness. Recently uploaded external documents do not get full trust.
  • Sandboxed retrieval: when indexing external sources (websites, RSS), pass them through a small LLM that filters out malicious instructions before storage.

3. Training Data Poisoning

If you fine-tune a model, an attacker can inject examples that teach it malicious behavior, for example revealing a specific secret when it receives a trigger phrase.

Defenses:

  • Curated training data: only data that passed an authorized review.
  • Differential testing: after fine-tuning, test the model against the baseline on a set of prompts that should behave identically.
  • Do not expose fine-tuning APIs externally. Use a controlled environment.

4. Model Exfiltration

An attacker asks enough questions to reconstruct the model's weights or its training data. Mostly relevant for smaller models deployed on-prem.

Defenses:

  • Rate limiting per user, IP and API key.
  • Anomaly detection: spot query patterns that look like systematic probing.
  • Output rate limit: count not only requests but the tokens in the responses.

5. Supply Chain Attacks

LLM providers, Python libraries (LangChain, LlamaIndex) and embedding models are all supply chain. A compromise at one vendor can bring malicious behavior into your whole stack.

Defenses:

  • Pin versions: never "latest". A fixed version plus hash verification.
  • SBOM (Software Bill of Materials): a full record of every library and version.
  • LLM provider abstraction: a code layer between your code and the LLM provider, so you can switch providers quickly if one is compromised.

6. Side-Channel Attacks

An attacker can learn about other users' conversations from indirect signals: response timing, response length, retrieval latency.

Defenses:

  • Constant-time responses: hold every response to the same minimum time.
  • Padding: pad short responses to a uniform size.
  • Careful caching: a cache hit can reveal that someone else asked the same question.

7. Privacy Leakage via RAG

User A uploads a document with sensitive data. User B asks a question, and RAG returns A's document as context. The LLM combines the information and answers User B, in effect leaking A's data.

Defenses:

  • ACL at ingestion: every document gets an ACL that says who may see it.
  • RAG filter before the LLM: chunks are filtered by the current user's permissions before they reach the model.
  • Tenant isolation: in a multi-tenant architecture, a vector index per tenant, never shared.

What baseline controls does an enterprise LLM system need?

Six controls have to be in place before the seven vectors are worth discussing: encryption, access control, a private network, data loss prevention, an audit trail and regular testing. They will not stop a clever prompt, but they decide how far a successful attack can reach.

Encryption and secrets

Traffic is encrypted with TLS 1.3 and data at rest with AES-256, including the log of prompts and responses, the vector index and the backups, which are easy to forget. The frontend and the backend are separated: the browser never calls the model provider directly, and the provider's API key lives only on the server. A key in browser code is one of the most common faults in AI-generated code, and our security audit for AI-generated code starts there.

Access control and identity

Users sign in through the organization's identity provider (Microsoft Entra ID, formerly Azure AD, or another SSO) with multi-factor authentication (MFA), and permissions are granted by role (RBAC). The model and its tools act with the permissions of the user who asked, not through a service account that can see everything. Actions that cannot be undone, such as a payment, a deletion or a message to a customer, wait for a person's confirmation.

Private networking

The model is reached over a private network, not over the public internet: Azure OpenAI through a Private Endpoint inside a VNet, AWS Bedrock through PrivateLink, Google Vertex AI inside a VPC Service Controls perimeter. On top of that come firewall rules and an IP allowlist, so the AI service cannot be reached from outside at all.

Data loss prevention and masking

Personal and confidential data is detected and masked before the prompt leaves for the provider: ID numbers, card numbers, phone numbers, names of patients or clients. The response passes the same filter on the way back, together with the provider's content filters, so that the model does not return data the user is not allowed to see.

Audit trail

Every request is logged: who asked, which documents retrieval returned, what the model answered and which tools it called. In a regulated environment this log is the only way to explain why the system said what it said. The log itself holds sensitive data, so it gets the same encryption, the same access rules and the same retention period as the source data.

Testing: penetration, red teaming, load

Before release and after every significant change, the system is tested in three ways. A penetration test checks the application and its API. Red teaming attacks the model itself with sets of direct and indirect injections and jailbreak attempts. A load test shows how the rate limits behave under real traffic, because a flood of requests to a paid model hits the budget as well as availability.

Which model provider is safe for company data?

Under their commercial terms, the business APIs of the major providers do not use your prompts to train models by default, but they do receive the data, and some keep it for a limited time to monitor abuse. The risk is decided by the contract and the configuration, not by the brand, so we check five points:

  1. Is the data used for training, and does the contract say so?
  2. How long are prompts and responses retained, and is zero data retention available?
  3. In which region is the data processed and stored?
  4. Can the model be reached over a private network?
  5. Which independent audit reports does the provider publish (for example SOC 2 or ISO/IEC 27001)?
  • Azure OpenAI: you choose the region and the deployment type, and they determine where the data is processed. Access through Entra ID and RBAC, a Private Endpoint, logs in your own subscription. Microsoft states that prompts and completions are not passed to OpenAI and are not used to train models.
  • OpenAI API and ChatGPT Enterprise: business data is not used for training by default, and zero data retention can be requested for eligible API use.
  • AWS Bedrock: models from several vendors, Anthropic Claude among them, under the controls of your AWS account: IAM, PrivateLink, CloudTrail. AWS states that prompts and responses are not used for training and are not shared with the model providers.
  • Google Vertex AI (Gemini): IAM, VPC Service Controls and Sensitive Data Protection (formerly Cloud DLP) for masking. Google states that it does not use customer data to train its models without permission.
  • Anthropic Claude: directly through the Anthropic API, or through AWS Bedrock and Google Vertex AI, where the same cloud controls apply. Under the commercial terms, API data is not used for training by default.
  • An open model (Llama, Mistral) on your own servers: the data does not leave the organization, but updates, access and monitoring are your responsibility.

On request, we pass the provider's own audit reports (OpenAI Enterprise, Azure OpenAI, AWS Bedrock) on to the client.

Priority order by severity

If you are building AI security from scratch right now, the order to tackle it:

  1. Privacy Leakage: worst for reputation and compliance.
  2. Prompt Injection (direct and indirect): the most common.
  3. Supply Chain: easy to prevent, awful when it happens.
  4. Side-channels: matter only in high-security settings.
  5. Model Exfiltration: only if the model is your own IP.
  6. Training Data Poisoning: only if you fine-tune.

Regulation and data residency: Israel, the EU, Russia

Regulation changes little in the architecture; it changes where data may be stored and how each control is justified. In every jurisdiction the same three things come back: ACL at the RAG layer, an audit trail on every answer, and a documented route the data takes between countries.

Israel: the Privacy Protection Law and Amendment 13

The Privacy Protection Law and its Amendment 13 apply to any AI system that processes personal data: access on the least-privilege principle, logs, a defined retention and deletion policy and, for some organizations, a privacy protection officer. The law builds its requirements around database registration, purpose limitation and the duties of the database owner. What exactly changes for a system is set out on our page about Amendment 13.

The EU and the US: GDPR and HIPAA

GDPR requires a legal basis for processing, a data processing agreement (DPA) with the model provider as processor, and a lawful mechanism for transfers outside the EU, such as standard contractual clauses (SCC). There is no data localization requirement in the narrow sense, but the provider and the region are chosen with these transfers in mind. For health data in the US, HIPAA requires a business associate agreement (BAA) with the provider.

Russia: 152-FZ

152-FZ requires that the recording, systematization, accumulation and storage of personal data of Russian citizens, when it is collected, take place in databases located in Russia; cross-border transfer is allowed after notifying Roskomnadzor. In practice this means a provider hosted in Russia (YandexGPT, GigaChat) or an on-prem model, a RAG index with personal data in a Russian data center, query logs with personal data on a Russian server, and a lawyer's review before any cross-border transfer.

What to take away

  1. AI security is not just prompt injection. Seven vectors, different defensive layers.
  2. Infrastructure defenses (privilege minimization, separation, ACL) beat reactive defenses (output filtering).
  3. In any enterprise deployment, ACL at the RAG layer is mandatory. Without it, one leak of someone else's document is enough for a reputational incident.
  4. Supply chain is the quietest risk. SBOM and version pinning now, not later.
  5. Most leaks need no clever attack: a key in the browser, an index without ACL or a log without access rules is enough. Close the six baseline controls first.

Is an AI agent or an MCP connection already working with your systems? AI agent and MCP security audit. Was the code itself written with AI? Security audit for AI-generated code.

Frequently asked questions

How do you protect an LLM application from prompt injection?

No single filter stops prompt injection, so you limit what a successful injection can do. Keep system instructions in a separate role from user input, give the model only the tools and data the current user is allowed to use, check authorization in code on every tool call, require a person's confirmation for irreversible actions, filter the output, and test with sets of direct and indirect injections before release and after every change.

Can company data leak to the model provider?

The provider always receives the data you send it, so the question is what it does with it. Under their commercial terms, the business APIs of OpenAI, Azure OpenAI, AWS Bedrock, Google Vertex AI and Anthropic do not use it for training by default, but the retention period and the region of processing depend on the contract and the settings. Mask personal data before sending, choose the region, ask for zero data retention where it is available, and keep data that must not leave the organization on an open model on your own servers.

Can employees use ChatGPT with company data?

Only through a business plan and under a written policy. In personal accounts, conversations may be used to improve the models unless the user turns this off, while business plans such as ChatGPT Enterprise do not train on business data by default. A safer route is an internal assistant over the company's own documents, with SSO, permissions and a request log.

How do you stop a RAG system from showing a user documents they are not allowed to see?

Filter by permissions before the model sees anything. Every document gets an ACL when it is indexed, retrieval returns only the chunks the current user may read, and in a multi-tenant system each client has its own vector index. A filter on the model's answer is a second line, not a replacement: once a forbidden chunk is in the context, it can surface in the answer.

Is a model on our own servers safer than a cloud model?

Not automatically. A model on your own servers keeps the data inside, but updates, access control and monitoring become your job. A cloud model behind a Private Endpoint, with a contract that rules out training and limits retention, is often enough. The choice follows the classification of the data: what must not leave stays on your servers, the rest can go to the cloud.

What does an AI security audit check?

What the model and its tools can actually do, not only what they are meant to do: permissions, resistance to direct and indirect prompt injection, data leakage routes, secrets and keys, logs and the audit trail, dependencies, and the provider's terms. Agents and MCP connections have a separate audit of their own, and code written with AI is audited separately too.

Does Israel's privacy law apply to an AI system?

Yes, if the system processes personal data. The Privacy Protection Law and Amendment 13 require least-privilege access, logs, a defined retention and deletion policy and data security measures, and they apply to the vector index and the request log just as to any other copy of the data.

Related reading

What to read next

Need a security review of an AI system?

A 30-minute consultation. Tell us what the system does, which data it reaches and which model it uses. We will go over the architecture and show which of the seven vectors are open.