The EDR Quarantine Defence Kit: How to Keep Codex CLI Running in Enterprise Windows Environments

If your corporate security tooling has quarantined Codex CLI on Windows, you are not dealing with a bug you can wait out. You are dealing with a policy conflict: Codex’s toast notification system uses PowerShell -EncodedCommand, a flag that endpoint detection and response (EDR) tools treat as a known malicious indicator. The EDR is doing exactly what it is configured to do. Until OpenAI ships a permanent fix, the resolution has to come from your side.

This guide covers every lever available — developer-side config changes, IT admin exclusion strategies, and MDM-deployable remediation for teams. Most fixes take under two minutes.

For background on why this happens, see PowerShell -EncodedCommand: Why Codex CLI Is Getting Quarantined by Enterprise Security Tools.


The Fastest Fix: Disable Windows Toast Notifications

Codex CLI’s tui.notifications config key controls whether desktop toast notifications are sent. Setting it to false prevents Codex from invoking PowerShell at all for notification dispatch, which eliminates the EDR trigger entirely.

Add this to your user config:

# ~/.codex/config.toml
[tui]
notifications = false

That is the complete fix for most affected developers. No EDR exclusions required. No IT change request. No restart.

The tradeoff is that you lose Windows toast alerts when long-running tasks complete. If that matters, the sections below show how to get equivalent notifications through routes that do not trigger EDR.

Project-Level Deployment

For teams where every developer is hitting the same quarantine, commit the setting at the project level so it applies automatically on clone:

# .codex/config.toml (committed to repository root)
[tui]
notifications = false

Project config overrides user config. Developers do not need to touch their personal ~/.codex/config.toml.


Keeping Notifications Without the EDR Risk

Disabling notifications entirely means missing the signal when a 20-minute agentic run finishes. There are two alternatives that preserve the alert without using PowerShell.

Option 1: Switch to OSC 9 or Terminal Bell

Codex supports two notification escape sequences that bypass the Windows notification stack entirely:

[tui]
notification_method = "bel"   # terminal bell — works everywhere
# or
notification_method = "osc9"  # rich notification via iTerm2-compatible terminals

bel emits the traditional terminal bell character (\a). It works in Windows Terminal, ConEmu, PowerShell 7, and virtually everything else. No PowerShell invocation. No EDR trigger. The notification appears in your terminal emulator’s taskbar indicator or audible bell depending on your settings.

osc9 sends an OSC 9 escape sequence, which Windows Terminal 1.17+ renders as a native Windows notification without spawning PowerShell. If your Windows Terminal is up to date, this is the highest-fidelity replacement.

Combined config for a Windows developer who wants to keep notifications:

[tui]
notifications = true
notification_method = "osc9"
notification_condition = "unfocused"

The notification_condition = "unfocused" setting means you only get alerted when Codex is not the focused window — the same behaviour as the original Windows toast but delivered through a channel that bypasses the EDR trigger.

Option 2: Custom Notify Command

For teams that need richer notification integrations — Slack, Teams, or webhook callbacks to monitoring systems — the notify key accepts any executable:

# ~/.codex/config.toml
notify = ["powershell.exe", "-File", "C:\\codex-notify.ps1"]

The critical difference from the internal notification path: -File is not -EncodedCommand. Running a named .ps1 file via -File does not match the EDR signatures that flag -EncodedCommand. If your EDR has a blanket PowerShell rule rather than a flag-specific one, switch to a non-PowerShell notifier:

notify = ["C:\\Tools\\notify-send.exe", "--title", "Codex", "--message"]

The Windows port of notify-send (available from the winget catalogue as vaskovsky.notify-send) invokes the Windows notification API directly, with no PowerShell involvement.

A minimal example using it:

notify = ["C:\\tools\\notify-send.exe", "Codex turn complete"]

Codex passes the full notification payload as a JSON argument. For a simple alert, the above is sufficient. For richer handling, write a small .bat or .ps1 -File wrapper that parses the JSON and formats the notification title and message.


For IT Admins: EDR Exclusion Paths

If your team needs Windows toast notifications working natively — perhaps because they rely on Windows Focus Assist integration or existing notification-routing tooling — the cleanest path is a targeted EDR exclusion rather than a process-level policy change.

The correct exclusion is narrow. You are not whitelisting all PowerShell, and you are not whitelisting all of Codex CLI. You are whitelisting the specific command pattern that Codex’s notification subsystem produces.

CrowdStrike Falcon

Create a Custom IOA (Indicator of Attack) exclusion in the Falcon console:

  • Tactic / Technique: Execution — PowerShell
  • Process name: powershell.exe
  • Command line contains: -EncodedCommand
  • Parent process: node.exe or the full path to your Codex CLI installation (e.g. C:\Users\*\AppData\Roaming\npm\node_modules\@openai\codex\bin\codex)

Scope the exclusion to the host group running Codex CLI. Do not apply it globally unless you have audited all PowerShell usage on those hosts.

Microsoft Defender for Endpoint

Add an exclusion in the Microsoft 365 Defender portal under Settings > Endpoints > Indicators > Process:

  • Indicator value: The full path to node.exe for the Codex process
  • Action: Allow
  • Alert severity: Informational (to retain logging without quarantine action)

