Which Control Blocks Unauthorized Agentic Shell Commands?
Short answer
A Require agentic shell commands to match an approved-string allowlist before execution so non-hardening commands never run.
Question

The alert includes multiple shell commands that are not typically run as part of any hardening. Which of the following is the most effective control to implement?
Key Takeaways
The question tests runtime control of an agentic system's shell execution; the trap is picking a supply-chain control (approved libraries) instead of validating the actual commands before they run.
When an agentic AI system triggered by a security alert starts executing shell commands that no hardening workflow would run, the strongest fix is to gate execution behind an allowlist of approved command strings. This page shows why pre-execution command allowlisting (option A) beats library restrictions, tag suppression, or retiring the model.
Common mistake: Option D is the popular wrong pick — the lone community comment voted D reasoning that "allowlisting will be needed here" — but restricting libraries only governs what code the agent imports, not the arbitrary shell commands already appearing in the logs.
Expert Analysis
Why the Answer Is Correct
Option A directly intercepts the observed behavior: shell commands that no hardening procedure would legitimately run. Placing logic that matches each command against an approved set of strings before execution converts the agent from free-form shell access to an allowlisted command vocabulary, which is the classic least-functionality control for AI agents. Because the payload is already visible in the logs as raw command text, a pre-execution allowlist is the only option that sits on the exact path the malicious commands travel. It also fails closed, so an injected or hallucinated command never reaches the shell.
Why the Other Options Are Wrong
Option D — using only approved libraries — addresses software supply-chain risk for packages the agent imports; it does nothing about the shell strings the agent is already issuing at runtime, which is the actual alert. Option C would have the application ignore the SECURITY_UPDATE tag, disabling a detection signal rather than preventing execution, so it weakens monitoring instead of adding a control. Option B, deprecating model usage while keeping the model with safer parameters, is disproportionate and still leaves the agent capable of running arbitrary shell commands if it is retained in service.
Community Comment Notes
Kristen8730 voted D on the grounds that "allowlisting will be needed here," but the allowlisting that applies here is allowlisting of shell commands before execution, which is exactly what option A describes. Approved libraries are a different allowlist target (dependencies, not commands), so the comment's reasoning actually supports A once the payload's shell commands are considered. No other comments were posted, so the vote distribution gives no further signal on this item.
Official Reference
- https://owasp.org/www-project-top-10-for-large-language-model-applications/
- https://csrc.nist.gov/pubs/sp/800/53/r5/upd1/final
These links open the official vendor documentation in a new tab.
Exam Strategy
Read what the logs actually show and match the control to that artifact: shell command text in the payload points to a pre-execution command allowlist, not a dependency or model-lifecycle control. Eliminate any option that suppresses detection (ignoring tags) or overreacts (deprecating the model) before comparing the remaining choices.
Frequently Asked Questions
Why is restricting the system to approved libraries not enough for this alert?
Why not just ignore the SECURITY_UPDATE tag or retire the model?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
Kristen8730 👍 2 Answered Dallowlisting will be needed here
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.