---
title: "Force Codex to ask for permission in sandbox"
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/codex-sandbox-permissions"
language: "en"
---

[Ian Nuttall](https://ian.is/)

# Force Codex to ask for permission in sandbox

October 29, 2025

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)

## Newsletter

Join 9.2k subscribers
