Skip to content

window: target can silently record the wrong window, and start_recording does not report which window matched #89

Closed

Description

@TMHSDigital

Problem

window:<title> falls back to a case-insensitive substring match and silently picks the topmost match (src/utils/windows.ts:58). A short or generic title such as window:Code or window:Chrome can resolve to a different window than intended, for example a password manager or chat window whose title contains that word, and record it. screenshot returns matchedWindow and region, but start_recording drops that information (startRecording.ts:78 destructures only target, monitors), so the agent never learns what it is actually recording.

Why it matters

The threat model centres on capturing exactly what was asked for. A wrong window match is a quiet privacy failure.

Suggested fix

  • Return matchedWindow, matchCount, and the resolved rectangle from start_recording, as screenshot does.
  • When matchCount > 1, or the match came from the substring fallback, add a warning listing the candidate titles.
  • Add an opt-in window-exact:<title> target, or an exactTitle: true parameter, that refuses substring fallback.

Done when

start_recording reports which window it matched, ambiguous matches produce a warning, and exact-only matching is available.

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

    enhancementpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions