What is AI DLP? Preventing Data Leaks Through Prompts
Nanda Teknoloji Engineering Team · · 8 min read
In brief
AI DLP is a data loss prevention layer that detects sensitive data in the prompts, files, and responses that employees and applications exchange with AI services in real time, then blocks, masks, or warns. It is classic DLP adapted to chat and API traffic.
AI DLP (Data Loss Prevention) is a control layer that detects sensitive data in the prompts, uploaded files, and returned responses that employees and applications exchange with AI services, then blocks, masks, or warns. The goal is to catch data before it crosses the model provider’s boundary. Once a prompt is sent, it cannot be taken back: the data becomes subject to the provider’s infrastructure, logs, and contract terms. Pasting personal data, source code, financial statements, or contract text into a chat box looks like an everyday convenience, but it is in fact a data transfer.
Why are prompts a new leakage channel?
Traditional DLP was designed to monitor a file being attached to an email or uploaded to the cloud. With AI services, data mostly leaves not as a file but as pasted text. An analyst copies an entire customer complaint thread to have it summarized; a developer pastes a configuration file containing a connection string to debug it; a lawyer has a contract clause rewritten. None of this is malicious, and all of it is a data leak.
Three characteristics make this channel different:
- Free form: The text is unstructured, and sensitive information appears in the middle of a sentence.
- Speed and volume: An employee sends dozens of requests a day, so manual review is not feasible.
- The response side: The model can return sensitive information from the context in its response, or leak data it retrieved from another source to the user.
OWASP’s Top 10 risks for LLM applications treats sensitive information disclosure as a separate risk category, which shows that the issue is not only about employee behavior but also about application design.
How does AI DLP work?
AI DLP usually runs on an AI Gateway or together with browser and endpoint agents. The flow is as follows:
- The request is captured. The prompt, attachments, and context text reach the gateway or the agent.
- Text is extracted and normalized. Documents, text inside images, and encoded content are converted to plain text.
- Sensitive data is detected. Patterns (ID numbers, IBAN formats, key structures), dictionaries, document labels, and context-aware classification are applied together.
- A policy decision is made. Block, mask, warn, or allow, based on the data class, the user role, and the target model.
- The action is applied and logged. If masking was applied, placeholders can be restored when the response arrives; the event is written to the audit trail.
- The response is scanned too. The content the model returns passes through the same policy.
Detection methods and their limits
| Method | Strength | Weakness | Typical example |
|---|---|---|---|
| Pattern / regular expression | Fast, predictable | Misses data that has no fixed format | ID number, card number, API key |
| Dictionary and keyword | Simple, explainable | Does not understand context, laborious to maintain | Project code names, internal unit names |
| Document label / fingerprint | Catches known documents with certainty | May miss rewritten text | Contracts with confidentiality labels |
| Context-aware classification | Captures meaning in free text | Risk of false positives and latency | Customer correspondence, source code |
No single method is enough on its own. In practice, a layered approach is built: blocking for precise patterns, and warnings with user confirmation for uncertain cases.
Example scenario: Customer support summaries
A support team uses a chat service to summarize long customer threads. The threads contain names, phone numbers, addresses, and sometimes order contents. Once AI DLP is in place, names and phone numbers are replaced with placeholders (“CUSTOMER_1”, “PHONE_1”), the model produces the summary using those placeholders, and when the response comes back, the real values are restored on the user’s side. The team gets the same productivity, and no personal data reaches the provider. If the same thread contains an image of an ID document, the rule is different: it is blocked, and the user is shown the reason.
A step-by-step path to rollout
- Clarify your data classes. Put in writing what counts as personal data, trade secrets, source code, and legally protected information.
- Measure current usage. Run in monitor-only mode first and see which data types are actually being sent.
- Build an action matrix. For each data class, decide block, mask, warn, or allow by role and target model.
- Explain it to users. A blocked user should see the reason and the alternative path; otherwise they will turn to uncontrolled tools.
- Track false positives. Define an exception process and a regular rule review schedule.
- Set the logging policy. Do not store the sensitive content itself in event logs; a masked summary is enough.
Common mistakes
- Designing for blocking only. A system that blocks everything pushes employees toward uncontrolled channels, which makes the Shadow AI problem worse.
- Skipping the response side. Sensitive data can also come from the model; scanning only outbound traffic is half a protection.
- Limiting detection to pattern matching. Source code and contract text cannot be caught with a fixed pattern.
- Leaving the legal framework to the end. The KVKK assessment for the scope of monitoring and the processing of personal data should be done at the start.
- Storing raw prompts in event logs. A system built for protection can turn into a new store of sensitive data.
Choosing an action: block, mask, or warn
The success of AI DLP depends on choosing the right response as much as on detection. The same detection calls for different actions in different contexts.
| Action | When it fits | Point to watch |
|---|---|---|
| Block | Authentication data, keys, passwords, special-category data | The user must be clearly shown why it was blocked and what the alternative is |
| Mask | Identifiers such as name, phone, and address that are not needed for the task | Placeholders must stay consistent in the response, and restoration must be done safely |
| Warn and ask for confirmation | Uncertain, context-dependent content (e.g., a document without a confidentiality label) | Alert fatigue: if everything raises a warning, no one reads them |
| Allow and log | Routine use of low-risk, approved tools | Logs should store the event summary, not the sensitive content |
An action matrix is not built perfectly in one pass. As monitoring data arrives, you see which rules create unnecessary blocks and which leave gaps.
File uploads, images, and code: separate challenges
Scanning plain-text prompts alone is not enough. Three content types need special attention.
File uploads. The text inside PDFs, spreadsheets, and presentations must be extracted and scanned. With large files, scan time affects the user experience; setting size and type limits strikes a reasonable balance.
Images. Screenshots, scanned documents, and photos can carry sensitive data. Extracting the text in an image (OCR) and, where needed, disabling image upload for certain roles are among the options.
Source code. Passwords, keys, and connection strings in code snippets are a common source of leaks. Secret scanners and repository-based classification are effective when used together with patterns. If the code itself counts as a trade secret, which repositories may be sent to which tools should also be tied to a rule.
DLP for RAG and internal data sources
A company-specific assistant may retrieve information from an internal document archive and feed it to the model as context. In this architecture, the direction of leakage changes: even if the user types no sensitive data, the model can carry information from a document they are not authorized to see into the response. Protection requires the following:
- Filtering at the retrieval stage according to the user’s own permissions, so the model only receives documents that person could see.
- Carrying document labels (confidentiality level) along with the search results.
- Scanning the response at the exit, and blocking it if labeled content appears in it.
- Keeping a record of which document contributed to which response.
The sensitive information disclosure category in OWASP’s LLM risk list also covers this architecture; instead of a single control, the input, context, and output layers need to be considered together.
How do you measure success?
A common mistake in DLP projects is asking only “how many requests were blocked.” More meaningful indicators are:
- How many of the blocked requests were real risks, and how many were false positives?
- Has the use of approved tools increased, or have users drifted to uncontrolled channels?
- When an incident occurs, how quickly can you determine which data went to which tool?
- Do employees understand why they were blocked? The types of support requests show this.
Decision summary
If your employees regularly use external AI services and personal data, source code, or trade secrets can reach those services, you need AI DLP. Start in monitor mode, define your data classes, then turn on actions gradually. Technical controls are effective when written policy and employee training complement them.
Moving forward with Nanda Teknoloji
Nanda Teknoloji carries out the discovery, design, migration, and operations steps in projects like this: defining data classes, measuring real usage during the monitoring phase, building the action matrix, and running it in operation. For our approach, see the AI DLP solution page, and for the layer that consolidates traffic at a single point, see the AI Gateway solution.