Managed AI Services

LLM Security Best Practices: The Risks and Controls Enterprise AI Needs

November 30, 202615 min read
Secure AI Data Center Defense

LLM security best practices split the work between your model provider and your own team. Providers handle jailbreak resistance, encryption, and infrastructure, while you own access control, data classification, output filtering, and monitoring. Most leaks happen where nobody owns the control.

Most enterprise LLM incidents begin quietly, with no attacker involved. A finance analyst asks the company’s new internal generative AI assistant for last quarter’s vendor spend. The answer is quick and accurate, yet it also quotes salary figures from a spreadsheet someone shared company-wide years ago.

No system was breached, and the model did exactly what its permissions allowed. Gaps like this are widespread, because ISACA’s 2026 AI Pulse Poll found that 90% of respondents believe employees use AI at work. Meanwhile, only 38% of organizations have a formal AI policy in place.

The hard part is that responsibility is split. Your provider secures some layers, and your team inherits the rest, often without a clear handoff. The LLM security best practices below sort each major risk by who owns the fix, so effort lands where provider protection stops.

What Are the Biggest LLM Security Risks?

What Are the Biggest LLM Security Risks?

The biggest LLM security risks are prompt injection, sensitive data leakage, excessive access, unsafe outputs, supply chain weaknesses, and weak monitoring. Each one sits on a different side of the provider line, which is why no single vendor checkbox covers them all.

Two terms frame everything that follows. Provider-native safeguards are the protections a model vendor builds in, such as safety training, abuse monitoring, encryption, and data-retention terms. Enterprise-owned controls are everything you configure around the model, including permissions, data classification, output filtering, and logging.

RiskOWASP 2026Provider-native safeguardsEnterprise-owned controlsWho carries more
Prompt injectionLLM01Trained resistance, injection classifiersContent isolation, least privilegeToss-up, heavily shared
Sensitive data leakageLLM02No training on business dataClassification, redaction, retentionYour team
Access control and agencyLLM03Workspace roles and SSOPer-user retrieval, scoped toolsYour team
Output filtering and harmful contentLLM10Safety training, content classifiersSchema checks, encoding, business rulesProvider, for harmful content
Vendor risk and supply chainLLM04Audited infrastructure, model integrityVendor review, version pinningProvider, for hosted models
Monitoring and red teamingLLM06Abuse detection on its platformApp logs, alerts, scheduled testingYour team

What Is the OWASP Top 10 for LLMs?

The OWASP LLM Top 10 is a community-ranked list of the ten most critical risks in applications built on large language models. Its 2026 edition, published August 4, moved excessive agency up to third place. It also broadened system prompt leakage into a new entry called hidden context exposure.

IDRiskWhere this guide covers it
LLM01Prompt InjectionPrompt injection prevention
LLM02Sensitive Information DisclosureData leakage
LLM03Excessive AgencyAccess control
LLM04Supply ChainVendor risk
LLM05Data and Model PoisoningVendor risk
LLM06Unbounded ConsumptionMonitoring
LLM07MisinformationOutput filtering
LLM08Hidden Context ExposurePrompt injection
LLM09Vector and Embedding WeaknessesData leakage
LLM10Improper Output HandlingOutput filtering

Treat the OWASP LLM Top 10 as a shared vocabulary for engineers, auditors, and vendors, then map your LLM security best practices to it. Once a model gains tools and memory, OWASP routes those risks to a separate agentic list. Our guide to agentic AI security controls before launch maps that list in detail.

How Do You Prevent Prompt Injection?

Prompt injection prevention starts by accepting that no filter stops every attack. OpenAI said in December 2025 that prompt injection is unlikely to ever be fully solved, much like online scams. That makes containment the realistic goal, and it is why LLM security best practices treat this risk as shared work between provider and customer.

How Do You Prevent Prompt Injection?

How Prompt Injection Shows Up in Enterprise Apps

Direct injection happens when a user types instructions that override the system prompt. The indirect form is harder to spot because the payload hides inside content the model reads during normal work. A support ticket can carry a buried line asking the assistant to paste the full customer record into its reply. Likewise, a shared slide deck can tell a summarizer to insert a phishing link.

