command_arguments#

Run commands and agent-written programs inside an operating-system boundary. See the guide.

zett_agent.sandbox.policy.command_arguments(command, *, shell='/bin/sh')[source]#

Return the argument vector for a command given as a shell string or as arguments.

A string runs through shell -c, so pipes and redirections work. A sequence runs directly, which is the safer form for a program and its arguments because nothing is parsed.

Raises:

SandboxPolicyError – If the command is empty or contains NUL.

Parameters:
  • command (str | Sequence[str])

  • shell (str)

Return type:

tuple[str, …]