Bird
0
0

Which method best sanitizes user input to prevent code injection in an AI system?

easy📝 Conceptual Q2 of 15
Agentic AI - Agent Safety and Guardrails
Which method best sanitizes user input to prevent code injection in an AI system?
AAdding random noise to the input data
BRemoving or escaping special characters like <, >, and ;
CConverting all input to uppercase letters
DIgnoring input length limits
Step-by-Step Solution
Solution:
  1. Step 1: Identify what sanitization means

    Sanitization cleans input to remove harmful parts like special characters that can cause code injection.
  2. Step 2: Match method to sanitization goal

    Removing or escaping special characters prevents malicious code from running.
  3. Final Answer:

    Removing or escaping special characters like <, >, and ; -> Option B
  4. Quick Check:

    Sanitization = Remove harmful characters [OK]
Quick Trick: Escape special characters to block code injection [OK]
Common Mistakes:
  • Thinking uppercase conversion sanitizes input
  • Adding noise does not sanitize
  • Ignoring length limits risks buffer overflow

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes