Computer Use screenshots can capture unrelated windows instead of the target window
Summary
Codex Computer Use can take screenshots without accurately targeting the intended application/window. In my case, Computer Use was automatically enabled while Codex was investigating logs in Chrome, but the screenshot capture was not limited to the Chrome/log window. It captured unrelated windows, including my ChatGPT web page and the Codex app window.
I am reporting this as a privacy and safety issue because these screenshots may include unrelated user content that is not needed for the task.
Environment
- Codex app version: 26.519.41501 (3044)
- macOS: Tahoe 26.5
- Device: MacBook Pro 16-inch, Apple M5 Max, 128 GB memory
- Feedback ID:
019e5672-b2fc-7263-b168-0fde21947ad2
What happened
- I asked Codex to do work similar to investigating logs in a Chrome browser window.
- Codex automatically enabled Computer Use.
- When Computer Use needed screenshots, it did not precisely locate/crop the target Chrome/browser window.
- Instead, it captured unrelated parts of my screen, including my ChatGPT web window and Codex app window.
Expected behavior
When Computer Use needs a screenshot, Codex should identify the intended target window first and capture only that window or a tightly scoped region relevant to the task.
Actual behavior
Codex appeared to perform a broad/full-screen capture or otherwise captured unrelated windows that were not the target of the task.
Why this matters
- It can waste tokens by uploading unnecessary screenshot content.
- It can accidentally capture private or sensitive user information from unrelated windows.
- It makes Computer Use less predictable and less safe, especially when multiple windows are open.
Suggested fix
Please make Computer Use screenshot capture target-aware by default:
- Detect and focus the intended app/window before taking screenshots.
- Prefer target-window screenshots or bounded-region screenshots instead of full-screen captures.
- Add a privacy guardrail to avoid capturing unrelated windows.
- Consider warning or asking for confirmation before broad screen captures when the target window cannot be confidently identified.
<img width="2048" height="1714" alt="Image" src="https://github.com/user-attachments/assets/73f842b0-4c86-4e8c-9469-9692928c2153" />
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This suggested duplicate does not appear to be related to this report.
The linked issue (#22892) is about Windows Codex app XHigh verification quality and native WinUI UI fixes. This issue is specifically about Codex Computer Use screenshot capture on macOS: Computer Use captured unrelated windows instead of the intended target/browser window, which creates unnecessary token usage and a privacy/safety risk.
So I do not think this issue should be closed as a duplicate of #22892.
Solution: Fix Computer Use Screenshots Capturing Unrelated Windows
Issue: openai/codex #24301
Labels: bug, app, computer-use
Component: Computer Use Screenshot Capture
Severity: HIGH (Privacy & Safety)
---
1. Problem Statement
Codex Computer Use takes screenshots that capture unrelated windows instead of the target application window. In the reported case:
---
2. Root Cause Analysis
2.1 Screenshot Capture Flow
On macOS, screenshot capture typically uses one of these mechanisms:
The Bug: The screenshot capture is likely using a "capture all visible windows" or "capture primary display" mode instead of targeting the specific window identified by Computer Use.
2.2 Likely Root Cause
Window Targeting Logic Missing or Incorrect
The Computer Use module identifies a target window (e.g., Chrome tab showing logs), but the screenshot capture function doesn't use this window reference. Instead, it captures:
Race Condition: Between identifying the target window and capturing the screenshot, the window z-order may have changed, causing a different window to be captured.
---
3. Proposed Fix
3.1 Primary Fix: Window-Targeted Screenshot Capture
File:
src/computer-use/screenshot.ts(or equivalent)3.2 Secondary Fix: Window Validation Before Capture
Add validation that the target window is still valid before capturing:
3.3 Tertiary Fix: Add Source Attribution to Screenshots
Every screenshot should include metadata about what was captured:
This allows the Computer Use agent to verify that the correct window was captured before processing.
---
4. Testing Strategy
Unit Tests
Integration Tests
Manual Testing
---
5. Impact Assessment
---
6. Files to Modify
| File | Change |
|------|--------|
|
src/computer-use/screenshot.ts| Add window-targeted capture mode ||
src/computer-use/window-utils.ts| Add window validation helpers ||
src/computer-use/computer-use-agent.ts| Use window-targeted capture ||
src/types/screenshot.ts| Add source attribution fields ||
tests/computer-use/screenshot.test.ts| Add regression tests |---
7. Estimated Effort
Additional Windows reproduction showing that the selected-window metadata and returned bitmap can disagree.
Observed
This is more specific than an accidental full-screen capture: the accessibility tree identified the intended window, while the screenshot payload belonged to another window. Protected unrelated task content entered the model context, so coordinate actions were stopped immediately.
A fresh selection/activation again produced the correct accessibility tree, but target-safe input methods did not change the selected app state; no coordinate fallback was attempted. The isolated test app was then closed cleanly.
Expected
This is both a functional targeting failure and a privacy boundary issue. No unrelated screenshot, task text, local path, window ID, or user data is included in this report.