---
title: "Force Codex to ask for permission in sandbox | Ian Nuttall"
description: "Codex pro tip to force it to ask for permission before retrying a shell command that failed in the sandbox"
canonical: "https://ian.is/post/codex-sandbox-permissions"
language: "en"
---

# Force Codex to ask for permission in sandbox

Oct 2025 / 32,255 views / [via X](https://x.com/iannuttall/status/1983471868620255389)

Codex pro tip:

Add this rule to AGENTS.⁠md when it starts getting confused about commands in the sandbox to force it to ask for permission

(I got sick of it trying to troubleshoot why it couldn't add or commit files!)

\---
When a shell command fails with “failed in sandbox”, use the permission request tool (with \`with\_escalated\_permissions\`) to ask the user for approval before retrying.

![Image from the original X post](https://ian.is/media/tweets/1983471868620255389/1983471868620255389/1ccfe2b0de3a6e9bd89b8c9f692468d93cf785f006c338d115abe8c444d2bfe0.jpg)

## Ian's List

Join 15k\+ subscribers