Alternatively, create an AMSI exclusion using a custom detection rule that carve-outs Codex’s notification pattern:

// Microsoft Defender for Endpoint — Custom Detection (KQL)
// Suppress EDR alert for Codex CLI toast notification via PowerShell -EncodedCommand
DeviceProcessEvents
| where FileName == "powershell.exe"
| where ProcessCommandLine contains "-EncodedCommand"
| where InitiatingProcessFileName == "node.exe"
| where InitiatingProcessFolderPath contains "codex"

Use this query to confirm the pattern before setting the exclusion.

SentinelOne

Navigate to Sentinels > Exclusions > Process and add:

  • Path: node.exe (wildcard-matched to cover version directories)
  • Exclusion type: Path exclusion scoped to Codex installation directories

For more surgical exclusion, use the Threat Intelligence > Custom Rules panel to add a process behaviour rule that permits the specific parent-child relationship: node.exe spawning powershell.exe -EncodedCommand within Codex’s install path.

Carbon Black Cloud

Create a reputation override in the CBC console:

  • Known software: Add the hash of the Codex CLI node.exe or the signed npm package
  • Policy action: Allow and log (not block)

Carbon Black’s approach is hash-based, which means the exclusion will need updating on each Codex version increment. For a more durable exclusion, use a Custom Feed entry that matches by publisher certificate (OpenAI’s npm package signing certificate) rather than by hash.


Group Policy and MDM Deployment

For teams managing many Windows developer workstations via Intune, SCCM, or Group Policy, the config-file fix is the most deployable option. It requires no EDR policy changes and can be rolled out without a security review.

Intune (PowerShell Script Deployment)

# deploy-codex-edr-fix.ps1
# Writes tui.notifications = false to the Codex user config for all users
# Deploy as a PowerShell script in Intune > Devices > Scripts

$ConfigPath = "$env:USERPROFILE\.codex\config.toml"
$ConfigDir  = "$env:USERPROFILE\.codex"

if (-not (Test-Path $ConfigDir)) {
    New-Item -ItemType Directory -Path $ConfigDir -Force | Out-Null
}

if (Test-Path $ConfigPath) {
    $Content = Get-Content $ConfigPath -Raw
    if ($Content -notmatch "notifications\s*=\s*false") {
        # Append the setting — config layering means this takes effect
        Add-Content -Path $ConfigPath -Value "`n[tui]`nnotifications = false"
    }
} else {
    Set-Content -Path $ConfigPath -Value "[tui]`nnotifications = false"
}

Deploy this script with Run this script using the logged-on credentials enabled, so the config lands in each user’s profile rather than a system location. Set the execution context to User and the run frequency to Once.

Group Policy (Registry Preference)

Codex CLI reads its config from the filesystem, not the registry, so Group Policy preferences cannot directly manage it. However, you can use a User Configuration > Windows Settings > Scripts (Logon) GPO entry to run the same PowerShell script above at logon for machines in the target OU.


Detecting Whether Quarantine Is Your Problem

Codex CLI fails silently when the notification-triggered process is quarantined. The session does not error; it simply hangs or terminates without output after a completed turn. This makes the root cause easy to misattribute.

To confirm EDR quarantine is the issue:

  1. Check your EDR console. CrowdStrike Falcon: Activity > Detections, filter by host, look for powershell.exe -EncodedCommand alerts in the same timeframe as the Codex hang. MDE: Incidents & Alerts > Devices, same approach.

  2. Check Windows Event Log. Win + R, eventvwr.msc. Navigate to Windows Logs > Application. Look for events from Microsoft-Windows-Windows Defender or your EDR provider’s Windows service around the time of the Codex hang.

  3. Run Codex with notifications explicitly disabled and check if the hang disappears:

    codex -c tui.notifications=false "echo test"
    

    If the hang is gone, notifications were the trigger.


What a Permanent Fix Looks Like

OpenAI has three viable paths, described in the original article. The fastest is removing the -EncodedCommand flag and refactoring the notification dispatch to use a plain command string. The most durable is switching the Windows notification path away from PowerShell entirely — either via N-API bindings to the Windows Runtime notification API, or by shipping a small, OpenAI-signed notification binary.

As of the v0.172.0 stable release (24 November 2026), no fix has shipped. The issue remains open. Watch the Codex CLI changelog for a Windows notification refactor — it will likely arrive in a point release rather than a sprint, given its self-contained scope.

Until then, tui.notifications = false with notification_method = "osc9" is the recommended default for any Windows developer in an enterprise environment with active EDR enforcement.


References:

  1. https://github.com/danielvaughan/codex-resources/blob/main/articles/2026-11-12-powershell-encoded-command-codex-cli-enterprise-edr-quarantine.md ↩

  2. https://developers.openai.com/codex/config-reference — tui.notifications, notification_method, notify (accessed Nov 2026) ↩

  3. https://falcon.crowdstrike.com/documentation/page/e9fce536/custom-ioa-rule-groups — CrowdStrike Custom IOA rule creation (accessed Nov 2026) ↩

  4. https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-exclusions-microsoft-defender-antivirus — MDE exclusion configuration (accessed Nov 2026) ↩

  5. https://github.com/vaskovsky/notify-send — notify-send Windows port (accessed Nov 2026) ↩