Guardian Layer
Guardian Layer is CustodianAI's proprietary detection layer. It identifies domain-specific sensitive content that standard NER-based compliance modes miss — proprietary terminology, internal identifiers, and contextually sensitive language specific to your organization or industry.
Use it when your documents contain sensitive information that doesn't fit standard PII categories.
Basic usage
Set compliance_mode to "PROPRIETARY" on the de-identification endpoint:
import requests
response = requests.post(
"https://api.custodianai.com/api/v1/deidentify/text",
headers={"X-API-Key": "cai_your_key_here"},
json={
"text": "The Q3 results for Project Helix exceeded targets by 18%.",
"compliance_mode": "PROPRIETARY",
"domain": "General",
},
).json()
print(response["output_text"])
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
domain | str | "General" | Content domain. See Compliance Modes for options |
replacements | dict | None | Pre-supplied replacement map. When provided, Guardian Layer applies it directly without running detection |
Output modes
The masking_type parameter on the /deidentify/text/proprietary/outputs endpoint controls what detected terms are replaced with:
| Value | Behaviour | Example output |
|---|---|---|
redact | Replace with ***** | "Project ***** exceeded targets" |
transform | Replace with a plausible alternative that preserves readability | "Project Falcon exceeded targets" |
redact is stricter; transform produces output that reads naturally and is harder to identify as redacted.
Entity filtering
By default, Guardian Layer targets all detected sensitive content. Use pii_entities to limit detection to specific categories:
response = requests.post(
"https://api.custodianai.com/api/v1/deidentify/text/proprietary/outputs",
headers={"X-API-Key": "cai_your_key_here"},
json={
"text": "Dr. Emily Chen reviewed trial NX-4401 on March 3rd.",
"domain": "General",
"masking_type": "redact",
"pii_entities": ["PERSON", "ID_NUMBER"],
},
).json()
Pass null or ["ALL"] to target everything detected. See Supported Entities for the full list of values.
Alternative outputs
The /deidentify/text/proprietary/outputs endpoint returns two independently de-identified versions of the input text. Useful for review workflows or generating synthetic training data from sensitive documents.
response = requests.post(
"https://api.custodianai.com/api/v1/deidentify/text/proprietary/outputs",
headers={"X-API-Key": "cai_your_key_here"},
json={
"text": "The Meridian account is managed by Dana Reyes.",
"domain": "General",
"masking_type": "transform",
},
).json()
print(response["outputs"][0]["text"]) # first alternative
print(response["outputs"][1]["text"]) # second alternative
→ API Reference: /deidentify/text/proprietary/outputs
Detection only
To run Guardian Layer detection without modifying the text — useful for auditing or building review UIs — use the analyze endpoint:
response = requests.post(
"https://api.custodianai.com/api/v1/analyze/text/proprietary",
headers={"X-API-Key": "cai_your_key_here"},
json={
"text": "The Meridian account is managed by Dana Reyes.",
"domain": "General",
},
).json()
print(response["sensitive_words"])
→ Detection vs. De-identification · API Reference: /analyze/text/proprietary