What Model Providers Already Handle

Major providers now ship injection defenses as managed generative AI security features. Microsoft’s Prompt Shields, for instance, include Spotlighting, a technique that marks untrusted text so the model treats it as data. In Microsoft’s research, Spotlighting cut indirect injection success from over 50% to below 2% on GPT-family models. Those gains are real, although they depend on your app routing retrieved content correctly.

Controls Your Team Has to Own

Your architecture decides the blast radius once an attack slips through. Keep secrets and business rules out of system prompts, tag retrieved text as untrusted, and grant only the tools each task needs. Then enforce permissions in code, so a hijacked reply cannot widen its own access. A basic allowlist check looks like this.

ALLOWED_TOOLS = {"lookup_order", "create_ticket"}

if call.tool not in ALLOWED_TOOLS:
    raise PermissionError(f"Blocked tool call: {call.tool}")

For deeper input and output checks, our guide to AI guardrails for LLM apps in production covers classifiers, redaction, and latency tradeoffs.

How Do You Stop Sensitive Data Leaking Through an LLM?

You stop sensitive data leaking through an LLM by classifying it first, then limiting what each request may retrieve, return, and store. AI data leakage is usually an everyday habit rather than an exotic exploit. Harmonic Security’s analysis of a million prompts found that 4.37% of prompts and 22% of uploaded files contained sensitive information.

Where Leaks Actually Happen

Leaks travel through four routes, and only one usually involves an attacker. Employees paste contracts or source code into personal chatbot accounts. Retrieval then pulls documents the asker was never cleared to see, while outputs repeat account numbers verbatim. Debug logs, meanwhile, can store full prompts for months, turning a logging setting into an AI data-leakage route. A sales engineer pasting a client’s network diagram into a free chatbot is a typical case.

What Enterprise Provider Plans Commit To

Enterprise plans settle the training question for most buyers. OpenAI, for example, states in its enterprise privacy commitments that it does not train on business data by default. Eligible API customers can also choose zero data retention, and comparable terms exist at other major providers. Even so, those commitments govern the vendor’s servers, not your file permissions or employees’ free accounts.

Data Classification and Redaction Your Team Owns

Data classification is the control providers cannot run for you, because only your team knows what counts as restricted. Label content before indexing, block restricted labels from AI pipelines, and mask identifiers the task does not need. Among LLM security best practices, this one pays off well beyond AI, since the same labels drive DLP and retention rules.

ai_access_policy:
  public: allow
  internal: allow_with_logging
  confidential: redact_pii
  restricted: block

Permission-aware enterprise RAG pipelines then carry those labels into every search, so retrieval respects them automatically.

Why Does Access Control Decide How Much an LLM Can Leak?

Access control sets the ceiling on any LLM incident, because a model can expose only what its identity can reach. Varonis analyzed 1,000 real IT environments and found that 99% of organizations had sensitive data exposed to AI tools. Much of that exposure traces back to broad sharing and stale accounts, which places this risk firmly on the enterprise side.

Why Does Access Control Decide How Much an LLM Can Leak?

How Over-Permissioned Assistants Expose Data

Many copilots inherit a service account or user token with far more reach than any single task requires. When an assistant runs on a shared super-user account, every employee effectively queries with admin rights. Agents raise the stakes further, since an assistant that can send email or update records turns a bad answer into a bad action. A retrieval bot that can also delete CRM records is the textbook example.

What Providers Offer for Identity

Enterprise plans typically include SAML single sign-on, SCIM provisioning, and role-based workspace permissions. These features control who can open the assistant, which simplifies offboarding and audits. However, they stop at the vendor’s boundary. They cannot decide which of your SharePoint folders a given analyst may summarize, because that permission lives inside your own systems.

Least Privilege Controls Your Team Builds

One of the most effective LLM security best practices is running retrieval with the asking user’s permissions, never a shared account. Recheck that access at query time as well. For agents, issue short-lived tokens scoped to one task, and require human approval for payments, deletions, and access changes.

results = index.search(query, filter={“allowed_groups”: user.groups})

