Guardrails to Stop Chatbot Prompt Injection

Given a set of requirements, implement security controls for AI systems. Explain how AI enables or enhances attack vectors.

A customer-facing, AI-powered chatbot has been jailbroken through prompt injections. As a result, the AI model is offering a 99% discount on the purchase of a new vehicle. Which of the following should be implemented to enhance the model’s robustness against such attacks?

  1. Bias filtering
  2. System prompt
  3. Log monitoring
  4. Guardrails Correct Answer
Answer Correct answer: D — Implement guardrails that constrain the chatbot's inputs, outputs, and permitted actions so prompt injections cannot trigger an unauthorized 99% vehicle discount.

Community Insight

The question tests which control makes an LLM robust to jailbreaks and prompt injection; the trap is picking a system prompt (which injection itself bypasses) or log monitoring (which only detects harm after it happens).

When a customer-facing AI chatbot is jailbroken via prompt injection and begins granting an unauthorized 99% vehicle discount, the corrective control is model guardrails. This page explains why input/output guardrails outperform system prompts, log monitoring, and bias filtering for hardening an LLM against injection attacks.

The most common wrong pick is B, System prompt. Learners assume instructions in the system prompt protect the model, but prompt injection is precisely the technique for overriding or subverting those instructions, so a system prompt alone does not enhance robustness.

Community Discussion (1 comments)

Kristen8730 👍 1 Selected: D
Enforce restrictions on model inputs/outputs and actions, making the application more resistant to jailbreaks and prompt injection.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Guardrails (D) are runtime enforcement controls that validate, filter, and constrain both what goes into a model and what it is permitted to do — such as capping discount authority, blocking policy-violating outputs, and requiring human approval for high-impact actions. Kristen8730's comment captures this precisely: guardrails "Enforce restrictions on model inputs/outputs and actions, making the application more resistant to jailbreaks and prompt injection." Because the failure mode here is a manipulated model taking a business action (a 99% vehicle discount), only a control that constrains outputs and downstream actions directly raises the model's robustness against the attack class described.

Why the Other Options Are Wrong

A, Bias filtering, addresses fairness and discriminatory outputs (stereotype or demographic skew) — it is not a defense against adversarial instruction hijacking. B, System prompt, is a static instruction that defines role and behavior, but prompt injection works by overriding or corrupting exactly those instructions, so it is the attack surface rather than the fix. C, Log monitoring, is a detective control that surfaces the anomalous discount after the transaction is initiated or completed; it improves detection and forensics but does not make the model itself more robust to the injection.

Community Comment Notes

The single comment on this item lands on D and the reasoning is sound: resistance to jailbreaks and prompt injection comes from enforcing restrictions on inputs, outputs, and actions. There is no contradicting vote data or counter-argument in the thread, so the community consensus and the vendor-style exam doctrine align on guardrails as the appropriate preventive hardening control.

Official Reference

Exam Strategy

On CompTIA AI+ style items, separate preventive, detective, and fairness controls: anything that blocks or constrains malicious inputs/outputs is a guardrail, whereas logging is detective and bias filtering is fairness-related. If the stem asks for enhanced robustness or prevention, choose the runtime enforcement control, not the monitoring control.

Frequently Asked Questions

Why is a system prompt not enough to stop this jailbreak attack?

A system prompt is a static instruction that prompt injection is specifically designed to override or corrupt. Robustness requires runtime guardrails that validate inputs, filter outputs, and limit the actions the model may take.

Why isn't log monitoring the right answer for enhancing model robustness?

Log monitoring is a detective control: it shows that an anomalous discount occurred, possibly after the fact. The question asks for a control that makes the model more resistant to the attack, which is a preventive guardrail.

More CY0-001 FAQ →

Related Analysis

← Back to CY0-001 Study Guide