Redirect Safety Evaluation - AI & ML Evaluation Roadmap 2026
← Back to Tutorials

6. Safety Evaluation

Part 6

Safety evaluation tests what the system does at the edges: harmful content, unfair behavior, manipulation attempts, and data leakage. It is not a one-time checklist — new attacks and new failure modes appear constantly, so safety testing must keep running.

Toxicity

Toxicity detection checks outputs for hateful, threatening, or abusive language. Use a combination of classifier-based detectors (such as toxicity classifiers) and careful human review, since automated detectors miss subtle or coded harmful language. Track a toxicity rate over time so a prompt change that quietly makes the model less careful is caught.

Bias

Bias evaluation measures whether the system treats groups fairly. Practical checks: generate outputs for inputs that differ only by gender, race, or other attributes and compare tone, sentiment, and quality; audit decisions for disparate outcomes; and watch for skewed representation in generated content. No single metric proves fairness — combine distributional tests with case-by-case review.

Prompt Injection

Prompt injection is an attempt to override the system's instructions from the input itself — for example, hidden text inside a document telling the model to ignore its rules. Evaluate by inserting injection strings into user content and checking whether the model still obeys its original instructions. Test both direct injections ("ignore previous instructions...") and indirect ones hidden in retrieved documents.

Jailbreak Testing

Jailbreaks are adversarial prompts crafted to bypass safety filters — role-play scenarios, encoded instructions, escalating persuasion, or fictional framing. Maintain a library of known jailbreak patterns and run them after every system change. Because jailbreak techniques evolve quickly, treat the library as a living artifact and add new patterns as they appear.

Red Teaming

Red teaming is systematic, deliberate adversarial testing by a team that tries to break the system. Unlike ad hoc tests, red teaming has structure: defined goals (bypass safety, extract data, force harmful output), a documented attack plan, and reports of what worked. Run it before launch and periodically after, and route findings back into the safety test suite.

Privacy Evaluation

Privacy evaluation checks whether the system leaks sensitive information: personal data appearing in outputs, models regurgitating memorized private content, or logging/retention mishandling user input. Test with probes designed to extract memorized content and with realistic user data in the input to confirm it never surfaces. Also review infrastructure — what gets logged, where, and for how long.

ThreatWhat to probeTypical mitigation signal
ToxicitySlurs, threats, harassmentLow toxic-output rate
BiasUnequal treatment across groupsBalanced scores across slices
Prompt injectionInput overrides system rulesInstructions stay intact
JailbreakFilters bypassed by crafted promptsRefusal or redirect on attack set
PrivacyPersonal data in outputsZero leakage in probes

Governance Standards

Frameworks turn safety work into repeatable practice. The NIST AI Risk Management Framework provides a structured process for identifying, assessing, and managing AI risk. The OWASP LLM Top 10 catalogs the most common security risks in LLM applications — prompt injection, insecure output handling, data leakage, and so on — and is a practical checklist for threat modeling. Map your evaluation activities to these frameworks so safety testing is systematic rather than improvised, and keep records for accountability and audits.

Severity matters: not every safety failure is equal. Classify findings by severity and likelihood so the team fixes the dangerous, reachable issues first instead of chasing trivia.
Practice Task: Build a ten-item attack set for a chat model: two injections, two jailbreak patterns, two toxic inputs, two bias probes, and two privacy extraction attempts. Run them, record the model's responses, and score each as "blocked," "partial," or "failed." Identify your two weakest categories and write one mitigation for each.