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

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-5555Which of the following is the most effective way to prevent prompt injection attacks against a large language model (LLM)?
A) Guardrails
B) Antivirus
C) Web application firewall (WAF)
D) Role-based access control

CompTIA CY0-001 Exam - Topic 2 Question 7 Discussion

Actual exam question for CompTIA's CY0-001 exam
Question #: 7
Topic #: 2
[All CY0-001 Questions]

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)?

Show Suggested Answer Hide Answer
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.


Contribute your Thoughts:

0/2000 characters

Currently there are no comments in this discussion, be the first to comment!


Save Cancel