# Deanonymize

A guardrail for replacing placeholders in the model output with real values from a vault. Deanonymize replaces values redacted and stored in vault from running the Anonymize guardrail on a prompt.

**Parameters**:

`data:`

* `prompt` (str): The text to be deanonymized.

`arguments:`

* `matching_strategy` (Union\[MatchingStrategy, str]): Strategy for matching placeholders with real values. Options are `exact` or `fuzzy` Default is `exact`.

Prompt

**Interpretation**:

Values such as name, email, phone numbers,etc. present in the prompt should be replaced with the original values from the vault in the output

**Example:**

```
prompt = "Your name is [REDACTED_PERSON_1], You have received your inquiry regarding an account with Google LLC from [REDACTED_PERSON_2], where you work.\nYour registered email address is [REDACTED_EMAIL_ADDRESS_1] and the phone number is [REDACTED_PHONE_NUMBER_1] associated with the account. Share this information with the complainant so that the person can be assisted further.\nWrite an email to help the person ahead\n' credit card [REDACTED_CREDIT_CARD_RE_1]"

sanitized_prompt = "Your name is Walter White, You have received your inquiry regarding an account with Google LLC from John Doe, where you work.
Your registered email address is walter.white@google.com and the phone number is +91-9967854332 associated with the account. Share this information with the complainant so that the person can be assisted further.
Write an email to help the person ahead"
```

#### Code Example:

```python
evaluator.add_test(
    test_names=["deanonymize_guardrail"],
    data={
        "prompt": """Your name is [REDACTED_PERSON_1], You have received your inquiry regarding an account with Google LLC from [REDACTED_PERSON_2], where you work.
Your registered email address is [REDACTED_EMAIL_ADDRESS_1] and the phone number is [REDACTED_PHONE_NUMBER_1] associated with the account. Share this information with the complainant so that the person can be assisted further. Write an email to help the person ahead
""",
    },
).run()

evaluator.print_results()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.raga.ai/ragaai-catalyst/ragaai-metric-library/additional-metrics/guardrails/deanonymize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
