Asks for permission to run command `xcodebuild`, even after permitting all `xcodebuild` commands
Resolved 💬 19 comments Opened Feb 1, 2026 by bholmesdev Closed Jun 12, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.93
What subscription do you have?
Pro
Which model were you using?
Codex 5.2 (medium reasoning)
What platform is your computer?
MacOS
What terminal emulator and version are you using (if applicable)?
Warp
What issue are you seeing?
I granted permission to run all xcodebuild commands by selecting the "Yes, and don't ask again" option from the CLI. Then in future runs, even when running the same command with the same set of arguments, it still asks for sandboxing permissions. This persists even after quitting and restarting the codex CLI.
I am not running with dangerous permissions. I'm only running codex for my conversations.
<img width="1456" height="780" alt="Image" src="https://github.com/user-attachments/assets/b5f84acb-598e-4345-80fa-cd8c5109f9be" />
What steps can reproduce the bug?
- Prompt the agent to run the command `xcodebuild -scheme Hubble -destination 'generic/platform=iOS'
│ -quiet CODE_SIGNING_ALLOWED=NO build 2>&1`.
- Notice the agent tries to run this command and receives a sandbox error (seems odd it doesn't ask me and intentionally needs to fail first)?
- Select option 2, "Yes, and don't ask again"
- On a future turn, prompt to run the same
xcodebuild ...command again. The sandbox permissions error reoccurs unexpectedly.
What is the expected behavior?
I should not have to grant permissions again for the current session and all future CLI sessions.
Additional information
This is my Codex config:
[projects."/Users/benholmes/Projects/Hubble"]
trust_level = "trusted"
[projects."/Users/benholmes/Projects/simplestack-store"]
trust_level = "trusted"
[projects."/Users/benholmes/Projects/simple-stack"]
trust_level = "trusted"
[features]
unified_exec = true
19 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Are subsequent commands exactly the same as the first one that you approved, or do they differ in their arguments?
@bholmesdev could you use
/feedbackand share the session id?@etraut-openai I just confirmed that it is running with the exact same set of arguments. Andn @dylan-hurd-oai here is the feedback ID:
019c171d-d6a4-7690-a080-3994dbb86bdaTo clarify, the command being run is
xcodebuild -scheme Hubble -destination 'generic/platform=iOS' -quiet CODE_SIGNING_ALLOWED=NO build 2>&1. This is listed in my project rules file:Rules
pnpm convex typecheckto check your work when updating convex files.xcodebuild -scheme Hubble -destination 'generic/platform=iOS' -quiet CODE_SIGNING_ALLOWED=NO build 2>&1Overview
Hubble is an iOS/macOS app with a Convex backend. Built with XCode, with packages tracked in XCode.
For permission updates, instruct user on what to update in Xcode (ex. add microphone permissions in Target > Info).
Data Model
Conventions
Views/, reusable components inViews/Components/, modifiers inViews/Modifiers/convex/http.tsfor streaming responsesFolder Structure
Commands
Local-First Sync Engine
The app uses a local-first architecture with SwiftData for offline support. Data loads instantly from local storage; Convex syncs in the background.
Key Files
Models/LocalModels.swift— SwiftData models (LocalNote,LocalLens) with sync metadata (serverId,syncStatus,lastModifiedLocally)Models/SyncStatus.swift— Enum:.synced,.pendingCreate,.pendingUpdate,.pendingDeleteServices/NoteRepository.swift— Local CRUD,findByStableId(),upsertFromServer()Services/LensRepository.swift— Same pattern for lensesServices/SyncEngine.swift— Coordinates push/pull with ConvexServices/NetworkMonitor.swift— Detects connectivity changes, triggers sync on reconnectSync Behavior
On app launch:
syncAll()→ push pending changes, then start subscriptionsOn edit:
syncStatus = .pendingUpdateOn reconnect (airplane mode off):
NetworkMonitordetects connection restoredsyncAll()automaticallyConflict Resolution
Device always wins. Push happens before pull, so offline edits overwrite server. The
lastModifiedLocallytimestamp is compared againstserverNote.updatedAtonly for incoming pull data — if local has pending changes with a newer timestamp, server data is ignored.Schema Migrations
SwiftData uses
HubbleMigrationPlanfor versioned schemas. On schema mismatch (dev only), the local store auto-deletes and re-syncs from Convex.Voice Input & AI
The user can interact with the Hubble Agent through voice or text. This agent is managed in Convex.
Transcription
Services/SpeechTranscriberManager.swift— Apple Speech transcriptionServices/ParakeetTranscriberManager.swift— Enhanced local transcriptionServices/TranscriptionSettings.swift— User transcription preferencesViews/VoiceNoteView.swift— Main recording flowViews/Components/TranscriptSheet.swift,TranscriptCard.swift— Transcript displayLive Q&A
Services/LiveQAService.swift— Detects questions during transcription to interact with the Hubble agentViews/Components/QABubble.swift— Displays Q&A segments in transcriptServices/TranscriptRefiner.swift— AI-powered transcript cleanup (streaming)any updates here? anybody knows how to fix it? this is insane that you have to approve it every 5 minutes. I've tried to add as set of rules, but it didn't work:
what am i doing wrong?
I have the same issues with commands like this one:
xcodebuild -workspace ./ProjectName.xcworkspace -scheme ProjectName -configuration Debug -destination 'id=F94783BB-3585-4762-B652-656912287576' build > /tmp/cw_settings_build.log 2>&1;When I instructed Codex to run "pure" xcodebuild commands instead, it seems to have fixed the issue.
The following command was run unsandboxed without approval, as expected:
xcodebuild -workspace ./ProjectName.xcworkspace -scheme ProjectName -configuration Debug -destination 'id=F94783BB-3585-4762-B652-656912287576' buildSo the bug might have something to do with the output redirects.
While troubleshooting, I had also added this to my default.rules, but it did not work:
prefix_rule(pattern=["xcodebuild"], decision="allow")I have this issue in general with most commands. I have a
rulesfile for all the commands I want to auto-approve. If I use--ask-for--aproval=untrusted, it still prompts me to accept the commands, even if my~/.codex/rules/<cmd>.rulesfile allows it.Overall, this issue + my experience makes me think the
rulesand command approvals are not working as expected.To reproduce:
repro.sh:Then codex v0.99 still asks for permissions
<img width="2082" height="1678" alt="Image" src="https://github.com/user-attachments/assets/859bea5b-2e76-4d4f-b953-c9b4b51b8d11" />
I know this is not the same as the issue reported. But I'm sharing this here instead of a new issue because it feels like the root cause is the same
After digging a bit more into this, by using
RUST_LOG=codex_core=debug+tail -f ~/.codex/log/codex-tui.log, I noticed a few of my.rulesfile had a syntax error. But those files were unrelated to the one forsample-command-foodocumented here. Fixing them resolved the issue. So the problem may be a syntax error in another rule. This seems to have 2 main problems:.rulesfile invalidates all the other different.rulesfiles.rulesfilesI'll create a separate issue for this.
@etraut-openai @dylan-hurd-oai @polyrand can you please check this https://github.com/openai/codex/pull/11868
I get this too, at first I thought it was just for new items (it would ask permission repeatedly in one session, but the next session would pick up the rules file). But it's definitely for existing rules too.
I have the rule
prefix_rule(pattern=["npm", "test"], decision="allow")And it asks for permissions to run
npm test -- appSettingsv0.101.0
thread ID 019c692f-d528-7152-888a-d435c1f9eba6
Hi folks - looks like we have 2 problems here:
Re-opening for now to confirm the fix
@dylan-hurd-oai you're great! I cleared all the rules and now it works. Although neither I nor ChatGPT could see any syntax errors.
Actually it's happening again now, asking every time to run tests, and the only thing in my rules file is:
So the current state of things on Windows is quite bad. You can't use the new sandbox because then Codex can't even read files. With the older sandbox, Codex can't run tests in a sandbox because of the EPERM issue. It can escalate and run them outside a sandbox, but it can't remember that it's allowed to run tests. So in a session where its troubleshooting failing tests, you have to sit there and approve it again and again.
Yeah it seems that the prefix rules require exact full commands with PowerShell commands for Windows sandboxing. I described my similar issue I am still having here: https://github.com/openai/codex/issues/8537#issuecomment-4064805454
A solution has been found:
prefix_rule(pattern=["sh", "xcodebuild.sh"], decision="allow")Closing as resolved by #11951.