Mental model
An audit label is a compact, versioned statement about one safety evaluation, not a universal certificate that a model or output is safe. It should identify the policy and evaluator, report a scoped outcome with evidence freshness, and link to the underlying record. People must be able to distinguish blocked, routed for review, pending, and unassessed results.
Learning outcomes
- Separate a moderation model’s flags and category scores from an application’s policy decision.
- Calculate category-specific recall and false-positive rate from a labeled evaluation set.
- Publish a label whose status, provenance, and evidence remain understandable to people using assistive technology.
Theory
A safety-labeling pipeline starts with a defined unit of evaluation: a user message, a generated answer, an image, or a complete conversation turn. The unit determines what a denominator means. Store its identifier or a privacy-preserving reference, the input modality, evaluation time, evaluator model and version, policy identifier and revision, applicable harm categories, result state, and a pointer to the evaluation record. A screenshot of a green badge is not an audit trail.
Moderation APIs return fields such as flagged, category indicators, and category scores. Those fields describe an evaluation signal; the application still has to apply its policy. The moderation documentation explicitly treats scores as signals for application policy and recommends checking the result type because a failed evaluation may return an error instead of scores. Map each relevant category to an action chosen for the deployment context: allow, request human review, or block. If the evaluation failed, a required score is absent, or the policy revision is unknown, the result is unassessed, never a silent allow.
The NIST AI Risk Management Framework treats measurement as contextual risk work: define what harm matters, evaluate it with documented methods, track uncertainty, and use results to inform management. Therefore a single average score across unrelated categories can hide a weak detector for one important risk. Keep per-category thresholds and versioned test sets. A threshold selected for a text support bot is not automatically suitable for an image classifier, a new model revision, or a different user population.
For harm category and policy threshold , define as reference-positive examples routed to review or blocked, as all reference-positive examples, as reference-negative examples routed to review or blocked, and as all reference-negative examples. Both rates are dimensionless proportions:
In a toy held-out evaluation, reviewers label 120 examples as requiring intervention and 400 as not requiring it. If 96 of the first group are sent to review or blocked, recall is or 80%. If 24 of the second group are also routed, the false-positive rate is or 6%. These invented counts illustrate the calculation; they are not a moderation model benchmark. A real report should include dataset period, labeler process, category, model revision, threshold, and uncertainty alongside each rate.
Implementation
The policy mapping below keeps the disposition separate from the raw evaluator output. Thresholds are illustrative application settings that must be chosen and checked against a relevant evaluation set. Missing scores or an evaluator error stop label creation rather than falling through to “allow.”
typescripttype Run =| { status: "error"; evaluator: string; modelRevision: string; evaluatedAt: string }| { status: "complete"; evaluator: string; modelRevision: string; evaluatedAt: string;flagged: boolean; categoryScores: Record<string, number> };type Rule = { reviewAt: number; blockAt: number };type Policy = { id: string; revision: string; categories: Record<string, Rule> };type Disposition = "allow" | "review" | "block" | "unassessed";export function makeSafetyLabel(run: Run, policy: Policy, evidenceRef: string) {const provenance = { evaluator: run.evaluator, modelRevision: run.modelRevision,policyId: policy.id, policyRevision: policy.revision, evaluatedAt: run.evaluatedAt, evidenceRef };const unassessed = (reason: string) => ({ ...provenance, disposition: "unassessed" as const, reason });if (run.status === "error") return unassessed("Evaluator returned an error");if (Object.keys(policy.categories).length === 0) return unassessed("Policy has no categories");let disposition: Disposition = "allow";for (const [category, rule] of Object.entries(policy.categories)) {const score = run.categoryScores[category];const validRule = Number.isFinite(rule.reviewAt) && Number.isFinite(rule.blockAt) &&rule.reviewAt >= 0 && rule.reviewAt < rule.blockAt && rule.blockAt <= 1;if (!validRule || score === undefined || !Number.isFinite(score) || score < 0 || score > 1) {return unassessed(`Invalid or missing ${category} evidence`);}if (score >= rule.blockAt) disposition = "block";else if (score >= rule.reviewAt && disposition !== "block") disposition = "review";}if (run.flagged && disposition === "allow") disposition = "review";return { ...provenance, disposition };}export function renderSafetyLabel(root: HTMLElement, disposition: Disposition, detail: string) {const label = document.createElement("p");label.textContent = `Safety evaluation: ${disposition}. ${detail}`;if (disposition === "review" || disposition === "unassessed") label.setAttribute("role", "status");root.replaceChildren(label);return label;}
Trade-offs
An explicit unassessed state preserves the difference between “the check ran and found no policy trigger” and “the check could not produce evidence.” That state can interrupt a workflow or require a fallback, but collapsing it into allow hides outages and missing fields. A visible review queue costs staff time; tune it with per-category evaluation data and the consequence of a missed case, not by choosing whichever threshold makes the badge look reassuring.
Expose a concise disposition first, then let authorized reviewers open the audit record for category, score, policy revision, dataset scope, and evaluation time. Keep the number’s meaning beside it: a model score is not inherently a calibrated probability or a universal risk percentage. If the record is signed or stored immutably, the signature helps detect later alteration; it does not show that the test set was representative or that the evaluator was correct.
For a changing result, use a visible pending state until the full evaluation finishes. Streamed output may be available before moderation scores arrive, so do not paint a partial response with a final “checked” badge. In a review interface, pair color with text and keep important status messages available long enough to read. W3C’s alert guidance describes when dynamically rendered urgent messages should be announced; use an alert only for an interrupt-worthy event, and use a non-interruptive status for routine updates.
Failure modes and misconceptions
- “No flag” means universally safe. It means only that this evaluator and policy did not trigger for this input and version; uncovered harms remain unknown.
- One aggregate score hides a category regression. Keep per-category counts and rates, and compare the same labeled set when revisions change.
- Evaluation errors default to allow. Preserve
unassessed, surface the operational fault, and apply the service’s explicit fallback policy. - A threshold migrates without re-evaluation. Model, prompt, modality, policy, and population changes can shift score distributions; version the threshold and re-run the holdout.
- A green color is the whole label. Include written status, policy revision, and a usable route to details; do not rely on hue alone.
- A signature proves a safety claim. It can establish record integrity and origin, not model correctness, coverage, or suitability for a deployment.
Decision scenario
An image moderation service is being upgraded to a new evaluator. Its latency improves, but the new run occasionally returns an error and its scores are not directly comparable with the old model’s scores. Keep the previous policy active for the old revision, mark failed new evaluations as unassessed, and hold promotion until the new model has a version-specific, category-level evaluation with reviewed examples. Show the failure status to operators and preserve the evidence record; do not convert the missing score to an allow label.