Class PiiGuardrail

java.lang.Object
com.tnsai.quality.tracing.guardrail.PiiGuardrail
All Implemented Interfaces:
Guardrail

public final class PiiGuardrail extends Object implements Guardrail
Basic regex-based PII detection guardrail.

Detects common PII patterns: email addresses, phone numbers, and SSN-like numbers. This is a heuristic detector intended as a first line of defense, not a replacement for dedicated PII detection services.

  • Constructor Details

    • PiiGuardrail

      public PiiGuardrail()
  • Method Details

    • name

      public String name()
      Description copied from interface: Guardrail
      Returns the unique name of this guardrail.
      Specified by:
      name in interface Guardrail
    • evaluate

      public GuardrailResult evaluate(String input, String output)
      Description copied from interface: Guardrail
      Evaluates the given input/output pair.
      Specified by:
      evaluate in interface Guardrail
      Parameters:
      input - the input text (user prompt or tool input), may be null
      output - the output text (agent response or tool output), may be null
      Returns:
      the evaluation result