Approval Policies
When running NEX in headless mode, the approval policy determines how the agent handles actions that would normally require user confirmation. Choosing the appropriate policy is essential for balancing automation with safety.
By default, NEX pauses before executing high-impact operations such as running sensitive shell commands or modifying protected files. While this is appropriate for interactive use, unattended environments such as CI/CD pipelines require a non-interactive approval policy.
Use the --approval-policy option to control this behavior.
Available Policies
1. Interactive (Default)
This is the default policy. Whenever NEX determines that an operation requires approval, it pauses execution and prompts the user for confirmation before proceeding.
- Best for: Interactive terminal sessions and locally supervised workflows.
2. Auto
Danger
Use this policy with caution. In auto mode, NEX inherits the same filesystem permissions as the user running it and may modify files within the workspace without requesting confirmation.
Before using this policy, ensure your work is protected by version control, backups, or an isolated environment such as a container. This provides a safe way to review or discard any automated changes if necessary.
In auto mode, NEX never waits for interactive approval. Instead, it relies on its built-in safety policies and tool permissions to determine whether an action should be allowed.
- Actions permitted by the active safety policy execute immediately.
-
Actions blocked by the safety policy are denied automatically. NEX receives the denial, adapts when possible, and explains the limitation in its final response.
-
Best for: CI/CD pipelines, scheduled jobs, and other fully unattended automation.
Example Usage in CI/CD
For unattended automation, combine --prompt with --approval-policy=auto:
nex \
--prompt="Compile the testbench in sim/ and run the sanity_test. Report any UVM errors." \
--approval-policy=auto \
--json-output
Handling Denied Actions
Even in auto mode, NEX cannot bypass its safety policies. If an operation is denied, the agent receives the failure as tool feedback and attempts to continue with alternative approaches when possible. If no alternative exists, the final response clearly explains which action was blocked and what changes are required to complete the task.