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
namesthat the host has, thenextra, 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
extrais 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]