logo

Sensitive Data Leakage in AI Applications: Causes and Fixes

Summary

Sensitive data leakage in AI applications happens when an AI system exposes personal, financial, confidential or secret data to someone who should not see it. OWASP ranks it as LLM02, the second risk in its 2025 Top 10 for LLM applications.

Data can leak through six paths: user prompts, training data, RAG and vector stores, system prompts, agents and tools, and logs or third-party vendors.

Most leaks come from normal use and weak architecture, not advanced attacks. Real cases at Samsung, OpenAI, DeepSeek and Slack each map to a different path.

IBM found that 97% of organizations with an AI-related breach lacked proper AI access controls, and high shadow AI use added USD 670,000 to the average breach cost.

The fix is layered: classify and minimize data, redact at a gateway, enforce permissions at retrieval, keep secrets out of prompts, filter outputs, limit agent privileges and control logs.

Choose controls based on your architecture. A fine-tuned model needs different defenses from a RAG assistant or an AI agent.

Introduction

Employees and AI systems now handle sensitive data every day, and a lot of it leaks. Harmonic Security analyzed 22.4 million enterprise prompts and file uploads in 2025 and detected 579,113 instances of sensitive data, from source code to M&A plans. About 16.9% of those exposures went through personal AI accounts that IT could not see (Harmonic Security, 2026).

Breaches are already happening. In IBM's 2025 Cost of a Data Breach Report, 13% of organizations reported an attack that affected their AI models or applications, and 97% of those lacked proper AI access controls. A high level of shadow AI added an extra USD 670,000 to the global average breach cost (IBM, 2025).

In this guide, you will learn:

  • What sensitive data leakage in AI applications means and what data is at risk
  • The six paths through which AI systems leak data
  • Real incidents that show each path in action
  • The business and compliance impact of a leak
  • Layered prevention controls, with a code example
  • How to match controls to your AI architecture

As an AI & Blockchain Innovation Partner, SotaTek helps enterprises build LLM applications, RAG systems and AI agents with data redaction, permission-aware retrieval and security testing designed in from the start.

What Is Sensitive Data Leakage in AI Applications?

Sensitive data leakage in AI applications is the unintended exposure of protected information through an AI system's inputs, outputs, storage or connected tools. The person who receives the data may be an outside attacker, another user of the same app or a third-party vendor.

OWASP calls this risk LLM02: Sensitive Information Disclosure. It notes that LLMs embedded in applications can expose sensitive data, proprietary algorithms or confidential details through their output (OWASP, 2025).

sensitive data leakage in ai applications data types
Sensitive data leakage in AI applications data types

Data at risk usually falls into four groups:

  • Personal data (PII and PHI): names, emails, ID numbers, health records
  • Financial data: card details, account numbers, revenue forecasts, deal terms
  • Business secrets: source code, contracts, legal advice, product roadmaps
  • Credentials: API keys, database passwords, access tokens

AI leakage is different from a classic database breach in one key way. A database returns exactly the rows a query asks for. An LLM generates text from everything in its context and weights, so it can surface data that no one explicitly requested. That makes access control at the data layer, not the model layer, the main line of defense.

6 Paths of Sensitive Data Leakage in the AI Stack

sensitive data leakage in ai applications 6 leakage paths
Sensitive data leakage in AI applications: 06 leakage paths

Leaks happen at specific points in the AI stack. Map your system against these six paths before choosing controls.

Leakage pathHow data leaksPrimary control
1. User prompts and uploadsStaff paste confidential data into public or unapproved AI toolsApproved tools, gateway redaction, DLP
2. Training and fine-tuning dataThe model memorizes records and repeats them in answersClean and deduplicate data before training
3. RAG and vector storesRetrieval ignores document permissions; embeddings can be invertedPermission-aware retrieval, encrypted vectors
4. System promptsKeys, rules or internal logic in the prompt get extractedKeep secrets out of prompts
5. Agents and toolsPrompt injection makes an agent send data to an attackerLeast privilege, output and link controls
6. Logs, caches and vendorsChat logs, caches or provider storage expose historyRetention limits, encryption, vendor terms

A few paths need more detail.

Training data memorization is a proven risk. Researchers extracted hundreds of verbatim training examples from GPT-2 with black-box queries, including names, phone numbers and email addresses. Some extracted sequences appeared in only one document in the training set (Carlini et al., 2021). If you fine-tune on customer tickets or contracts, assume the model can repeat them.

Embeddings are not anonymous. Many teams treat vector databases as safe because they store numbers, not text. Researchers showed that an inversion method can recover 92% of 32-token inputs exactly from their embeddings, and it recovered full names from clinical notes (Morris et al., 2023). Protect your vector store like the source documents.

