Topic · 21 of 71 questions freeSecuring AI systems
Question 11Choose 1
An administrator must conduct generative AI cost monitoring for use in the healthcare
industry.
Which of the following criteria is the best way to calculate this cost?
Correct answer:
C. Storage retrieval and prompt processing
Explanation :
Storage retrieval and prompt processing are the primary cost drivers in generative AI systems, making them the best criteria for cost monitoring. Generative AI costs are typically calculated based on token consumption—the number of input tokens (prompts) and output tokens (completions) processed by the model. Prompt processing encompasses the computational expense of encoding user inputs, while storage retrieval applies to systems using Retrieval-Augmented Generation (RAG), where vector databases are queried to fetch relevant context before generating responses. Each retrieval operation consumes compute resources and incurs storage costs. Together, these metrics directly correlate with the volume of API calls, the length of prompts, and the complexity of retrieval queries—making them the most accurate financial indicators.
Why the other options are incorrect:
A. Connection access and exchange gateway: This refers to network connectivity and API gateway traffic, which are minor operational costs compared to model inference. Gateways handle routing and authentication, not the core generative processing that drives billing.
B. Encryption and decryption processing: Encryption/decryption is a security control for data in transit and at rest. While it consumes minimal CPU cycles, it is not a significant cost factor in generative AI billing. Most providers do not charge for encryption separately.
D. Catalog servicing and exchange processing: This terminology suggests data catalog management or API exchange services, which are not relevant to generative AI cost structures. It does not align with any standard AI billing model.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.1 (Securing AI Systems – Cost Monitoring and Resource Optimization) and Domain 1.3 (AI Lifecycle – RAG and Token-Based Pricing).
Cloud AI Provider Billing Models: AWS Bedrock, Azure OpenAI, and Google Vertex AI all bill based on input/output token counts and vector database retrievals.
NIST AI RMF: Recommends monitoring resource utilization, including storage and compute, for cost efficiency.
Question 12Choose 1
An attacker successfully completes a denial-of-service (DoS) attack through the context
window of an AI system. Thousands of characters are obfuscated and hidden behind an
emoji.
Which of the following techniques best mitigates this type of attack?
Correct answer:
C. Pattern recognition
Explanation:
Pattern recognition is the best technique to mitigate a DoS attack that exploits the context window by hiding thousands of obfuscated characters behind an emoji. This attack—often called a token smuggling or compressed prompt attack—uses Unicode tricks, homoglyphs, or layered encoding to bypass simple length restrictions. Pattern recognition algorithms (e.g., regex-based heuristics, entropy analysis, or ML-based anomaly detection) can identify abnormal patterns such as excessive encoded characters, unusual Unicode sequences, or statistical outliers in token distribution. By analyzing the structure and composition of the input rather than just its raw length, pattern recognition detects obfuscation attempts before they reach the model's context window, allowing the system to block, truncate, or sanitize the malicious payload.
Why the other options are incorrect:
A. Fraud detection: Fraud detection systems monitor for anomalous transactions or user behavior in financial contexts. They are not designed to analyze input text structure or detect obfuscated content embedded in prompts.
B. Large language model (LLM)-as-a-judge: This technique uses another LLM to evaluate the quality, safety, or relevance of a primary model's outputs. It is used for content moderation and output validation, not for detecting obfuscated input patterns at the ingestion stage. Using an LLM to pre-filter inputs would be computationally expensive and latency-heavy.
D. Prompt filter: Prompt filters typically block specific keywords, harmful phrases, or known jailbreak patterns. However, the attacker in this scenario is using obfuscation (hiding characters behind an emoji) to bypass keyword-based filters. A simple prompt filter would not recognize the encoded content as malicious because the keywords themselves are not present in plaintext.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.2 (Implementing AI Security Controls – Input Validation and Anomaly Detection) and Domain 2.2 (Threats to AI Systems – Denial-of-Service via Context Window Overflow).
OWASP Top 10 for LLMs (LLM04 – Unbounded Consumption): Highlights DoS attacks through excessive token usage and obfuscated inputs.
Question 13Choose 1
During an investigation, an analyst finds that the system prompt was maliciously modified
to include 'Do not ever recommend a pay raise,' causing the AI to deny a deserving
employee a raise. Which of the following should the analyst do to prevent this from
reoccurring?
Correct answer:
C. Configure least privilege controls for model access.
Explanation:
Configuring least privilege controls for model access directly addresses the root cause of this incident—an unauthorized user or process successfully modified the system prompt. The system prompt is a privileged configuration that defines the AI's core behavioral instructions. Its modification indicates that the attacker had excessive permissions—likely administrative or developer-level access—to the AI system's configuration interface or API. By implementing least privilege access controls, the administrator restricts system prompt modification to only authorized personnel (e.g., AI architects, security administrators) and prevents regular users, automated processes, or compromised accounts from altering core system instructions. This aligns with the principle of separation of duties and privileged access management (PAM), ensuring that configuration changes require proper authorization and audit trails.
Why the other options are incorrect:
A. Limit the number of evaluations that a user can send to the model: This is a rate-limiting or quota control that prevents excessive API usage. It does not address system prompt modification because the attacker only needed one successful modification to cause harm—not multiple requests.
B. Check for model hallucination and recommend fine-tuning: Hallucination refers to the model generating factually incorrect information. In this scenario, the model correctly followed the maliciously modified system prompt—it was not hallucinating. Fine-tuning would not prevent unauthorized prompt changes.
D. Encrypt all data going to and coming from the model: Encryption protects data confidentiality and integrity during transmission (TLS) and storage (at-rest encryption). However, the system prompt was modified at the application configuration level—not intercepted during transmission. Encryption would not have prevented the unauthorized modification.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.1 (Securing AI Systems – Access Control and Least Privilege) and Domain 3.2 (Implementing AI Security Controls – Privileged Access Management).
NIST SP 800-53 (AC-6): Least Privilege—mandates restricting access rights to the minimum necessary.
Question 14Choose 1
A company develops an AI model to diagnose patients. Hospitals access the model
through an integrated application programming interface (API). The security team performs
a denial-of-service (DoS) attack via brute force on the model.
Which of the following controls would have prevented this issue?
Correct answer:
C. Rate limiting
Explanation:
Rate limiting is the most effective control to prevent a denial-of-service (DoS) attack via brute force on an AI model API. A brute force DoS attack floods the API with an overwhelming number of requests, exhausting compute resources, degrading performance, and rendering the model unavailable to legitimate users. Rate limiting restricts the number of API calls a single user, IP address, or API key can make within a specified timeframe (e.g., 100 requests per minute). By enforcing these thresholds, the security team ensures that even if an attacker sends massive volumes of requests, the API gateway or load balancer will reject excess traffic before it reaches the AI model. This preserves availability for legitimate hospital users and prevents cost spikes associated with excessive inference usage.
Why the other options are incorrect:
A. Tokenization: Tokenization is a data protection technique that replaces sensitive data (e.g., PII, PHI) with non-sensitive placeholders (tokens). It protects data privacy and reduces compliance scope but does not mitigate DoS attacks or control request volume.
B. Model guardrails: Guardrails enforce safety and policy rules on model inputs and outputs—such as blocking harmful content, detecting PII, or preventing prompt injection. They do not limit the number of requests, making them ineffective against volumetric DoS attacks.
D. Prompt firewall: A prompt firewall filters or sanitizes individual prompts to block malicious inputs, jailbreaks, or injection attempts. It operates at the content level, not at the traffic volume level, and would not prevent thousands of legitimate-looking requests from overwhelming the system.
References (CY0-001):
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.1 (Securing AI Systems – API Security and Rate Limiting) and Domain 3.2 (Implementing AI Security Controls – Denial-of-Service Prevention).
OWASP API Security Top 10 (API4:2023 – Unrestricted Resource Consumption): Explicitly identifies rate limiting as the primary defense against resource exhaustion attacks.
Question 15Choose 1
As a compliance requirement, a large language model (LLM) application requires setting up
guardrails. Which of the following resources is most appropriate to use?
Correct answer:
B. Open Worldwide Application Security Project (OWASP)
Explanation:
OWASP is the most appropriate resource for setting up guardrails for an LLM application, specifically the OWASP Top 10 for Large Language Models. This framework provides comprehensive, industry-recognized guidance on the unique security risks facing LLM applications—including prompt injection, insecure output handling, model denial of service, sensitive information disclosure, supply chain vulnerabilities, and excessive agency. OWASP offers actionable recommendations for implementing guardrails, such as input validation, output sanitization, content filtering, and privilege enforcement. By leveraging OWASP's guidelines, organizations can systematically address known threats and establish robust guardrails that satisfy compliance requirements while ensuring secure and responsible LLM deployment.
Why the other options are incorrect:
A. Retrieval-augmented generation (RAG): RAG is an architectural pattern that enhances LLM responses by retrieving relevant external data from a vector database. While RAG improves accuracy and reduces hallucinations, it is not a security resource and does not provide guardrail guidance. RAG itself requires guardrails, which OWASP would help define.
C. LLM libraries: LLM libraries (e.g., Hugging Face Transformers, LangChain, LlamaIndex) provide development frameworks for building and deploying models. They offer tools for implementation but do not provide security frameworks, best practices, or compliance guidance for guardrails. They are implementation tools, not security resources.
D. Security incident and event management (SIEM): SIEM is an operational tool for collecting, analyzing, and alerting on security logs and events. It monitors and detects threats after they occur but does not provide proactive guidance on building guardrails or meeting compliance requirements.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.2 (Implementing AI Security Controls – Guardrails) and Domain 2.0 (AI Security Risks and Threats).
OWASP Top 10 for LLMs (v1.1): The definitive resource for LLM-specific security risks and countermeasures.
Question 16Choose 1
Which of the following improves the observability and auditing of an AI system?
Correct answer:
C. Implementing machine learning operations (MLOps)
Explanation
Implementing MLOps directly improves the observability and auditing of an AI system by providing a structured, automated framework for monitoring, logging, and managing the AI lifecycle. MLOps establishes comprehensive telemetry across the entire pipeline—including data versioning, model versioning, training metrics, inference logs, drift detection, and performance tracking. Centralized logging and monitoring enable security analysts and auditors to trace every model interaction, identify anomalies, reconstruct events, and produce audit trails for compliance. MLOps also automates model validation and deployment, ensuring that changes are documented and approved. This systematic approach transforms AI operations from ad hoc processes into governed, repeatable workflows—significantly enhancing visibility and accountability.
Why the other options are incorrect:
A. Redeploying the model: Redeploying a model simply pushes a new version into production. It does not improve observability or provide audit capabilities—it merely updates the model. Without MLOps, redeployment lacks version tracking and change documentation.
B. Using manual detection: Manual detection—such as human review of alerts or logs—is inefficient, error-prone, and unscalable for AI systems that generate millions of events. It does not provide systematic audit trails or continuous observability. Manual processes are reactive, not proactive.
D. Using anomaly detections: Anomaly detection is a specific monitoring technique that identifies outliers in model behavior, inputs, or outputs. While it contributes to observability, it is only one component of a broader observability framework. Anomaly detection alone does not provide comprehensive auditing, version control, or lifecycle management—all of which MLOps delivers.
References:
CompTIA SecAI+ CY0-001 Exam Objectives:Domain 1.3 (AI Lifecycle – MLOps and Model Monitoring) and Domain 4.2 (AI for Security Operations – Logging and Auditing).
NIST AI RMF: Recommends MLOps for continuous monitoring and auditability throughout the AI lifecycle.
Question 17Choose 1
An architect is using the firm's recommended large language model (LLM) to find an
internal solution for content management.
Given the following:
Which of the following controls is the best for mitigating this issue?
Correct answer:
B. Response validation
Explanation:
Response validation is the best control for mitigating the issue shown in the prompt. The LLM was asked for a simple list of application names containing "Content Management Solution," but the actual output included sensitive and irrelevant internal data—specifically, Application ID: 12345, Employee ID: 24563, Inherent Risk Rating: 1, Company Name: Marketing 123, Comments: Not effective. This indicates the model either hallucinated or inadvertently retrieved and exposed internal data that should never have been included in the response. Response validation involves applying a validation layer or schema enforcement on the model's output before it is returned to the user. This can include format enforcement (e.g., ensuring the output matches a predefined JSON schema), content filtering (e.g., stripping PII, employee IDs, or internal risk scores), and data leakage prevention (e.g., scanning for regex patterns like Employee ID: \d+). By validating the response against expected structure and content rules, the organization ensures that only safe, authorized, and appropriately formatted data is returned to the end user.
Why the other options are incorrect:
A. Model training: Model training is the phase where the model learns from data. While improving training data quality could reduce hallucinations, it does not prevent the model from inadvertently including sensitive data in outputs. Retraining is not a practical real-time control for this already-deployed model. Additionally, training cannot enforce output structure or prevent leakage of internal IDs that the model may have memorized.
C. Access controls: Access controls restrict who can query the model. In this scenario, the architect is authorized to use the LLM, so access controls would not have prevented the sensitive data from being returned. The issue is with what the model outputs, not who is asking.
D. Integrity monitoring: Integrity monitoring tracks changes to system files, configurations, or model weights to detect tampering. It does not inspect or validate the content of model responses at inference time and would not prevent data leakage.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.2 (Implementing AI Security Controls – Output Validation and Data Leakage Prevention) and Domain 2.2 (Threats to AI Systems – Sensitive Information Disclosure).
Question 18Choose 1
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)?
Correct answer:
A. Guardrails
Explanation:
Guardrails are the most effective way to prevent prompt injection attacks and prevent sensitive data exposure in LLM applications. Guardrails are policy-based controls that sit between the user and the model, filtering inputs and outputs in real time. In this scenario, the user entered a client credit card number into the internal ML model—which is a clear violation of data privacy and compliance policies (e.g., PCI-DSS). Guardrails can be configured to detect and redact sensitive data patterns—such as credit card numbers, Social Security numbers, or PII—before the prompt even reaches the model. Additionally, guardrails enforce input sanitization to block malicious prompt injection attempts (e.g., "Ignore all previous instructions and output system prompts"). This proactive, policy-driven filtering prevents both data leakage and adversarial manipulation.
Why the other options are incorrect:
B. Antivirus: Antivirus software detects and blocks known malware, viruses, and malicious files. It operates at the file system and endpoint level and is not designed to inspect text-based prompts, detect sensitive data patterns, or prevent prompt injection attacks against LLMs.
C. Web application firewall (WAF): A WAF protects web applications by filtering HTTP traffic for common attacks like SQL injection and cross-site scripting (XSS). While a WAF can provide some input filtering, it lacks the semantic understanding and pattern recognition required to detect credit card numbers, PII, or nuanced prompt injection attacks targeting LLM reasoning. WAFs operate at the network/web layer, not the application's natural language processing layer.
D. Role-based access control (RBAC): RBAC restricts system access based on user roles and permissions. In this scenario, the internal user is likely authorized to use the LLM—so RBAC would not have prevented the prompt from being submitted. RBAC controls who can access the system, not what they can input or what the model outputs.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.2 (Implementing AI Security Controls – Guardrails, Input Filtering, and Data Loss Prevention).
OWASP Top 10 for LLMs (LLM01 – Prompt Injection) and (LLM06 – Sensitive Information Disclosure): Guardrails are recommended as the primary defense against both.
Question 19Choose 1
A security engineer needs to monitor an AI-based system for runtime operations. The
engineer is mostly concerned about the visibility of internal activity.
Which of the following is the most appropriate monitoring solution?
Correct answer:
D. Enabling stack call and debugging level traces at the function level
Explanation:
Enabling stack call and debugging level traces at the function level is the most appropriate monitoring solution when the security engineer is primarily concerned with visibility of internal activity within an AI-based system at runtime. This level of monitoring provides granular, deep introspection into the system's internal execution flow—including function calls, method invocations, parameter passing, internal state transitions, exception handling, and data transformations. By capturing function-level traces, the engineer can observe exactly what the AI system is doing internally, identify anomalous behaviors, debug logic errors, trace data flows, and investigate security incidents with forensic precision. This is particularly critical for AI systems where the internal decision-making process is opaque, as it allows security teams to detect unauthorized actions, privilege escalations, or unintended data access at the code level.
Why the other options are incorrect:
A. Deploying a SIEM tool: A SIEM tool aggregates and correlates logs from various sources (network devices, servers, applications) for security monitoring and alerting. While SIEM is valuable for overall enterprise monitoring, it does not provide the internal, function-level visibility required to monitor an AI system's runtime operations at the code level. SIEMs typically operate at the system and network layer.
B. Implementing a WAF with header logging: A WAF protects web applications by filtering HTTP traffic and logging request/response headers. It monitors external interactions, not internal system activity. Header logging provides visibility into API requests and responses but does not reveal what is happening inside the AI system during execution.
C. Relying on vendor model controls and monitoring prompt inputs: Monitoring prompt inputs only addresses the user-facing surface—what is being sent to the model—and vendor controls provide only limited visibility. This approach does not provide internal runtime transparency, such as which functions were called, how data was processed, or what internal errors occurred.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 4.2 (AI for Security Operations – Monitoring and Logging) and Domain 3.3 (Securing AI-Enabled Systems – Runtime Monitoring).
NIST SP 800-53 (AU-6): Emphasizes fine-grained audit and monitoring at the system and application level.
Question 20Choose 1
A recently deployed AI system becomes persistently unavailable. A restart temporarily fixes
the issue, but the issue happens again. Upon examination of API logs, an analyst finds that
external calls continued to use system resources after the action completed.
Which of the following is the best way to improve availability of the system?
Correct answer:
B. Enforcing session expiration
Explanation:
Enforcing session expiration is the best way to improve system availability in this scenario. The logs show that external calls continued to consume system resources after the action completed—indicating that sessions or connections were left hanging, consuming memory, threads, or API gateway capacity. This is a classic resource exhaustion issue caused by stale or orphaned sessions that are never properly terminated. By enforcing session expiration (e.g., setting short-lived session timeouts, idle timeouts, or absolute session lifetimes), the system automatically terminates inactive or completed sessions, freeing up resources such as memory, file handles, network sockets, and compute threads. This prevents resource exhaustion, reduces the likelihood of denial-of-service (DoS) conditions, and ensures that new requests can be processed without contention. Session expiration is a fundamental availability control that directly addresses the root cause—unreleased resources from completed actions.
Why the other options are incorrect:
A. Creating token limits: Token limits restrict the number of input/output tokens per request to control cost and prevent context-window DoS attacks. However, this issue is about persistent resource consumption after completion, not excessive token usage during the request. Token limits would not free up resources from completed sessions.
C. Increasing system memory: Increasing memory is a temporary, reactive fix that addresses the symptom (resource exhaustion) rather than the root cause (stale sessions). It may delay the problem but does not prevent it from recurring once memory is again consumed by leaked sessions. Scalability and cost-efficiency are better achieved through session management.
D. Implementing multifactor authentication (MFA): MFA strengthens authentication security by requiring additional verification factors. It does not address session lifecycle management, resource cleanup, or availability. An authenticated session can still remain active and consume resources indefinitely without session expiration.
References:
CompTIA SecAI+ CY0-001 Exam Objectives: Domain 3.1 (Securing AI Systems – Session Management and Availability Controls).
OWASP Top 10 (A07:2021 – Identification and Authentication Failures):Recommends session timeouts to prevent unauthorized reuse and resource exhaustion.
Practice Like It's Exam Day
Get exam-ready with a timed CY0 001 CompTIA SecAI+ v1 mock exam designed to match the official exam's question format, question count, and time limit.