build_environment#

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

zett_agent.sandbox.policy.build_environment(names, extra=None, *, source=None, case_insensitive=None)[源代码]#

Build the environment a sandboxed process starts with.

The result holds the variables in names that the host has, then extra, which wins. Nothing else leaks through, so a token that sits in the host environment stays there. Windows matches names without regard to case, as the platform does.

抛出:

SandboxPolicyError -- If extra is not a mapping of strings, or has a name the operating system cannot hold.

参数:
  • names (Iterable[str])

  • extra (Mapping[str, str] | None)

  • source (Mapping[str, str] | None)

  • case_insensitive (bool | None)

返回类型:

dict[str, str]