AI Agents / Agent security boundaries
AI Agents: Shell argument boundaries
Use argument arrays and approved executable paths instead of interpolated shell text.
Environment and inputs: Application and tool executor security; controls must be enforced outside model-generated text.
When to use it
Evaluate this boundary with synthetic adversarial data in an isolated test environment. A prompt can describe expected behavior, but permissions, resource limits and data handling must remain enforceable when the model produces an unexpected instruction.
Practical example
Illustrative Python call for an approved fixed script. Validate the report identifier and executable path separately; this is not a general command runner.
import subprocess
report_id = 'demo-001'
result = subprocess.run(
['/opt/approved/bin/report-status', '--id', report_id],
shell=False, check=True, capture_output=True,
text=True, timeout=10,
)
print(result.stdout)
Check the result
Provide a filename containing shell metacharacters and verify no extra command executes.
Save and compare results
Save the test input, configuration and result. Fix the failing boundary, repeat the same test and compare it with the saved working configuration.
Scope and limits
These exercises have not been tested on your systems. Check feature support and configuration names against the installed release and linked documentation.