What a protected class proxy looks like in a prompt
A protected class proxy is a term, phrase, or feature in a prompt that can stand in for a protected characteristic, even when that characteristic is never named. Proxies can enter a prompt from several sources: the user's own input, context retrieved from other systems, and results returned by tools.
Because the model responds to the whole assembled prompt, that assembled prompt is the right unit to inspect. Checking only the user's message would miss proxies that arrive through retrieved context or tool results.
Where to intercept
Intercept at the point where the prompt is fully assembled and before it is sent to the model. At that point the prompt contains everything the model will see, so a single inspection step covers all three input sources:
- User input: text entered directly by the user.
- Retrieved context: content pulled into the prompt from other sources.
- Tool results: output returned to the prompt by tools and agent workflows.
A detection pipeline from interception to audit
Inline proxy detection follows four stages. Each stage runs for every prompt, so that every decision has a record.
Intercept
Capture the assembled prompt, retrieved context, and tool results before the model call.
Detect
Run pattern, entity, statistical, or classifier checks for proxy features.
Enforce
Apply block, redact, flag, or escalate based on use-case policy.
Record
Log each decision with enough context to support review.
Enforcement actions
Detection hits are evaluated against the policy for the specific use case, and the result determines one of four actions:
- Block: stop the prompt from reaching the model.
- Redact: remove the flagged content before the model call.
- Flag: allow the prompt and mark it for review.
- Escalate: route the decision for further review.
Audit logging
Write an audit record for every decision, not only for blocked prompts. Each record should carry enough context to support later review of what was detected, which policy applied, and which action was taken.
Runtime detection compared with design-time bias testing
Runtime detection and design-time bias testing address different points in the lifecycle. Runtime detection acts on the prompts that actually reach the model. Fairness testing and legal review remain necessary, and runtime detection does not replace either.
| Aspect | Runtime detection | Design-time bias testing and legal review |
|---|---|---|
| When it applies | Inline, before each model call | At design time |
| What it inspects | The final assembled prompt, including retrieved context and tool results | Complements runtime detection; not replaced by it |
| What it produces | An enforcement action and an audit record for every decision | Findings that inform design and policy |
Detection techniques and their tradeoffs
The recommended approach combines several techniques rather than relying on one. Pattern, entity, statistical, and classifier checks can all be used to look for proxy features, and a classifier is optional.
| Technique | Role in the pipeline | Consideration |
|---|---|---|
| Dictionary matching | Checks prompt text for known proxy terms and patterns | Part of the core combination |
| Entity recognition | Identifies entities in the assembled prompt that may act as proxies | Part of the core combination |
| Statistical checks | Looks for proxy features using statistical signals | Choose according to use-case policy |
| Classifier | Adds a model-based check for proxy features | Optional |
Whichever techniques are combined, their hits are not decisions on their own. They are evaluated against use-case policy, and the policy determines whether the prompt is blocked, redacted, flagged, or escalated.
Limits, governance, and evaluation
Runtime detection is one control among several. It does not replace fairness testing or legal review, and it should be governed alongside them.
- Scope: detection covers what is in the assembled prompt at the interception point, so every path that adds content to a prompt needs to pass through it.
- Policy: actions depend on use-case policy, so the same hit may lead to different outcomes in different use cases.
- Evidence: audit records for every decision give reviewers the context they need to evaluate how detection and enforcement are performing.