Courseiva
AI Security, Ethics and GovernancemediumMultiple SelectObjective-mapped

Adversarial Attack Defenses: Input Sanitization and Adversarial Training

Which TWO practices are most effective for ensuring the security of an AI model against adversarial attacks?

Quick Answer

The correct answer is adversarial training and input sanitization and validation. Adversarial training strengthens the model itself by exposing it to perturbed examples during the training phase, forcing the decision boundary to become more robust against evasion attacks. Input sanitization and validation, on the other hand, acts as a defensive filter at the application layer, stripping or rejecting malicious payloads—such as crafted perturbations or injection strings—before they ever reach the inference pipeline. On the CompTIA AI+ AI0-001 exam, this pairing tests your understanding of defense-in-depth: one technique hardens the model internally, while the other secures the data entry point. A common trap is to choose only one defensive measure, but the exam expects both a proactive (training) and a reactive (sanitization) layer. Memory tip: think “Train tough, filter first”—adversarial training builds toughness inside the model, while input sanitization guards the front door.

⚠ Common exam trap

CompTIA often tests the distinction between reactive monitoring (B) and proactive defenses (C and D), and candidates mistakenly choose rate limiting (E) thinking it blocks all attacks, but it only throttles frequency, not content.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Input sanitization and validation

Input sanitization and validation (C) is correct because it prevents adversarial inputs—such as specially crafted perturbations or injection strings—from reaching the model's inference pipeline. By filtering, encoding, or rejecting malicious data at the application layer, the model's decision boundary is protected from manipulation. This is a fundamental defense-in-depth measure against evasion and poisoning attacks.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Encrypting the model weights

    Why it's wrong here

    Encryption protects the model at rest, not during inference.

  • Continuous model monitoring

    Why it's wrong here

    Monitoring detects attacks but does not prevent them.

  • Input sanitization and validation

    Why this is correct

    Sanitization removes or normalizes inputs that may contain adversarial perturbations.

  • Adversarial training

    Why this is correct

    Adversarial training improves model robustness by exposing it to adversarial examples.

  • Rate limiting API access

    Why it's wrong here

    Rate limiting reduces abuse but does not defend against crafted inputs.

About these practice questions

Courseiva writes every AI0-001 question from scratch — 754 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on AI0-001

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A national security agency uses AI to analyze surveillance data for threat detection. The system is deployed in a high-stakes environment where false negatives could lead to missed threats, and false positives waste analyst time. Recently, a known hacker group attempted to evade detection by subtly modifying their communication patterns over time, a form of adversarial evasion. The agency wants to harden the system while maintaining performance. The system uses a deep neural network. Which mitigation strategy is most appropriate?

hard
  • A.Switch to an unsupervised learning approach to detect anomalies
  • B.Simplify the model to a logistic regression to reduce the attack surface
  • C.Perform adversarial training using the hacker group's known evasion patterns
  • D.Add random noise to all input data to confuse evasion attempts

Why C: Adversarial training is the most appropriate mitigation because it directly incorporates known evasion patterns into the training process, making the deep neural network robust to the hacker group's subtle modifications. By retraining the model on adversarial examples, the decision boundary is hardened against these specific attacks without sacrificing overall detection performance. This approach is a standard defense in high-stakes security AI, balancing false positive and false negative rates while countering adversarial evasion.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AI0-001 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI0-001 exam.