This short note explains how to set up a convenient shell shortcut (codexmax) that launches Codex with full sandbox and network access, using your preferred options by default.
Running Codex with a long list of flags is annoying to type and remember:
codex --search --sandbox=danger-full-access --ask-for-approval=never -c sandbox_workspace_write.network_access=true
Instead, you can create a shell alias (or function) so that:
- You type a single word:
codexmax - You always get the same “max power” Codex configuration
- You can still pass additional arguments if needed
Add this line to your ~/.zshrc (or ~/.bashrc):
alias codexmax="codex --search --sandbox=danger-full-access --ask-for-approval=never -c sandbox_workspace_write.network_access=true"
Then reload your shell configuration:
source ~/.zshrc
# or
source ~/.bashrc
Now you can run:
codexmax
This expands to:
codex --search \
--sandbox=danger-full-access \
--ask-for-approval=never \
-c sandbox_workspace_write.network_access=true
--search→ allow Codex to search the web.--sandbox=danger-full-access→ enable full sandbox access (powerful, but you must trust what you run).--ask-for-approval=never→ do not prompt for confirmation before executing actions.-c sandbox_workspace_write.network_access=true→ allow network access from the sandboxed workspace.
If you want to pass additional flags or prompts to Codex when calling codexmax, use a shell function instead of a plain alias:
codexmax() {
codex \
--search \
--sandbox=danger-full-access \
--ask-for-approval=never \
-c sandbox_workspace_write.network_access=true \
"$@"
}
Usage examples:
codexmax "Help me refactor this repository"
codexmax --model=latest "Design a CI pipeline"
The "$@" ensures all extra arguments are forwarded to Codex.
- Direct invocation
codexmax
- History search (zsh/bash)
UseCtrl+R, typecodexmax, and hitEnterto quickly re-run your preferred Codex setup.
- This setup skips approval prompts and grants broad access (including network + workspace writes).
- Only use it in environments where you understand and trust what Codex is allowed to do.