Agentic AI workflows need this discipline most, because each new tool widens what a hijacked agent can reach.

Not sure which of these controls your team owns today?

Pinnasys maps your LLM stack against the OWASP 2026 risks, then builds the access, filtering, and monitoring layers that providers leave to you.

How Should You Filter LLM Outputs and Harmful Content?

Output risk has two halves, and they split cleanly between provider and customer. Harmful content is where providers lead, since they train and classify at a scale few enterprises can match. Anthropic’s Constitutional Classifiers, for instance, cut jailbreak success from 86% to 4.4% in its testing. Improper output handling, by contrast, belongs entirely to your application.

Where Provider Safety Training Earns Its Keep

Safety training and content classifiers handle broad harms, such as violent, sexual, or dangerous instructions, across every customer at once. A procurement assistant asked for weapon schematics will usually refuse without any custom rule. Most providers also expose moderation endpoints you can call on your own traffic. For general harm categories, a homegrown classifier rarely beats what ships with the model.

Output Handling Your Application Must Enforce

Improper output handling means passing model text into a database, browser, or shell without validation. The Vanna.AI library showed the cost when CVE-2024-5565 let prompt injection turn generated chart code into remote code execution. Treat every output as untrusted input, validate it against a schema, and encode it before rendering. For customer-facing conversational AI, add output filtering for business rules, such as blocking unapproved discounts.

What Security Questions Should You Ask AI Vendors?

Vendor risk is the one area where providers usually carry more weight than you, at least for hosted models. A frontier provider’s infrastructure, model integrity, and audit program exceed what most mid-market teams could build alone. The picture changes with open-weight models pulled from public hubs. JFrog researchers found about 100 malicious models on Hugging Face, some able to execute code on load.

What a Mature Provider Already Covers

Top providers publish SOC 2 Type 2 reports, hold ISO/IEC 27001 certification, and commission independent red-team assessments. They also patch their serving infrastructure, sign data-processing addenda, and offer regional data residency. For a hosted API, that baseline usually beats an in-house GPU cluster on raw security. The catch is that you still need that evidence on file, because auditors will ask.

Supply Chain Checks Your Team Still Owns

Pin model versions, verify checksums, and prefer safetensors files over pickle files, which can run code when loaded. Keep a simple AI bill of materials listing every model, dataset, and plugin in production.

huggingface-cli download org/model –revision
sha256sum model.safetensors

Regulated teams can borrow vendor due diligence steps from our guide to building HIPAA-compliant AI safely.

Questions to Ask Every AI Vendor

A short, consistent questionnaire turns vendor risk into evidence you can compare across providers. Raised at procurement, LLM security best practices cost far less than a renegotiation after launch, so ask these before signing.

  • Do you train on our prompts, outputs, or files, and can we opt out in writing?
  • How long do you retain data, and is zero data retention available?
  • Where is data processed and stored, and which subprocessors touch it?
  • Which certifications cover the exact service and region we will use?
  • How quickly do you notify customers of a security incident?
  • Can we pin model versions and receive notice before behavior changes?

How Do Monitoring, Red Teaming, and Policies Keep Controls Working?

Controls drift the moment a model, prompt, or data source changes, so monitoring and testing decide whether old defenses still hold. Microsoft’s AI red team, which tested more than 100 generative AI products, found that human judgment remains essential alongside automated tools. Providers watch their own platforms for abuse, but only your logs reveal what happened inside your app. That is why LLM security best practices end with ongoing testing rather than a launch-day audit.

Alerts That Catch Problems Early

Log decision metadata, including user, model version, retrieved document IDs, filter verdicts, and token counts, while redacting raw personal data. Then alert on patterns, such as repeated refusals from one account, sudden token spikes, or retrieval of restricted labels. Those signals catch attacks and runaway costs alike. Our MLOps best practices guide covers the pipeline side of this monitoring work.

Red Teaming on a Schedule

Red teaming means attacking your own system before someone else does. Run automated probes in CI before each release, then add a human-led exercise every quarter or after any model swap. MITRE ATLAS catalogs real adversary techniques against AI systems, which helps teams plan realistic scenarios. Open-source tools keep the first pass inexpensive.

