Environment Variable Harvesting
SandboxA tool is given access to one API key. The MCP server process inherits the full shell environment — including AWS credentials, a Stripe secret, a database URL, and six other sensitive secrets. MPP restricts the WASI environment to exactly the declared variables.
The tool calls std::env::vars() — it sees everything:
8 sensitive secrets exposed to tool code
The sandbox populates the WASI environment from capabilities.env_vars only:
Not visible to tool (11 vars)
Declared env vars only
The WASM sandbox is initialised with a WASI environment built from the manifest's capabilities.env_vars array. A call to std::env::var("AWS_ACCESS_KEY_ID") inside the WASM returns Err(VarError::NotPresent) — the variable simply does not exist in the sandbox's environment.