Question 20
A generative tool assembles a shell command from a customer message. An attacker includes special characters intended to delete files. Which safeguard applies?
Explanation
Correct Answer
Untrusted customer text should remain data, never executable command syntax. A narrow allowlisted tool with validated parameters and independent permission checks prevents special characters from changing the operation performed on the host.
Incorrect Answers
A system instruction is useful guidance, but an injection can still produce executable shell metacharacters when arbitrary strings run with the tool privilege. A typed, allowlisted operation enforced outside the model is needed to constrain execution.
Keyword blacklists are fragile because dangerous operations can be expressed using quoting, substitutions and alternate syntax. Restricting the available command operations and validating typed parameters is a stronger execution boundary.
Syntactically well-formed shell commands can still delete files or access unauthorized paths. Valid syntax says nothing about the caller’s intent, allowed scope or business authorization.



Microsoft Azure AI Fundamentals (AI-901) Practice Tests