Nous.Tools.Env (nous v0.17.0)

View Source

Scrubbed environment for tool subprocesses.

Tools that spawn OS processes (bash, ripgrep in file_grep) must not inherit the BEAM's environment: it routinely holds API keys, OAuth tokens, and vault credentials, and an LLM is one printenv away from leaking them. Shell-loader hooks (LD_PRELOAD, DYLD_INSERT_LIBRARIES) are dropped for the same reason.

Every subprocess-spawning tool must use scrubbed/0 so the allowlist has exactly one definition.

Summary

Functions

The environment to pass to tool subprocesses: allowlisted variables that are currently set, as {name, value} tuples.

Functions

scrubbed()

@spec scrubbed() :: [{String.t(), String.t()}]

The environment to pass to tool subprocesses: allowlisted variables that are currently set, as {name, value} tuples.