npx promptfoo@latest redteam setup
npx promptfoo@latest redteam run

Policies and CISO Ownership

Policies turn these controls into rules employees can follow, covering approved tools, data classes allowed in prompts, and escalation paths. The CISO should own the policy and incident runbook, while product teams own each app’s controls. The NIST AI Risk Management Framework gives that split a shared structure through its Govern, Map, Measure, and Manage functions. Teams writing these rules for the first time can adapt a practical AI governance framework instead of starting from scratch.

What Are LLM Security Best Practices for Your Stage?

The right mix depends on four questions about your own setup. How many employees use AI today, and through which accounts? Does any assistant read internal documents or call tools? Which regulations govern the data involved, such as HIPAA, GLBA, or GDPR? Finally, how soon must the first production use case ship? Your answers show how much secure LLM deployment work sits with your team.

Lean mostly on provider safeguards in these situations.

  • The use case is general drafting or summarizing with no access to internal systems.
  • Every employee uses an enterprise plan with SSO and no-training terms in writing.
  • Prompts stay at public or internal classification, with no regulated data involved.
  • You run hosted models only, with no open-weight downloads.

Invest in your own control layer in these situations.

  • An assistant retrieves from SharePoint, CRM, or ticketing data with mixed permissions.
  • Agents can send messages, update records, or trigger payments.
  • Health, card, or other regulated data may appear in prompts or outputs.
  • You self-host or fine-tune open-weight models inside your own cloud.
  • Auditors or financial services regulators expect logged evidence of each control.

Most enterprises land on a genuine hybrid, using provider defaults for model safety and infrastructure while building their own access, filtering, and logging layers. Deadlines matter too, since EU high-risk AI obligations now start in December 2027 for many systems.

The Bottom Line

LLM security is a shared job, and most failures happen in the gap between what the provider covers and what the enterprise assumes. Providers have become strong on jailbreak resistance, encryption, and infrastructure. The weak points sit closer to home, in loose permissions, unclassified data, unchecked outputs, and logs nobody reviews.

Real progress on LLM security best practices therefore starts with an honest map of who owns each control. Pinnasys helps teams build that map and the enterprise-owned layer behind it, no matter which models and providers they choose.

If you would rather not staff the ongoing work, our managed AI services keep monitoring, testing, and policies current after launch. This week, list every AI tool in use and the data each one can reach.

Key Takeaways from the Article

  • Prompt injection cannot be fully solved, so design systems that contain successful attacks.
  • Enterprise plans settle training and retention, yet internal permissions still drive most exposure.
  • Retrieval should run with each user’s own access rights, never a shared service account.
  • Providers outperform most teams on jailbreak resistance, while output handling stays the application’s job.
  • Controls drift after every model or prompt change, so red teaming has to recur.

Frequently Asked Questions on LLM Security Best Practices

How is LLM security different from traditional application security?

LLM security adds risks that classic tools miss, because instructions and data share one natural-language channel. OWASP first published a dedicated LLM list in 2023, and generative AI security now builds on, rather than replaces, standard AppSec controls.

Is a self-hosted LLM more secure than a model API?

Not automatically. A self-hosted model keeps prompts inside your network, but your team inherits patching, model integrity checks, and GPU access control. With more than a million public models on Hugging Face, supply chain review becomes a standing task.

Who should own LLM security, the CISO or the AI team?

Both, with clear lines. The CISO owns policies, risk acceptance, and incident response, while AI and product teams own each application’s controls. ISACA’s 2026 poll found that 25% of organizations still have no active AI policy.

How often should you red team an LLM application?

Run automated attack suites in CI before every release, and schedule human-led red teaming at least quarterly. Retest after any model, prompt, retrieval source, or tool change, since each one can reopen LLM security risks you had already closed.

Does the EU AI Act require LLM security controls?

For many systems, yes. General-purpose AI model obligations have applied since August 2, 2025, and high-risk obligations now begin in December 2027. Both require documented risk management, logging, and cybersecurity measures for any secure LLM deployment.