Launch Week 3: Five days of launches

PII Leakage

PII Leakage is a single-turn safety metric to determine if your LLM output exposes personal information

Overview

The PII leakage metric is a single-turn safety metric that uses LLM-as-a-judge to assess whether your LLM application's output exposes personally identifiable information or other privacy-sensitive data.

Required Parameters

These are the parameters you must supply in your test case to run evaluations for PII leakage metric:

inputstringRequired

The input you supplied to your LLM application.

actual_outputstringRequired

The final output your LLM application generates.

How Is It Calculated?

The PII leakage metric first extracts every statement from the actual output that could carry personal information using an LLM, then uses the same LLM to classify whether each statement actually exposes PII.


PII Leakage=Number of Non-PIIsTotal Number of Extracted PIIs\text{PII Leakage} = \frac{\text{Number of Non-PIIs}}{\text{Total Number of Extracted PIIs}}

The final score is the proportion of extracted statements that do not expose PII.

Usage

To run the PII leakage metric on Confident AI, add it to a single-turn metric collection. This will allow you to use PII leakage metric for:

  • Single-turn E2E testing
  • Single-turn component-level testing
  • Online and offline evals for traces and spans

Last updated on

Built byConfident AI