← Docs

🛡️ Agent Shield (PII)

Redact PII before sending to LLMs, then hydrate original values back. Pro+ feature.

How it works

  1. Clean — Send text, get back redacted text + sessionId
  2. Send redacted text to your LLM
  3. Hydrate — Send LLM response + sessionId, get original values restored

Clean (Redact)

curl -X POST https://www.agent-utils.com/api/shield/clean \

-H "x-api-key: au_your_key" \

-H "Content-Type: application/json" \

-d '{"text": "Call John at 555-1234 or john@example.com"}'

# Response

{"success":true,"data":{

"cleaned": "Call [NAME_1] at [PHONE_1] or [EMAIL_1]",

"sessionId": "abc123",

"detected": ["email", "phone"]

}}

Hydrate (Restore)

curl -X POST https://www.agent-utils.com/api/shield/hydrate \

-H "x-api-key: au_your_key" \

-H "Content-Type: application/json" \

-d '{"text": "I emailed [EMAIL_1] for [NAME_1]", "sessionId": "abc123"}'

# Response

{"success":true,"data":{"hydrated": "I emailed john@example.com for John"}}

Detected PII Types

  • Email addresses → [EMAIL_N]
  • Phone numbers → [PHONE_N]
  • SSN → [SSN_N]
  • Credit card numbers → [CC_N]
  • IP addresses → [IP_N]
  • Dates → [DATE_N]

Parameters

ParamEndpointTypeDescription
textclean, hydratestringInput text
sessionIdhydratestringSession ID from clean response
Pro+ feature. Free tier users need to upgrade to use PII redaction.