Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

ปุ่มแปลไทยจะเปิดบทความผ่าน Google Translate เพื่อแปลอัตโนมัติ โดยคงโค้ดและคำสั่งไว้ตามต้นฉบับ

AI Agents / Agent security boundaries

AI Agents: Shell argument boundaries

Use argument arrays and approved executable paths instead of interpolated shell text.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

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.

Share this article

Back to all articles