Lesson 20 of 30
Filtering only what goes into the model catches abusive requests, but not harmful things the model itself might generate from an innocent-looking prompt — real protection needs both directions, not just one.
11 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
A team moderates every user prompt before it reaches the model but does not check the model's responses. What real failure mode does this leave uncovered?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
Guardrails are the checks and constraints placed around a model to keep its behavior within acceptable bounds. Content moderation is one concrete form of that: filtering for harmful, abusive, or policy-violating content. The part that's easy to under-build is that this needs to run in both directions:
Input-only filtering misses two real cases. First, a model can produce harmful output from a prompt that wasn't obviously harmful at all — the harm shows up only in the completion, not in anything that was typed in. Second, as this track's lesson on prompt injection covers, content the model reads (a webpage, an uploaded document) can carry injected instructions that never passed through input moderation as "the user's request" at all, but still shape what the model outputs. Output moderation is the layer that catches both of those, which input moderation structurally cannot.
Guardrails aren't limited to a dedicated moderation API, either. A system prompt constraint — telling a model what it's allowed to talk about, or what source of truth to stick to — is itself a lightweight guardrail. It's just enforced by instruction rather than by a separate filtering pass.
Praxis's own lib/ai/prompts/tutor.ts and lib/ai/prompts/interview.ts system prompts include a rule like this:
Answer ONLY using the provided lesson context. If the question is outside
it, say you're not certain rather than inventing facts.
That single instruction is a guardrail, doing real work with no dedicated moderation API involved: it constrains the model to a specific, grounded source of truth and explicitly tells it what to do when a question falls outside that boundary, instead of leaving it free to fabricate a plausible-sounding but ungrounded answer. It's lightweight compared to a dedicated content-moderation service, but it's the same underlying idea — a deliberate constraint on model behavior, chosen because the unconstrained default (answer anything, from anywhere) was a real risk (hallucinated tutoring content) worth closing off.
tutor.ts/interview.ts is a legitimate, load-bearing example — dismissing prompt-level constraints as not counting misses a whole category of practical, low-overhead risk reduction."Your app only checks user input before sending it to the model — is that enough?" tests whether a candidate can name the specific gap (harmful output from a benign prompt, or injected content bypassing input checks entirely) rather than just agreeing that input filtering sounds sufficient.