Skip to content
← All guides

Claude Code and Codex security controls on Mac

Compare permissions, sandbox settings, local session records and Git protection in Claude Code and Codex. See when the native controls cover your task.

4 min read

For a code review, start Claude Code in Plan mode so it can inspect the project before proposing changes. Some shell commands can still go through the usual permission flow. Codex’s read-only profile limits local command writes at the sandbox boundary. For implementation, give the agent a writable project folder, keep sensitive files outside its permitted reach and protect the shared branch on the Git host.

Suppose a teammate asks an agent to explain a failing test. It needs to read the source. It may need to run a test that writes a cache. It has no reason to change a shared branch. Those are three separate decisions. Before granting more access, identify the one operation the task actually needs.

Side by side

DecisionClaude Code on MacCodex CLI on Mac
Review before editingPlan mode supports inspection and planning. Manual mode normally asks before file edits and many shell commands. Its built-in read-only commands and existing permission rules affect when you see a prompt.The read-only profile restricts writes by local commands. For an editing task, a workspace-scoped profile can grant writes in designated roots. Approval policy is a separate choice.
Decide which actions need approvalOpen the permissions view to inspect allow, ask and deny rules for tools. The active permission mode also affects how an action is reviewed.Inspect the selected permission profile and approval policy. With on-request approvals, Codex can request more access when a command needs it. Review the requested action and scope before approving.
Control shell access to files and the networkEnable the native sandbox and configure the paths and network destinations its shell processes can reach. Native tool permission rules also matter for operations outside the shell.Set the profile’s filesystem access and network policy. Choose the read and write roots for the work. A writable workspace alone tells you little about which network destinations the profile allows.
Check what ranIn the default Mac setup, project session files live under ~/.claude/projects/. If the task used a helper, inspect that helper’s session too.Default active session records live under ~/.codex/sessions/. Archived sessions have a separate directory. Find the task by time and working directory, then compare the tool call with its response.
Protect the shared branchEnforce required reviews, checks and restrictions on force pushes at the Git host. These rules also apply to a teammate using the same account permissions.Set the same restrictions at the Git host. A local sandbox controls what an agent can do on your Mac, while branch protection controls what the host accepts.

Documentation and CLI checks below are dated November 20, 2026. Start with the vendor pages for your installed version and any settings your organization manages. Claude Code permissions · Claude Code shell sandbox · Codex permission profiles · Codex CLI reference

What we checked on a Mac

We checked the installed help for Claude Code 2.1.322 and Codex CLI 0.166.0. For Codex, we also created a directory containing a single text file and ran two ordinary commands through its read-only sandbox. The first returned the exact contents of the file. The second tried to create an empty file in the same directory. The operating system refused the write and the new file did not appear. Neither command called a model or used a remote service.

That check covers one local Codex profile. The Claude Code column describes its documented controls and the options in its installed help. To check your own setup, use a disposable project with a harmless file and verify the permitted read and intended write boundary before you introduce real work.

When the native controls cover the job

If one developer needs a read-only review, a native restriction and a verified file state can answer the immediate question. If the next task needs to edit the project, choose a narrower writable folder and decide whether it needs network access. Put project instructions where each agent reads them. Claude Code uses CLAUDE.md and Codex uses AGENTS.md. A written request to leave a folder alone is useful context. A filesystem restriction gives the operating system a decision to enforce. How the two agents read rules

Protect shared Git history independently. The host receives a push whether an agent or a person sent it. Set branch protection, check who can bypass it and require the reviews or checks your team relies on. If history already changed, use the before and after commit IDs to investigate. Git protection · Recover after an unexpected force push

When you want one view across both agents

Excellent’s free scan reads supported logs on the Mac and reports findings for review. It can help when you want to compare the two agents’ recorded actions after a task. For consequential changes, confirm the outcome in the affected file, repository or service. See a simulated report · Read a session by hand · Run the free scan

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Commands sent into an already running Codex shell fall outside that check. Pro can also configure both agents’ native Mac sandboxes from your file and folder rules, with a plan to review first. Pro is US-only for now. On November 20 the pricing page offered checkout notifications. Agent coverage · Sandbox setup · Current pricing and availability

Related guides

View all