Skip to content
Docs

DLP Configuration

Data Loss Prevention (DLP) is AgentWatch’s real-time content inspection layer. Every AI prompt and 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 log a warning 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 │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Risk Score Calculation │
│ (severity × category multiplier) │
└──────────────┬──────────────────────┘
│
┌──────┴──────┐
▼ ▼
Score < 5 Score ≥ 5
Allow/Warn Block / Redact

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.

Score Range Action
0.0 – 2.9 Low risk — allow and log
3.0 – 4.9 Medium risk — warn
5.0 – 10.0 High / Critical risk — block or redact
Mode What Happens
Block Request is rejected with 403 Forbidden. The prompt never reaches the LLM.
Redact Sensitive values are replaced inline with tokens like [EMAIL-REDACTED], [SSN-REDACTED], [CARD-REDACTED]. The sanitized prompt is forwarded to the LLM.
Warn Detection is logged 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 On
Scan Financial (PCI) Enable payment card detection On
Scan Health (PHI) Enable HIPAA PHI detection On
Scan Credentials Detect API keys, passwords, tokens On
Action on Violation block, redact, or warn warn
Scan Direction request, response, or both both

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, Credentials).
  4. Set Action on Violation:
    • Start with warn to audit detections without blocking.
    • Switch to redact once you have confirmed the false-positive rate.
    • Use block for the most sensitive categories (PHI, PCI) 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 / warn)

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?type=dlp Export DLP events