Courseiva
AI SecuritymediumMultiple ChoiceObjective-mapped

AI0-001 AI Security Practice Question

A company is developing a chatbot that helps users write code. They are concerned about the chatbot being used to generate malicious code. Which defense should they implement to reduce this risk?

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

Output filtering and guardrails to detect malicious code patterns

Output filtering and guardrails can detect and block malicious code generation. Input validation helps but the risk is in the output. Red teaming is testing, and data poisoning is a different attack vector.

Answer analysis

Option-by-option breakdown

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

  • Output filtering and guardrails to detect malicious code patterns

    Why this is correct

    Output filtering can prevent the chatbot from returning harmful code.

  • Input validation to block special characters

    Why it's wrong here

    Input validation is important but the main risk is the chatbot outputting malicious code.

  • Data poisoning prevention during training

    Why it's wrong here

    Data poisoning is a training-time attack, not directly related to malicious code generation.

  • Red teaming the model before deployment

    Why it's wrong here

    Red teaming identifies issues but is not a runtime defense.

About these practice questions

One of 754 original AI0-001 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.