Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CompTIA CY0-001 Exam - Topic 2 Question 7 Discussion

Posted by Margurite on Jun 20, 2026 at 05:38 PM

An internal user enters a client credit card number into an internal generative machine learning (ML) model:

#User prompt: Customer Jane Doe has a new credit card that she wants to add to her account. The number is 5555-5555-5555-5555

Which of the following is the most effective way to prevent prompt injection attacks against a large language model (LLM)?

Suggested Answer: A

Basic Concept: Prompt injection occurs when malicious content embedded in user input manipulates an LLM's behavior, causing it to leak sensitive data, bypass restrictions, or execute unintended actions. Preventing such attacks requires mechanisms that inspect and filter content at the prompt level. CompTIA SecAI+ covers LLM-specific security controls extensively.

Why A is Correct: Guardrails are purpose-built controls that inspect, filter, and constrain both input prompts and output responses in LLM systems. They can detect sensitive data patterns such as credit card numbers, block prompt injection payloads, enforce content policies, and prevent the model from processing or outputting restricted information. Guardrails are the primary LLM-native defense against prompt injection as cited in the CompTIA SecAI+ Study Guide.

Why B is Wrong: Antivirus software detects known malware signatures in files and executables. It does not inspect or understand the semantic content of LLM prompts and cannot detect or block prompt injection attacks.

Why C is Wrong: A WAF operates at the HTTP layer inspecting web requests and responses against rule sets. While it can block some patterns, it lacks the contextual intelligence to understand LLM prompt semantics and cannot prevent sophisticated injection attacks.

Why D is Wrong: Role-based access control manages who can access which resources. It controls authorization but does not inspect the content of prompts to prevent injection attacks once a user has legitimate access.


Get Premium CY0-001 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
MI
Mirta 2 months ago
I’m leaning towards A) Guardrails too. Prevents misuse effectively.
HA
Harris 2 months ago
I agree, but D) Role-based access control also seems strong. Limits access.
LE
Lera 2 months ago
I think A) Guardrails is the best option. It helps set boundaries.
DU
Dustin 2 months ago
D) Role-based access control is crucial for security, but not the main fix here.
KA
Katina 2 months ago
Wait, can you really use a credit card in a model like that? Sounds risky!
YO
Yolande 2 months ago
C) WAF seems useful, but not the best choice here.
AL
Alana 3 months ago
I think B) Antivirus is a bit off for this situation.
CA
Cassi 3 months ago
Definitely A) Guardrails, they help keep things in check.
JA
Jannette 3 months ago
I’m leaning towards guardrails as the answer since they seem to be designed for managing inputs in ML models, but I could be wrong.
GL
Glenna 3 months ago
Role-based access control sounds familiar, but I feel like it’s more about user permissions than directly preventing prompt injection.
DY
Dylan 3 months ago
I think we had a practice question about WAFs, but I can't recall if they protect against prompt injection or just general web threats.
LA
Latricia 4 months ago
I remember we discussed guardrails in class, but I'm not entirely sure how they specifically apply to prompt injection attacks.
0/2000 characters

Save Cancel