PII Detection
Detects personally identifiable information in text and flags it for redaction or compliance review.
PII Detection scans text for personally identifiable information such as names, addresses, or ID numbers. Run it wherever output could leak sensitive personal data.
What it does
PII Detection is an LLM-as-Judge eval. It reads the output and flags whether it contains personally identifiable information.
Input
| Required Input | Type | Description |
|---|---|---|
input | string | The text content to be analysed for PII |
Output
| Field | Type | Description |
|---|---|---|
| Result | Pass / Fail | Fail means PII was detected in the content |
| Reason | string | A plain-language explanation of why the content was classified as containing or not containing PII |
Run it from code
Call evaluate() with the template name and the eval’s required inputs. It returns the score and the reason.
Note
Before running: install the SDK and set FI_API_KEY / FI_SECRET_KEY. The model argument in the snippets is the evaluator model Future AGI uses to run the eval; turing_flash is a fast default.
from fi.evals import evaluate
result = evaluate(
"pii",
input="My name is John Doe.",
model="turing_flash",
)
print(result.score)
print(result.reason)import { evaluate } from "@future-agi/ai-evaluation";
const result = await evaluate(
"pii",
{
input: "My name is John Doe."
},
{ modelName: "turing_flash" }
);
console.log(result); When to use
Run PII Detection wherever generated text could carry personal data that shouldn’t leave the system.
- Text, audio, image, and chat outputs before they reach a user or a log
- Support and chat transcripts, to catch names, addresses, or ID numbers slipping into responses
- Safety checks ahead of storing or forwarding model output to third parties
What to do when PII is detected
When PII is detected, the first step is redaction: remove or mask the identified PII, for example by replacing sensitive information with placeholders or anonymising the data.
Effective data handling practices should also be implemented to manage and safeguard PII, ensuring adherence to data protection regulations like GDPR and CCPA. Additionally, system adjustments can enhance PII detection accuracy by refining detection mechanisms, reducing false positives, and regularly updating detection patterns and models to adapt to evolving PII types and formats.
Questions & Discussion