canonical: https://jentic.com/apis/googleapis.com/dlp

# Google Sensitive Data Protection (DLP)

Google Sensitive Data Protection (formerly Cloud DLP) is a fully managed service for discovering, classifying, and de-identifying sensitive data such as PII, PHI, and credentials inside text, images, and structured stores. The API supports built-in and custom infoTypes, inspection jobs, deidentify and reidentify operations, hybrid inspection from agents, and continuous data profiling across BigQuery and Cloud Storage. Teams use it for compliance (GDPR, HIPAA), tokenisation, and pre-prompt sanitisation of LLM inputs.

## For AI agents

Detect, classify, and de-identify sensitive data across text, images, and structured stores for compliance and LLM safety.

## Scope

Does not encrypt files at rest, manage OAuth tokens, or block network traffic - use for content-level sensitive data inspection, redaction, and re-identification only.

## Capabilities

- Inspect content for sensitive infoTypes (PII, PHI, credentials) inline or via batch jobs
- De-identify text by masking, tokenising, or format-preserving encryption
- Re-identify previously tokenised data using stored crypto keys
- Run hybrid inspection that streams from external agents back to DLP
- List built-in and custom infoTypes available in a project
- Profile column data in BigQuery to surface sensitive columns continuously

## Use cases

### Pre-Prompt LLM Sanitisation

Before sending user content to an LLM, route it through DLP's deidentify endpoint to mask PII, replace names with surrogates, or tokenise account numbers. This keeps prompts compliant with data-handling policies and prevents leakage of customer data into model logs. The deidentify call returns transformed text in a single round-trip.

Example prompt: Call deidentify on the text 'Customer email is alice@example.com, card 4111-1111-1111-1111' with infoTypes EMAIL_ADDRESS and CREDIT_CARD_NUMBER, replacing matches with surrogate tokens.

### Continuous Data Profiling

Use the column data profile endpoints to discover sensitive columns across a BigQuery estate continuously. DLP scans tables on a schedule, returns findings per column with confidence scores, and feeds tags back to the data catalogue. Compliance teams use the profiles to drive masking policies and access reviews.

Example prompt: List columnDataProfiles for a project's BigQuery scan, then return columns with infoType SOCIAL_SECURITY_NUMBER and confidence at least HIGH.

### Hybrid Inspection from External Agents

When data lives outside Google Cloud, the hybridInspect endpoint lets external agents stream payloads to DLP for inspection without first staging them in GCS. Useful for on-premise applications or third-party SaaS connectors - DLP returns findings without persisting the inspected data.

Example prompt: Send a hybridInspect request with payload containing 200 chat-message records and infoTypes PERSON_NAME and PHONE_NUMBER, then aggregate the returned findings by infoType.

### Agent-Driven Compliance Sweep

Through Jentic, an AI agent can run a compliance sweep on a content store before publishing - calling DLP inspect on each item, redacting matches via deidentify, and tagging items that need human review. Credentials are scoped per agent run by your Jentic One instance.

Example prompt: Use Jentic to search 'inspect text for sensitive data', load the inspect schema, and execute it for each of 50 articles, returning the count of findings per article.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v2/infoTypes | List built-in DLP infoTypes |
| POST | /v2/{+name}:hybridInspect | Stream a hybrid inspection request from an external agent |
| POST | /v2/{+name}:cancel | Cancel a running DLP job |
| POST | /v2/{+name}:activate | Activate a job trigger |
| POST | /v2/{+name}:finish | Finish a hybrid job stream |
| GET | /v2/{+parent}/columnDataProfiles | List BigQuery column data profiles |

## Key resources

- **infoTypes** — List built-in and custom sensitive data types available for inspection
- **inspectTemplates** — Reusable configuration for inspection jobs
- **deidentifyTemplates** — Reusable configuration for de-identification transforms
- **dlpJobs** — Run and manage long-running inspection and risk-analysis jobs
- **jobTriggers** — Schedule recurring DLP inspection jobs
- **columnDataProfiles** — Continuous profiling results for BigQuery columns

## Why Jentic

- **Setup:** Wiring the Cloud Data Loss Prevention API by hand means standing up Google OAuth2 with the right scopes, targeting dlp.googleapis.com, and building the resource-path calls yourself for inspection, redaction, and re-identification. Through Jentic you install once, import the Cloud DLP API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** Cloud DLP puts the resource name in the URL path (/v2/{+name}, /v2/{+parent}/...), so a rule can pin your agent to one project or job resource: it can run hybrid inspection and read data profiles there and nothing else. You choose the operations it may call, so state-changing ones like cancel or finish are not included unless you add them.
- **Credential handling:** Your Google OAuth credential for Cloud DLP is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'inspect text for sensitive data' or 'list column data profiles', and Jentic returns the matching Cloud DLP operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Cloud Key Management Service (KMS) API** — Manages crypto keys used by DLP for tokenisation and re-identification
- **Secret Manager API** — Stores credentials and tokens that DLP can scan for in code repositories
- **Cloud Asset Inventory API** — Inventories Google Cloud resources - different from DLP's content-level inspection

## FAQ

### What authentication does the Sensitive Data Protection (DLP) API use?

OAuth 2.0 with the cloud-platform scope. Through Jentic, OAuth tokens are scoped per agent run and stored encrypted in your Jentic One instance, so service-account JSON keys never enter the agent runtime.

### Can I de-identify text with reversible tokenisation?

Yes. Use a deidentify config with cryptoReplaceFfxFpeConfig (format-preserving encryption) backed by a Cloud KMS key. The reidentify endpoint reverses the transformation when the same key and config are supplied.

### What are the rate limits for the DLP API?

DLP enforces per-project quotas: a default of 600 inspect calls per minute, with separate budgets for deidentify, hybridInspect, and risk-analysis jobs. Long-running scans count against batch quotas. Check current limits in the Google Cloud Console.

### How do I list all available infoTypes through Jentic?

Search 'list DLP infoTypes', load the schema for /v2/infoTypes, then execute it. Jentic returns the parsed list of every built-in infoType DLP recognises (PERSON_NAME, EMAIL_ADDRESS, CREDIT_CARD_NUMBER, and many more).

### Does DLP support custom infoTypes?

Yes. You can define custom regular-expression dictionaries, word lists, or stored infoTypes (built from Cloud Storage manifest files), and reference them in inspect or deidentify configs alongside built-in infoTypes.

### Is the Sensitive Data Protection API free?

No. Pricing is per gigabyte of inspected or de-identified content, with separate rates for hybrid inspection, BigQuery profiling, and image inspection. Check current pricing in the Google Cloud Console.

### Can I limit what my agent is allowed to do with the Google DLP API?

Yes. Because your Jentic One instance is self-hosted, your own rules decide which Cloud DLP operations and credentials the agent may use. Since DLP carries the resource name in the URL path, you can pin the agent to a single project or job and let it only inspect text, run hybrid inspection, and read column data profiles there. State-changing operations such as cancel, activate, and finish stay off the list unless you explicitly grant them.
