How It Works
Whenenvironment.allow_vars is set in a profile, nono:
- Clears the inherited environment
- Passes through only variables matching the allow-list
- Adds back nono-injected credentials (from
env_credentials) on top
environment section is omitted entirely, all variables are passed through (backward compatible). Setting allow_vars to an empty array [] restricts the environment to only nono-injected credentials — no inherited variables are passed.
Configuration
Add theenvironment section to your profile:
Prefix Patterns
Use a trailing* to match all variables with a given prefix:
AWS_REGION, AWS_SECRET_ACCESS_KEY, and any variable starting with MYAPP_, while blocking everything else.
A bare "*" matches all variables (equivalent to not setting the environment section at all). The * wildcard is only valid as a trailing suffix — patterns like "A*B" or "*X" are rejected at profile load time.
Inheritance
allow_vars is additive across profile inheritance. A child profile appends its entries to the base profile’s list, and duplicates are removed:
Interaction with Credential Injection
Variables injected by nono — viaenv_credentials or --env-credential — always bypass the allow-list. They are explicitly configured by the user and must reach the child process regardless of filtering rules.
OPENAI_API_KEY is passed through even though it’s not in allow_vars, because it was explicitly injected via env_credentials.
Interaction with the Deny-List
nono maintains a built-in deny-list of dangerous environment variables (e.g.,LD_PRELOAD, DYLD_INSERT_LIBRARIES, PYTHONPATH, NODE_OPTIONS). These variables are always blocked, even if they appear in allow_vars. This prevents a compromised profile from disabling sandbox protections.
LD_PRELOAD will not be passed through, despite being in the allow-list.
Security Properties
- Default-allow: Without the
environmentsection, all variables are passed through (no regression) - Empty allow-list restricts all:
"allow_vars": []passes zero inherited variables — only nono-injected credentials reach the child - Explicit allow-list: When configured with entries, only listed variables reach the child process
- Injected credentials bypass the allow-list:
env_credentialsvariables always pass through - Deny-list is non-overridable: Dangerous variables like
LD_PRELOADare always blocked - Prefix patterns reduce misconfiguration: Only
*suffix is supported (no regex), reducing risk of accidental over-permission - Bare
*matches everything: Use as an escape hatch, but prefer explicit lists
Example: Minimal Agent Environment
A typical profile for an AI agent that only needs basic shell environment and cloud credentials:AWS_* variables and the injected OPENAI_API_KEY, but no other secrets accidentally present in the parent environment.
Next: Credential Injection | Profile Authoring