System prompts are not secret stores. OWASP's LLM07 entry says a system prompt should not be treated as a secret or used as a security control, and that credentials and permission rules belong in systems the model cannot access (OWASP, 2025).

Real Incidents of AI Data Leakage

sensitive data leakage in ai applications real incidents
Sensitive data leakage in AI applications: real incidents

Each path above has already caused real exposure. These four cases show how varied the root causes are.

IncidentYearLeakage pathWhat happenedLesson
Samsung source code2023User promptsEngineers uploaded internal source code to ChatGPT. Samsung then restricted generative AI on company devicesGive staff approved tools before banning public ones
ChatGPT Redis bug2023CachesA bug in the redis-py library showed some users other users' chat titles and exposed payment details of 1.2% of active Plus subscribers in a nine-hour windowShared caches and multi-tenant state need isolation tests
DeepSeek database2025LogsWiz found a public ClickHouse database with over a million log lines, including chat history and API keys, open without authenticationAI logs are high-value data and need the same controls as production databases
Slack AI2024Agents and RAGA message in a public channel could make Slack AI reveal data, such as API keys, from a private channel the attacker could not accessRetrieval plus prompt injection turns AI into an exfiltration tool

Sources: CSO Online, OpenAI, Wiz, PromptArmor.

Only the Slack case needed an active attacker. The other three came from normal use, a software bug and a misconfiguration. Most leakage risk sits in engineering and governance gaps, not in the model itself.

The Slack case also shows how leakage and prompt injection combine. If your app reads untrusted content, read SotaTek's guide on prompt injection prevention alongside this one.

Business Impact of Sensitive Data Leakage

sensitive data leakage in ai applications business impact
Sensitive data leakage in AI applications business impact

A leak through an AI application creates the same costs as any data breach, plus some that are specific to AI.

  • Breach cost: IBM puts the 2025 global average breach cost at USD 4.44 million. High shadow AI use added USD 670,000 to that figure (IBM, 2025).
  • Regulatory fines: In December 2024, Italy's data protection authority fined OpenAI EUR 15 million. It found ChatGPT processed personal data for training without an adequate legal basis, and that OpenAI did not notify it of the March 2023 breach (WSLS, 2024). Under GDPR, fines can reach EUR 20 million or 4% of global turnover.
  • Data you cannot take back: Once data is in a model's weights, you cannot delete one record. You may need to retrain the model, which costs time and compute.
  • Lost trust and slower adoption: After its leak, Samsung restricted generative AI tools on company devices. Bans like this slow down the productivity gains AI was meant to deliver.
  • Weak governance amplifies all of the above: 63% of organizations in IBM's study had no AI governance policies to manage AI or prevent shadow AI.

The pattern is clear. Leakage is cheaper to prevent at design time than to fix after data has spread into models, logs and vendor systems.

How to Prevent Sensitive Data Leakage in AI Applications

sensitive data leakage in ai applications 8 prevention layers
Sensitive data leakage in AI applications 8 prevention layers

No single tool covers all six paths. Use layered controls so that data missed by one layer is caught by the next.

1. Classify and minimize data before ingestion

Decide which data classes each AI use case may touch. Tag sources as public, internal, confidential or restricted. Exclude restricted data from training sets and indexes unless there is a clear business need. Deduplicate training data, since repeated records are easier for a model to memorize. Strong data foundations make this step easier, as covered in SotaTek's guide to AI-ready data architecture.

2. Redact sensitive data at an AI gateway

Route every model call through one gateway. Detect and mask PII and secrets before prompts leave your network, then log the masked version only. Open-source tools such as Microsoft Presidio combine pattern matching and named entity recognition for this job.

from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine

analyzer = AnalyzerEngine()
anonymizer = AnonymizerEngine()

def redact(prompt: str) -> str:
    findings = analyzer.analyze(
        text=prompt,
        entities=["PERSON", "EMAIL_ADDRESS", "PHONE_NUMBER", "CREDIT_CARD"],
        language="en",
    )
    return anonymizer.anonymize(text=prompt, analyzer_results=findings).text

safe_prompt = redact(user_prompt)  # send safe_prompt to the LLM

Detection accuracy depends on configuration and language. Test recall on your own data and add custom recognizers for internal IDs, project codes and key formats.

3. Enforce permissions at retrieval time

A RAG assistant should never retrieve a chunk the current user cannot open in the source system. Store access metadata (owner, group, classification) with each chunk and filter by the user's identity in the vector query, before ranking. Sync permissions when they change in the source system. Restrict who can add content to the index, and encrypt the vector store at rest. If you are still choosing between grounding methods, RAG vs fine-tuning compares their data exposure trade-offs.

4. Keep secrets and access logic out of prompts

Store API keys in a secrets manager and inject them only in the tool layer, never in the model context. Enforce authorization in code, not through instructions such as "do not reveal customer data." Assume users can read your full system prompt.

