Guides · Security
Data loss prevention
Detectors, rules and actions that stop secrets and personal data from leaving through agents — or entering their context.
DLP inspects data flowing out of agents (tool arguments, execution input) and into their context (tool results, inspected content) and allows, masks, redacts, blocks or requires approval.
Where DLP runs#
| Point | Direction | On BLOCK |
On REQUIRE_APPROVAL |
|---|---|---|---|
POST /v1/execute input |
outbound | execution denied with error code dlp_blocked |
approval forced (policy id dlp-outbound) |
POST /v1/execute output |
inbound | output withheld | — |
MCP tools/call arguments |
outbound | tool error with _meta.gebsecure.reason = "dlp_blocked" |
approval forced |
| MCP tool results, resources | inbound | result withheld | — |
POST /v1/inspect (dlp: true, the default) |
inbound | action: "BLOCK", content: null |
reported as the action |
POST /v1/dlp/scan |
as requested | reported | reported |
MASK and REDACT transform the data in place: the masked or redacted value is what goes upstream or to the
model.
Detectors#
Built-in detectors, by category:
| Category | Detectors |
|---|---|
pii |
pii.email, pii.phone, pii.us_ssn, pii.ipv4, pii.dob, pii.uk_nino, pii.passport, pii.address |
financial |
financial.credit_card (Luhn-checked), financial.iban (mod-97-checked), financial.aba_routing, financial.bank_account, financial.swift |
api_key |
api_key.aws_access_key, api_key.stripe, api_key.github, api_key.gitlab, api_key.slack, api_key.slack_webhook, api_key.google, api_key.openai, api_key.anthropic, api_key.twilio, api_key.sendgrid, api_key.npm, api_key.pypi, api_key.azure_storage, api_key.gebsecure |
credential |
credential.private_key, credential.jwt, credential.connection_string, credential.password_assignment, credential.aws_secret_key, credential.high_entropy |
source_code |
source_code.block (text of 120 characters or more) |
Some detectors fire only with nearby context words (dates of birth, passports, routing numbers, bare SSNs). Each finding has a confidence between 0 and 1.
Custom detectors (POST /v1/dlp/detectors): key (^[a-z0-9_]{1,63}$, the detector id becomes
custom.<key>), label, patterns (up to 20 regular expressions; long or catastrophic-backtracking patterns are
rejected) and/or keywords, contextWords, confidence (default 0.9), enabled.
Rules#
A rule (POST /v1/dlp/rules, permission dlp:configure):
| Field | Meaning | Default |
|---|---|---|
name, enabled, priority (−1000…1000) |
enabled, 0 | |
direction |
inbound, outbound or both |
|
detectors |
detector ids, category names or * |
|
action |
ALLOW, MASK, REDACT, REQUIRE_APPROVAL, BLOCK |
|
minConfidence |
ignore weaker findings | 0.8 |
minCount |
fire only with at least this many findings | 1 |
environments, actions, connectors |
scope: environment slugs or tiers, action wildcard patterns, connector keys (empty = any) | any |
Rules apply in descending priority; each finding gets the strictest matching action and the overall action is
the strictest across findings (ALLOW < MASK < REDACT < REQUIRE_APPROVAL < BLOCK). MASK keeps a hint
(j***@example.com, the last four digits of card, account, SSN and phone numbers, xxxx…[MASKED] for keys);
REDACT replaces the value with [REDACTED:<detector>].
Default rules, active unless disabled with PUT /v1/dlp/default-rules ({"enabled": false}):
| Rule | Direction | Detectors | Action |
|---|---|---|---|
| 1 (priority 100) | outbound | api_key, credential |
BLOCK |
| 2 (priority 90) | inbound | api_key, credential |
REDACT |
| 3 (priority 80) | inbound | financial |
MASK |
| 4 (priority 70) | outbound | pii, financial, at least 10 findings |
REQUIRE_APPROVAL |
All four use minConfidence 0.8. GET /v1/dlp/config returns the rules, the default rules, custom and
built-in detectors.
Scanning on demand#
POST /v1/dlp/scan (gateway or API) takes content (string up to 1 MB, object or array), direction, and
optionally action, connector, environmentId and dryRun. It returns the overall action, the transformed
content (null when blocked), findings (detector, category, label, confidence, path, masked,
enforcement), the matched rules and eventId. dryRun defaults to true for people and false for agents;
a dry run records nothing. People need dlp:read.
The SDKs wrap it as dlpScan / dlp_scan / DLPScan / DlpScanAsync.
Events and audit#
A non-ALLOW outcome with findings records a DLP event (GET /v1/dlp/events, GET /v1/dlp/dashboard), the
audit event dlp.enforce and the event dlp.violation (deliverable to webhooks). DLP findings carried in a
request's inspection context add the risk signal content.sensitive_data.