Workflows
Blocks
Actions
PII

PII (Personally Identifiable Information)

The PII block allows you to handle sensitive data within your workflows by formatting, anonymizing, or deanonymizing text. This is crucial for maintaining privacy and compliance when processing user data.

Tip: Use the PII block to mask sensitive information before sending data to third-party services, and restore it when needed.

Tasks

The PII block supports two main tasks: Anonymize and Deanonymize.

1. Anonymize

The Anonymize task masks specific entities in the provided text, replacing them with placeholders or redacted values.

Configuration

  • Fields to Process: Select the types of entities you want to anonymize (e.g., PERSON, EMAIL_ADDRESS, PHONE_NUMBER). You can select from the available list or type custom field names.
  • Text: The text content containing the sensitive information you want to anonymize.

Output

The block returns an object containing the anonymized text and a mapping of the redacted entities.

{
  "text": "Hello <PERSON>, your email is <EMAIL_ADDRESS>.",
  "mapping": {
    "<PERSON>": "John Doe",
    "<EMAIL_ADDRESS>": "john.doe@example.com"
  }
}

2. Deanonymize

The Deanonymize task restores the original information in an anonymized text using a provided mapping.

Configuration

  • Text: The anonymized text content containing placeholders (e.g., Hello <PERSON>).
  • Mapping (JSON): A JSON object or stringified JSON mapping the placeholders to their original values. This is typically obtained from the output of a previous Anonymize task.

Output

The block returns the restored text.

{
  "text": "Hello John Doe, your email is john.doe@example.com."
}

Usage Example

Anonymizing User Data

Scenario: You want to send a user's message to an AI analysis tool but need to hide their personal details.

  1. Add a PII Block: Set the task to Anonymize.
  2. Select Fields: Choose PERSON, EMAIL_ADDRESS, and PHONE_NUMBER.
  3. Input Text: Connect the text field to your user's message variable (e.g., {{variables.userMessage}}).
  4. Process: The block produces anonymized text that you can safely pass to the AI tool.

Restoring Data

Scenario: After the AI tool processes the anonymized text, you want to show the result to the user with their original details.

  1. Add a PII Block: Set the task to Deanonymize.
  2. Input Text: Connect the text field to the AI tool's output variable (e.g., {{blocks.ai_block.output}}).
  3. Input Mapping: Connect the mapping field to the output of the previous Anonymize block (e.g., {{blocks.pii_anonymize.output.mapping}}).
  4. Result: The block outputs the text with the original personal details restored.

Best Practices

  • Verify Mappings: Ensure the mapping JSON is valid and correctly corresponds to the placeholders in the text.
  • Select Necessary Fields: Only anonymize the fields that are strictly necessary to protect privacy while preserving the context for analysis.
  • Secure Storage: If you store the mapping separately, ensure it is encrypted and secure, as it can be used to re-identify the data.

Troubleshooting

  • Invalid JSON Error: If the Deanonymize task fails, check that the "Mapping" field contains valid JSON.
  • Unreplaced Placeholders: If placeholders remain in the text after deanonymization, verify that the keys in user mapping exactly match the placeholders in the text.
Indite Documentation v1.4.0
PrivacyTermsSupport