presidio Classifier
presidio Classifier
Defines a classifier that detects personal and sensitive data using a Microsoft Presidio analyzer service.
The presidio classifier sends the text to the analyzer's /analyze endpoint and reports a label as detected when the analyzer finds the corresponding entity, such as EMAIL_ADDRESS or CREDIT_CARD, at or above the configured score threshold. Presidio recognizes content that a fixed expression can't, such as a person's name or a location.
classifiers:
presidio0:
type: presidio
options:
endpoint: http://presidio-analyzer:3000
threshold: 0.5
labels:
email: EMAIL_ADDRESS
card: CREDIT_CARDA classifier is applied to a message value by the classify model. An empty value is never detected. If the analyzer can't be reached, times out, returns an error, or returns a malformed response, the value is treated as detected, so the message is rejected rather than passed through unchecked.
Configuration (* required)
type: presidio
const
Specifies the classifier is presidio.
options*
object
The presidio specific options.
options:
endpoint: http://presidio-analyzer:3000
credentials:
authorization: Bearer ${{env.PRESIDIO_TOKEN}}
language: en
threshold: 0.5
timeout: PT5S
labels:
email: EMAIL_ADDRESSoptions.endpoint*
string| Pattern:^https?://[^?#]+$
Base URL of the Presidio analyzer service. The analyze path is appended to it. A query string or fragment is not allowed.
options.credentials
object
Credentials presented to the analyzer.
options.credentials.authorization
string
Value sent as the Authorization header on each request.
options.language
string| Default:"en"
Language of the text, as understood by the analyzer.
options.threshold
number| Minimum:0| Maximum:1| Default:0
Minimum analyzer confidence score, between 0 and 1, for an entity to count as detected. It is sent to the analyzer as score_threshold. When 0, the analyzer's own threshold applies.
options.timeout
string| Format:duration| Default:"PT5S"
Maximum time to wait for the analyzer, as an ISO-8601 duration. PT0S disables the timeout.
options.labels
objectas map ofstring
Named labels to detect, each mapped to a Presidio entity type, such as EMAIL_ADDRESS, PERSON, PHONE_NUMBER, CREDIT_CARD or US_SSN. An entity type is either one of Presidio's built-in entities or a custom entity name of upper-case letters, digits and underscores, starting with a letter, such as EMPLOYEE_BADGE, for use with a custom recognizer registered on the analyzer.
labels:
email: EMAIL_ADDRESS
badge: EMPLOYEE_BADGEWhen omitted, a label name used by a consumer is sent to the analyzer as the entity type itself. When present, at least one label is required, and only the labels listed can be referred to.