5. Filter outputs and control rendering

Scan model outputs for PII, secrets and restricted terms before they reach the user. Block markdown images and links to unknown domains, because attackers hide stolen data in URL parameters that the chat interface loads automatically. Return structured outputs where possible and validate them in code.

6. Limit what agents can access and send

Give each agent only the tools and data scopes its task needs. Run tool calls with the end user's permissions, not a shared service account. Require human approval before an agent emails external parties, exports files or calls new endpoints. SotaTek's AI agent development guide covers where these controls fit in the build process.

7. Control logs, retention and vendors

  • Mask data before logging and set short retention periods for prompts and responses.
  • Protect log stores with authentication, encryption and network restrictions.
  • Use enterprise API terms that exclude your data from model training, and confirm data residency.
  • Test multi-tenant isolation for caches, sessions and conversation history.

8. Govern shadow AI and test continuously

Publish a clear AI use policy, give staff approved tools and monitor traffic to unapproved AI services. Red team every release with extraction prompts, cross-user tests and injected documents. Plant canary values, such as fake customer records, in test data and alert if they ever appear in outputs or external traffic. SotaTek's AI red teaming guide explains how to run these tests.

Match Leakage Controls to Your AI Architecture

sensitive data leakage in ai applications controls by architecture
Sensitive data leakage in AI applications: controls by architecture

Different architectures leak data in different ways. Use this table to prioritize controls for your system.

AI architectureMain leakage riskMust-have controls
Chatbot on a third-party LLM APIPrompts and files sent to the vendor; logsGateway redaction, enterprise API terms, short log retention
Internal RAG assistantUsers retrieving documents above their access levelPermission-aware retrieval, index access control, output filtering
Fine-tuned or custom modelMemorized training records in answersData sanitization, deduplication, extraction testing before release
AI agent with toolsData sent out through tools after prompt injectionLeast privilege, human approval, egress allowlists, link blocking
Multi-tenant SaaS AI featureOne customer seeing another's dataTenant isolation in context, caches and vector namespaces

Most enterprise systems combine several rows. A support agent that uses RAG on a third-party API needs controls from three rows at once. Start with the row that carries the most sensitive data, then add the rest.

Conclusion

Sensitive data leakage in AI applications rarely comes from one dramatic hack. It comes from ordinary prompts, memorized training data, permission-blind retrieval, secrets in system prompts, overpowered agents and unprotected logs. Map your system against these six paths, apply controls at the layer where data enters or leaves, and test continuously. Teams that design for leakage from day one can use AI on sensitive data with confidence.

Planning an AI application that touches customer, financial or proprietary data? Talk to SotaTek's AI team to review your architecture and build data leakage controls that fit your use case.

It is the unintended exposure of personal, financial, confidential or secret data through an AI system's prompts, outputs, training data, storage or connected tools.

LLM02:2025 Sensitive Information Disclosure is the second risk in the OWASP Top 10 for LLM Applications. It covers LLM apps that expose sensitive data, proprietary algorithms or confidential details through their outputs.

Yes. Research on GPT-2 extracted verbatim training examples, including names, phone numbers and email addresses, using only normal queries. Data that appears in fine-tuning sets is at similar risk.

It depends on the plan and settings. Consumer accounts may retain prompts and use them for training. Enterprise plans and APIs usually offer contractual training exclusions, but you should still redact sensitive data and set retention limits.

Shadow AI is the use of AI tools that IT has not approved, often through personal accounts. It removes visibility and control over where company data goes.

No. Embedding inversion research recovered most short inputs exactly from their vectors. Treat a vector database with the same classification and access controls as the source documents.

An attacker hides instructions in content the AI reads. The model follows them and sends data out, for example through a tool call or a link with stolen data in its URL.

Usually only slightly. Most tasks, such as summarizing or drafting, do not need real names or numbers. Use reversible tokens when the final answer must show the original values to an authorized user.

Common options include Microsoft Presidio for PII detection, cloud DLP services, AI gateways with guardrail plugins and secret scanners for keys and tokens. Test their recall on your own data before relying on them.

Yes. If an AI app processes personal data of people in the EU, GDPR rules on legal basis, minimization, transparency and breach notification apply, as the EUR 15 million fine against OpenAI in Italy showed.

About our author
Tyler Luu
Co-founder & Group CEO
I’m Tyler Luu, Chief Executive Officer (CEO) of Sota Holdings Group, where I oversee the strategic direction of the organization. I also serve as the Co-Founder and Group CEO of SotaTek, as well as an Executive member of BEESOTA. My passion for science and technology began early during my years at Vietnam National University, where I was honored to receive the Honda YES Award for five consecutive years. Today, I’m proud to lead SotaTek in delivering customer-centric products on time and at scale, driving successful international projects and establishing our reputation for innovation and excellence.