Skip to content

Deanonymize Detector

The Deanonymize Detector is an essential tool that restores original data within the model's output by replacing placeholders.

When employing privacy-enhancing tools such as the Anonymize Detector, sensitive or private information is often masked with placeholders. For example, a name like "Jane Doe" might be represented as [REDACTED_PERSON_1]. The primary purpose of the Deanonymize Detector is to reverse these substitutions, ensuring the original data is reinstated when necessary.

Vulnerability

When privacy-enhancing tools are applied, sensitive information is often anonymized, using placeholders like [REDACTED_PERSON_1]. However, there are scenarios where the original data needs to be restored, such as for legitimate user requests or internal processing. Failing to replace these placeholders correctly could lead to misunderstandings or incorrect actions based on incomplete or inaccurate data.

Usage

The Deanonymization Detector utilizes the Vault object, which acts as a record-keeper for all alterations made by privacy-enhancing tools like the Anonymize Detector. When the Deanonymization Detector encounters a placeholder in the model's output, it seamlessly retrieves the original information from the Vault and substitutes the placeholder with the actual data.

To get started, you'll need to initialize the Vault object to retain the original data:

from guardrail.firewall.vault import Vault

vault = Vault()

Next, configure the Deanonymize Detector with the Vault:

from guardrail.firewall.output_detectors import Deanonymize

output_detectors = [Deanonymize(vault)]

sanitized_response, valid_results, risk_score = firewall.scan_output(sanitized_prompt, response_text, output_detectors)

By integrating the Deanonymization Detector into your security framework, teams can ensure the seamless restoration of original data when required, maintaining accuracy and reliability in their interactions and internal processes.