Interface Classifier


public interface Classifier
A classifier maps an input to a Classification — a score and/or label, with optional confidence and metadata. Can be implemented with rules or regex, embeddings, traditional ML, a small specialised model, a prompted or fine-tuned LLM, or an external classification API — the implementation is just user code calling out to whatever it needs.

An implementation has a public constructor into which the platform's managed dependencies can be injected — including a ClassifierClient, for composing other configured classifiers (for example, an ensemble classifier combining several underlying ones), and a ClassifierContext for the classifier's configured name and config section.

Unlike a Guardrail, a classifier is never bound to a call boundary and is never dispatched by the runtime. It is invoked inline, wherever a guardrail, an evaluator, or application code needs it, through an injected ClassifierClient by name.

Classifiers are enabled with configuration; see agent documentation.