The Privacy Layer for your AI Stack.

Sanitize prompts in real-time with our open-source SDK. Run PII detection locally via WebAssembly or deploy the Sidecar to your VPC for centralized governance.

npm i rehydra

import { createAnonymizer } from 'rehydra';

const anonymizer = createAnonymizer({
  ner: { mode: 'quantized' },
  semantic: { enabled: true }
});

await anonymizer.initialize();

const result = await anonymizer.anonymize(
  'Hello John Smith from Acme Corp in Berlin!'
);
Hello <PII type="PERSON" gender="male" id="1" /> 
from <PII type="ORG" id="2" /> in 
<PII type="LOCATION" scope="city" country="Germany" id="3" />

FAQ

Frequently Asked Questions

Does the SDK require an internet connection?

Can I detect custom identifiers specific to my domain (e.g., Order Numbers)?

You can define custom regex-based recognizers using createCustomIdRecognizer. You provide a pattern, a name, and a PII type (usually CASE_ID or CUSTOMER_ID). Example:

Is the PII mapping data secure?

What is the difference between the "standard" and "quantized" NER models?

How does rehydra improve Machine Translation (MT) context for anonymized entities?

Does the SDK require an internet connection?

Can I detect custom identifiers specific to my domain (e.g., Order Numbers)?

You can define custom regex-based recognizers using createCustomIdRecognizer. You provide a pattern, a name, and a PII type (usually CASE_ID or CUSTOMER_ID). Example:

Is the PII mapping data secure?

What is the difference between the "standard" and "quantized" NER models?

How does rehydra improve Machine Translation (MT) context for anonymized entities?

Does the SDK require an internet connection?

Can I detect custom identifiers specific to my domain (e.g., Order Numbers)?

You can define custom regex-based recognizers using createCustomIdRecognizer. You provide a pattern, a name, and a PII type (usually CASE_ID or CUSTOMER_ID). Example:

Is the PII mapping data secure?

What is the difference between the "standard" and "quantized" NER models?

How does rehydra improve Machine Translation (MT) context for anonymized entities?