?
detectPII
Scan text for personally identifiable information using Microsoft Presidio.
mindstudio.detectPII({ input, language, entities }) → Result
Scans text for personally identifiable information using Microsoft Presidio and returns the entities it finds. Use it to flag or gate content before storing or sending it; redactPII is the counterpart when you want the values replaced in place rather than listed.
Parameters
input
string
RequiredText to scan for personally identifiable information
language
string
RequiredLanguage code of the input text (e.g. "en")
entities
string[]
RequiredPII entity types to scan for (e.g. ["PHONE_NUMBER", "EMAIL_ADDRESS"]). Empty array means nothing is scanned.
detectedStepId
string
Step to transition to if PII is detected (workflow mode)
notDetectedStepId
string
Step to transition to if no PII is detected (workflow mode)
outputLogVariable
string | null
Variable name to store the raw detection results
Call from a method
import { mindstudio } from '@mindstudio-ai/agent'; const result = await mindstudio.detectPII({ input: /* ... */, language: /* ... */, entities: /* ... */ });