Skip to content
Docs

DLP Configuration

Data Loss Prevention (DLP) is AgentWatch’s real-time content inspection layer. Every AI prompt (and, when response scanning is enabled, every response) passes through the DLP engine before reaching the LLM or the client. If sensitive data is detected, AgentWatch can block the request outright, silently redact the sensitive values, or record the finding while letting the request proceed — depending on your policy.

DLP is critical in enterprise AI deployments because employees regularly paste internal data (contracts, patient records, customer PII) into AI prompts without realizing it is being transmitted to a third-party model provider. AgentWatch catches this before the data leaves your network.

Inbound Request (prompt text)
│
▼
┌─────────────────────────────────────┐
│ 1. Built-in Regex Patterns (50+) │
│ Fast pattern matching against │
│ SSN, credit cards, API keys… │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 2. Custom Rules (if configured) │
│ Admin-defined regex patterns │
│ for company-specific data │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 3. NER Enhancement (if enabled) │
│ Python/Presidio bridge for │
│ contextual entity detection │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 4. External Webhook (if configured) │
│ POST to your own DLP service; │
│ additional findings are merged │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ DLP Action (Detect / Redact / │
│ Block) + Block sensitivity tiers │
└──────────────┬──────────────────────┘
│
┌─────────┼──────────┐
▼ ▼ ▼
Detect Redact Block
(record) (mask all) (refuse in-tier,
mask the rest)

Data Categories and What AgentWatch Detects

Section titled “Data Categories and What AgentWatch Detects”

PII — Personally Identifiable Information

Section titled “PII — Personally Identifiable Information”
Data Type Examples Detected
Email addresses user@company.com
Phone numbers US and international E.164 format
Social Security Numbers 123-45-6789
Government IDs ITIN, EIN, passport numbers, driver’s licenses
Dates of birth DOB: 01/15/1980
Physical addresses Street + city + ZIP combinations
IP / MAC addresses IPv4, IPv6, hardware MAC
Bank identifiers Account numbers, routing numbers, IBAN, SWIFT
Data Type Notes
Credit/debit card numbers Visa, Mastercard, Amex, Discover — Luhn-validated
CVV / CVC codes 3–4 digit security codes
Card expiration dates MM/YY and MM/YYYY formats
Card PINs 4–6 digit PIN patterns in context

PHI — Protected Health Information (HIPAA)

Section titled “PHI — Protected Health Information (HIPAA)”
Data Type Examples
Medical Record Numbers MRN patterns
Provider identifiers NPI, DEA numbers
Clinical codes ICD-10 diagnoses, CPT procedures, NDC drug codes
Health details Conditions, medications, lab results, vital signs
Biometric data Fingerprint references, genetic data mentions
Data Type Detection Pattern
AWS access keys AKIA... prefix pattern
API keys OpenAI sk-..., Anthropic sk-ant-..., Stripe sk_live_...
GitHub tokens ghp_..., github_pat_...
JWT tokens Three-part base64 structure
Private key headers -----BEGIN PRIVATE KEY-----
Database URLs postgres://, mysql:// with credentials

Each detection is scored by severity and category:

Severity Weight
Critical 10
High 7
Medium 4
Low 1

Category multipliers: PHI × 1.5, PCI × 1.4, Credentials × 1.3, PII × 1.0

The highest-scoring detection contributes 70% of the total risk score; remaining detections contribute the balance. The result is a normalized 0–10 score.

The risk score is informational — it is recorded with each DLP event and shown in the console, but it does not decide the action. The action comes from the single DLP Action setting plus, in Block mode, the Block sensitivity, which selects which risk tiers of finding refuse the request:

Block sensitivity Tiers that refuse the request
Low High tier only
Medium High + medium tiers
High High + medium + low tiers

Findings outside the selected tiers are redacted rather than blocked.

Mode What Happens
Block Findings in the selected sensitivity tiers refuse the request: the prompt never reaches the LLM, and AgentWatch returns a refusal completion (finish_reason: content_filter, dlp_blocked: true, code dlp_blocked). Findings outside those tiers are redacted.
Redact Every finding is replaced inline with tokens like [EMAIL-REDACTED], [SSN-REDACTED], [CARD-REDACTED], whatever its score. The sanitized prompt is forwarded to the LLM.
Detect only Every finding is recorded as a DLP event; the original prompt is forwarded unchanged.

Navigate to: Settings → General → DLP

Setting Description Default
DLP Enabled Master on/off switch Off
Scan PII Enable PII category detection Off
Scan Financial (PCI) Enable payment card detection Off
Scan Health (PHI) Enable HIPAA PHI detection Off
Action on Detection Detect only, Redact, or Block Detect only
Scan responses Also scan model responses (opt-in) Off

Administrators can add company-specific patterns (internal project codenames, proprietary identifiers, etc.):

{
"name": "Project Codename",
"pattern": "\\b(PHOENIX|TITAN|NOVA)-\\d{4}\\b",
"category": "CUSTOM",
"severity": "high",
"confidence": 0.9,
"enabled": true
}

Rules are validated before saving — patterns over 500 characters are rejected to prevent ReDoS attacks.

  1. Go to Settings → General → DLP.
  2. Toggle DLP Enabled to On.
  3. Select the categories to scan (PII, Financial, Health).
  4. Set Action on Detection:
    • Start with Detect only to audit detections without blocking.
    • Switch to Redact once you have confirmed the false-positive rate.
    • Use Block (with a Block sensitivity) for the most sensitive data in regulated environments.
  5. (Optional) Add Custom Rules for company-specific sensitive terms.
  6. Click Save. DLP scanning begins immediately for all new requests.

Go to Analytics → Observability and filter by DLP Events. Each record shows:

  • Timestamp and request ID
  • Which categories were detected and their scores
  • Whether the request was blocked or allowed
  • The action taken (block / redact / detect)

DLP events are also included in the Audit Export (section 7.4).

Method Endpoint Description
GET /api/admin/company/settings Read current DLP configuration
PUT /api/admin/company/settings Update DLP settings
GET /api/admin/audit/export Export the audit log (JSON, CSV or PDF report)