Skip to content

Windows sandbox gives only Access denied for read-only WMI process-event subscriptions #35563

Description

@Guffawaffle

Codex version

codex-cli 0.145.0

Environment

Windows Codex session using the default Windows sandbox.

What happened

While dogfooding a WPF launcher, both a packaged child process and a direct PowerShell probe attempted to subscribe to the read-only WMI process lifecycle events Win32_ProcessStartTrace / Win32_ProcessStopTrace. Starting the System.Management.ManagementEventWatcher failed with:

System.Management.ManagementException: Access denied

The failure exposed no sandbox-specific diagnostic or capability signal, so it initially looked like an application/runtime defect.

Expected behavior

One of the following would make this actionable without weakening sandbox safety:

  • permit this read-only subscription when it fits the Windows sandbox contract;
  • expose a capability/diagnostic that identifies WMI event subscriptions as sandbox-denied; or
  • document the restriction and recommended event-driven alternatives.

Workaround

The launcher replaced WMI with unprivileged RegisterShellHookWindow window-created events and a tracked System.Diagnostics.Process.Exited subscription. That works inside the same Codex session without interval polling.

Why this matters

Read-only lifecycle observation is useful for Windows desktop-app development. A bare Access denied loses the fact that the failure is environmental and can send application debugging down the wrong path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIenhancementNew feature or requestsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions