Redaction

To protect sensitive user information in enterprise conversational agents, you can redact confidential data before Dialogflow CX writes records to persistent storage. Conversational agents routinely handle Personally Identifiable Information (PII), Protected Health Information (PHI), Payment Card Industry (PCI) data, and other confidential customer records. If left unprotected, this data can propagate into conversation history, Cloud Logging, BigQuery exports, and downstream analytics pipelines.

Dialogflow CX provides multiple redaction mechanisms that you can combine to achieve defense-in-depth data protection across conversational ingestion points.

Conversational ingestion points

Sensitive data enters an agent through several architectural touchpoints during a conversation:

  • Intent and form parameters: End users provide names, phone numbers, national identification numbers, or payment card details in spoken or typed utterances that entity extraction parses into intent or form parameters.
  • Session parameters: Upstream client applications, Contact Center as a Service (CCaaS) platforms, or Customer Relationship Management (CRM) systems pass customer profile records into session parameters when initializing or continuing a session.
  • Webhooks and tools: Backend fulfillment services return structured payloads containing account balances, physical addresses, or confirmation tokens.
  • Fulfillment response messages: Dynamic agent responses that synthesize parameters and webhook data to confirm details back to the user can contain sensitive data.

Redacting data at the source prevents sensitive values from appearing in logs and transcripts while maintaining runtime access to parameters during the active session.

Redaction options

The following table compares the redaction options available in Dialogflow CX:

Redaction mechanism Scope Configuration point Best for
Consent-based redaction End-user utterances and parameters Agent Settings > General > Logging settings Giving end users control over transcript logging based on explicit consent.
Parameter redaction Specific intent or form parameters Intent settings or page form settings Removing known parameters (such as account numbers or addresses) from logs.
Sensitive Data Protection integration User utterances, agent responses, parameters, and webhook payloads Project-level security settings Automated pattern matching, infoType classification, masking, and tokenization.

Consent-based redaction lets you use a boolean session parameter to control whether Dialogflow CX redacts end-user input and parameters from conversation history and Cloud logging.

When you enable this feature in the agent settings, Dialogflow CX evaluates the $session.params.conversation-redaction boolean session parameter during the session:

  • Default state: By default, $session.params.conversation-redaction is true. When this setting is enabled and the parameter is true, Dialogflow CX redacts user input and parameters from logs and history.
  • Consent granted: If the user grants consent to store their conversation history, set $session.params.conversation-redaction to false. When set to false, Dialogflow CX retains user input and parameters. Other configured redaction strategies, such as parameter redaction and Sensitive Data Protection security settings, still apply.
  • Feature disabled: If you disable consent-based redaction in the agent settings, Dialogflow CX ignores the parameter and performs no consent-based redaction.

To enable consent-based redaction:

Console

  1. Go to the Conversational Agents console.
  2. Select your Google Cloud project.
  3. Select your agent.
  4. Click Agent Settings (or the settings icon).
  5. In the General settings tab, go to the Logging settings section.
  6. Select the Enable consent-based end-user input redaction checkbox.
  7. Click Save.

API

Set the advanced_settings.logging_settings.enable_consent_based_redaction field to true on the Agent type:

Select a protocol and version for the Agent reference:

Protocol V3 V3beta1
REST Agent resource Agent resource
RPC Agent interface Agent interface
C++ AgentsClient Not available
C# AgentsClient Not available
Go AgentsClient Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP Not available Not available
Python AgentsClient AgentsClient
Ruby Not available Not available

To collect consent in your agent design:

  1. Create an initial page or transition route that asks the end user if they consent to storing their conversation history.
  2. Create two intents: one that matches affirmative responses ("yes") and one that matches negative responses ("no").
  3. In the transition route for the affirmative intent, use parameter presets to set $session.params.conversation-redaction to false.
  4. In the transition route for the negative intent, use parameter presets to set $session.params.conversation-redaction to true.

Parameter redaction

Parameter redaction removes end-user parameter values from logs and internal storage. Redacted parameters appear as $parameter-name_redacted in logs and transcripts. For example, if an end user says "My address is 1600 Amphitheatre Parkway", and the address resolves to an address parameter, the logged text appears as:

My address is $address_redacted

Redact intent and form parameters

You can enable parameter redaction on individual intent parameters and form parameters:

Console

  • Intent parameters: Go to Manage > Intents, select the intent, and in the Parameters table, select the Redact in log checkbox next to the parameter.
  • Form parameters: Go to Build, select the page containing the form, click the parameter in the Parameters section, and select the Redact in log checkbox.

API

As an alternative to configuring each parameter individually, you can redact all parameters of a specific entity type.

Session parameters and parameter presets

Unlike intent parameters and form parameters, session parameters configured through fulfillment parameter presets or passed by upstream client applications do not have a redact field in the Dialogflow CX API (v3 or v3beta1).

To protect sensitive data in session parameters, use one of the following approaches:

  • Sensitive Data Protection security settings: Use security settings with Sensitive Data Protection. When redaction_strategy is set to REDACT_WITH_SERVICE and redaction_scope is set to REDACT_DISK_STORAGE, Sensitive Data Protection performs string-level pattern detection to detect and redact matching infoTypes in session parameters, webhook payloads, and fulfillment response messages before Dialogflow CX writes records to storage. Note that REDACT_WITH_SERVICE matches values against configured infoTypes rather than redacting arbitrary keys; opaque values (such as internal identifiers or confirmation tokens) are not redacted unless matched by a predefined or custom infoType in your inspect template. In addition, setting redaction_strategy to REDACT_WITH_SERVICE requires setting redaction_scope to REDACT_DISK_STORAGE to redact persisted data.
  • Intent and form parameter extraction: Where possible, extract sensitive user inputs by using intent or form parameters with parameter redaction enabled, rather than setting them through unredacted session presets.
  • Consent-based redaction: If end users request that their conversation history not be retained, use consent-based redaction.

Sensitive Data Protection integration through security settings

For comprehensive protection across user input, agent fulfillment responses, session parameters, and webhook payloads, Dialogflow CX integrates with Sensitive Data Protection by using project-level security settings.

When configured, Dialogflow CX sends conversation text to the Sensitive Data Protection API. Sensitive Data Protection detects sensitive patterns and applies de-identification rules before Dialogflow CX persists logs or conversation history.

Inspection templates

An inspection template specifies what sensitive data to search for in conversational text. You can configure inspection templates to identify:

  • Predefined infoTypes: Standard global and regional identifiers, such as CREDIT_CARD_NUMBER, US_SOCIAL_SECURITY_NUMBER, EMAIL_ADDRESS, and PHONE_NUMBER. For a complete list, see the infoType detector reference.
  • Custom infoTypes: Domain-specific sensitive patterns defined by regular expressions or custom dictionary word lists, such as employee identifiers or internal account numbers.

Template names follow this format:

projects/PROJECT_ID/locations/LOCATION_ID/inspectTemplates/TEMPLATE_ID

Or for organization-level templates:

organizations/ORGANIZATION_ID/locations/LOCATION_ID/inspectTemplates/TEMPLATE_ID

De-identification templates

A de-identification template defines how to transform or redact the detected sensitive data. Sensitive Data Protection supports several transformation methods:

  • Masking: Obscures sensitive characters with a masking character while optionally preserving prefix or suffix characters (for example, displaying a credit card number as ••••-••••-••••-1234).
  • Replacement: Replaces the sensitive value with a static token or the infoType name (for example, [redacted] or [EMAIL_ADDRESS]).
  • Crypto-based tokenization (pseudonymization): Replaces sensitive values with surrogate tokens encrypted by using a cryptographic key. Authorized workflows can re-identify tokens when necessary.
  • Hashing: Applies a one-way cryptographic hash to sensitive fields.

Template names follow this format:

projects/PROJECT_ID/locations/LOCATION_ID/deidentifyTemplates/TEMPLATE_ID

Or for organization-level templates:

organizations/ORGANIZATION_ID/locations/LOCATION_ID/deidentifyTemplates/TEMPLATE_ID

Grant required IAM roles

Before creating security settings that reference inspection or de-identification templates, verify that the Dialogflow CX service identity service account has permission to read your templates. Creating or updating a security settings resource validates template read access immediately; if permissions are missing, the operation fails.

The service identity service account uses the following format:

service-AGENT_PROJECT_NUMBER@gcp-sa-dialogflow.

Replace AGENT_PROJECT_NUMBER with your Dialogflow CX agent's Google Cloud project number.

Grant the following Identity and Access Management (IAM) roles to the service account on the project or organization that hosts the templates:

  • DLP Inspect Templates Reader (roles/dlp.inspectTemplatesReader)
  • DLP Deidentify Templates Reader (roles/dlp.deidentifyTemplatesReader)

To grant these roles on a template project by using the Google Cloud CLI CLI:

gcloud projects add-iam-policy-binding TEMPLATE_PROJECT_ID \
    --member="serviceAccount:service-AGENT_PROJECT_NUMBER@gcp-sa-dialogflow." \
    --role="roles/dlp.inspectTemplatesReader"

gcloud projects add-iam-policy-binding TEMPLATE_PROJECT_ID \
    --member="serviceAccount:service-AGENT_PROJECT_NUMBER@gcp-sa-dialogflow." \
    --role="roles/dlp.deidentifyTemplatesReader"

Replace TEMPLATE_PROJECT_ID with the ID of the project hosting the templates.

For organization-level templates, grant the roles at the organization level:

gcloud organizations add-iam-policy-binding ORGANIZATION_ID \
    --member="serviceAccount:service-AGENT_PROJECT_NUMBER@gcp-sa-dialogflow." \
    --role="roles/dlp.inspectTemplatesReader"

gcloud organizations add-iam-policy-binding ORGANIZATION_ID \
    --member="serviceAccount:service-AGENT_PROJECT_NUMBER@gcp-sa-dialogflow." \
    --role="roles/dlp.deidentifyTemplatesReader"

Replace ORGANIZATION_ID with your Google Cloud organization ID.

Configure security settings for redaction

To enable Sensitive Data Protection redaction, create a security settings resource and associate it with your agent.

Step 1: Create a security settings resource

To create security settings:

Console

  1. Go to the Conversational Agents console.
  2. Select your Google Cloud project.
  3. Select your agent.
  4. Click Agent Settings (or the settings icon).
  5. Click the Security tab.
  6. Click Manage security settings. The CCAI console opens in a new tab.
  7. In the security settings management page, click Create security settings.
  8. In the Display name field, enter a name for the security settings.
  9. In the Location drop-down menu, select the location matching your agent and templates.
  10. In the Redaction Strategy drop-down menu, select REDACT_WITH_SERVICE.
  11. In the Redaction Scope drop-down menu, select REDACT_DISK_STORAGE.
  12. In the Inspect Template field, enter the resource name of your inspection template.
  13. In the De-identify Template field, enter the resource name of your de-identification template.
  14. Click Create.

API

Create a SecuritySettings resource with the following fields:

  • display_name: Set to a descriptive name.
  • redaction_strategy: Set to REDACT_WITH_SERVICE.
  • redaction_scope: Set to REDACT_DISK_STORAGE.
  • inspect_template: Set to your inspection template resource path.
  • deidentify_template: Set to your de-identification template resource path.

Step 2: Assign security settings to your agent

After creating the security settings resource, link it to your agent:

Console

  1. Go to the Conversational Agents console.
  2. Select your Google Cloud project.
  3. Select your agent.
  4. Click Agent Settings (or the settings icon).
  5. Click the Security tab.
  6. In the Security settings drop-down menu, select the security settings resource that you created.
  7. Click Save.

API

Set the security_settings field to the resource name of your security settings on the Agent type:

Select a protocol and version for the Agent reference:

Protocol V3 V3beta1
REST Agent resource Agent resource
RPC Agent interface Agent interface
C++ AgentsClient Not available
C# AgentsClient Not available
Go AgentsClient Not available
Java AgentsClient AgentsClient
Node.js AgentsClient AgentsClient
PHP Not available Not available
Python AgentsClient AgentsClient
Ruby Not available Not available

Updates to security settings take effect within one hour.

Redaction behavior across logs and transcripts

When redaction is enabled, Dialogflow CX applies transformations to sensitive data before writing records to downstream systems:

  • Conversation history: In the Manage > Conversation history console view, redacted parameter values and sensitive text detected by Sensitive Data Protection appear masked, replaced, or removed.
  • Cloud Logging: Log entries in the Logs Explorer display redacted text strings, protecting log sinks from storing plain-text PII.
  • BigQuery export: When exporting session interaction logs to BigQuery, exported request and response payloads reflect the applied redactions.
  • Exported audio recordings: When audio export to Cloud Storage is configured, audio recordings are redacted only when audio_export_settings.enable_audio_redaction is set to true in your security settings. Redaction applies to end-user input audio only; synthesized virtual agent response audio is not redacted.
  • Session state during runtime: Redaction affects storage and logs only. During the live session, Dialogflow CX continues to evaluate parameters in memory to resolve conditions, routes, webhooks, and tool inputs.

What's next