AI Governance - PII Detection
Automatically detect and protect sensitive personal information in your AI operations. Part of comprehensive AI Governance for risk management and compliance.
Automatic PII Detection
ANTS Platform automatically detects sensitive data:
typescript
// instrumentation.ts — run once at startup, imported before app code
const provider = new NodeTracerProvider({
spanProcessors: [
new AntsPlatformSpanProcessor({
publicKey: process.env.ANTS_PLATFORM_PUBLIC_KEY,
secretKey: process.env.ANTS_PLATFORM_SECRET_KEY,
baseUrl: "https://api.agenticants.ai",
}),
],
});
provider.register();
setAntsPlatformTracerProvider(provider);
typescript
// Trace a customer query — PII is detected and redacted server-side
await startActiveObservation("span", { name: "customer-query" }, async (span) => {
span.update({
input: "My SSN is 123-45-6789 and email is john@example.com",
});
// ... handle the query ...
});
// In the dashboard (https://app.agenticants.ai) this trace shows:
// - PII Types: SSN, Email
// - Action: Redacted
// - Alert: Security team notified
Supported PII Types
- Social Security Numbers
- Email addresses
- Phone numbers
- Credit card numbers
- IP addresses
- Physical addresses
- Dates of birth
PII Configuration
PII detection types and redaction settings (method, format preservation, which types are enabled) are configured from the dashboard at https://app.agenticants.ai. There is no programmatic configuration API in the SDK — enable detection and choose redaction behavior under your project's AI Governance settings.
Once configured, any traces you send are scanned automatically. The Python example below instruments a function so its inputs and outputs flow to the platform:
python
from ants_platform import AntsPlatform, observe
# Configure the client once (or set ANTS_PLATFORM_* env vars and use get_client())
AntsPlatform(
public_key="pk_...",
secret_key="sk_...",
host="https://api.agenticants.ai",
)
@observe(name="customer-query")
def handle_query(text: str) -> str:
# Inputs/outputs are captured and scanned for PII server-side
return respond(text)
handle_query("My SSN is 123-45-6789 and email is john@example.com")