Detects the presence of Personally Identifiable Information (PII) within the text, helping to prevent the unintentional disclosure of sensitive data. The detector returns secrets, PII, IP addresses, and URLs.

Example Anonymization request:

import requests
import json
import os

url = "https://api.enkryptai.com/guardrails/pii"

payload = json.dumps({
    "text": "John Everyman, born on January 1, 1970, at 123 Birth Lane, Smalltown, USA, embarked on a journey filled with diverse experiences and milestones. His Social Security number, 456-45-6789, was issued in his home state, marking the beginning of his financial footprint. Here is my email: example@example.com",
    "mode": "request",
    "key": None
})
headers = {
  'Content-Type': 'application/json',
  'api_key': os.getenv('ENKRYPTAI_API_KEY')
}

response = requests.request("POST", url, headers=headers, data=payload)

formatted_response = json.dumps(json.loads(response.text), indent=4)
print(formatted_response)

Anonymization response:

{
	"text": "<PERSON_0>, born on <DATE_TIME_0>, at 123 Birth Lane, <LOCATION_1>, <LOCATION_0>, embarked on a journey filled with diverse experiences and milestones. His Social Security number, <US_SSN_0>, was issued in his home state, marking the beginning of his financial footprint. Here is my email: <EMAIL_ADDRESS_0>",
	"key": "e0d23d58abe14b2babb3be5aeab8250e"
}

Example de-anonymization request:

import requests

url = "https://api.enkryptai.com/guardrails/pii"

payload = {
    "text": "<PERSON_0>, born on <DATE_TIME_0>, at 123 Birth Lane, <LOCATION_1>, <LOCATION_0>, embarked on a journey filled with diverse experiences and milestones. His Social Security number, <US_SSN_0>, was issued in his home state, marking the beginning of his financial footprint. Here is my email: <EMAIL_ADDRESS_0>",
    "mode": "response",
    "key": "e0d23d58abe14b2babb3be5aeab8250e"
}
headers = {
    "Content-Type": "application/json",
    'api_key': os.getenv('ENKRYPTAI_API_KEY')

}

response = requests.request("POST", url, json=payload, headers=headers)

formatted_response = json.dumps(json.loads(response.text), indent=4)
print(formatted_response)

De-anonymization response:

{
	"text": "John Everyman, born on January 1, 1970, at 123 Birth Lane, Smalltown, USA, embarked on a journey filled with diverse experiences and milestones. His Social Security number, 456-45-6789, was issued in his home state, marking the beginning of his financial footprint. Here is my email: example@example.com",
	"key": "e0d23d58abe14b2babb3be5aeab8250e"
}