Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an LLM Content Safety Service

Design a low-latency safety service that evaluates LLM interactions against versioned policy while handling contextual and adaptive abuse.

Problem statement

For this exercise, assume an online LLM application sends each user prompt, retrieved context, and generated response to a text-safety service before returning content to the user.

The service classifies direct policy violations and LLM-specific threats such as jailbreaks, obfuscation, and harmful intent that develops over several turns. It returns an allow, block, redact, or human-review decision with policy and detector versions.

Policy owners can publish versioned harm taxonomies and thresholds, and reviewers can adjudicate uncertain cases so their outcomes become traceable feedback. Preserve enough decision metadata for audits without making raw conversation text broadly available.

Text moderation is in scope; image and audio moderation, foundation-model training, legal policy definition, and user appeals are outside scope.

What to build

  1. The LLM application can submit a prompt, retrieved context, generated response, and conversation reference and receive an allow, block, redact, or review decision with stable reason codes.
  2. Policy owners can publish immutable taxonomy, threshold, and detector configurations and roll them out or roll them back without mixing decision provenance.
  3. Authorized reviewers can claim uncertain cases, record adjudications, and produce traceable feedback linked to the original policy and detector versions.
  4. Authorized operators can inspect decision metadata and aggregate quality and latency signals by policy, detector, model, and outcome.

At scale

  • For this exercise, assume a peak of 20,000 online moderation decisions per second and a 150 millisecond p99 safety-service budget.
  • For this exercise, target 99.99% availability and define an explicit fail-open, fail-closed, or degraded policy for every unavailable detector dependency.
  • For this exercise, retain auditable decision metadata for 90 days and restrict access to raw text independently from the metadata lifecycle.