360 Secure SkillHub
360 安全技能中心

agent-desktop-windows

本 Skill 是 agent-desktop 的 Windows 平台说明,涵盖交互式会话与权限检查、UIPI 和 UIA 限制、无头操作与前台安全路由、窗口与控件引用、启动及通知行为,并提供错误码对应的故障排查步骤。它要求 Windows 交互式桌面和 agent-desktop 可执行文件,不提供安装包。

分类:自动化
vercel-labs
热度 43.88
最近更新 2026-12-05 00:04:49

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add vercel-labs/agent-desktop/agent-desktop-windows
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
agent-desktop-windows
tags
windows-automation, accessibility, uia, ai-agent, gui-automation, cli
requirements
["agent-desktop"]
description
Windows setup and troubleshooting for agent-desktop: PowerShell refs, interactive sessions, UIPI, foreground-safe routes, and verification.

agent-desktop on Windows

Use the core skill's headless observe, act, verify workflow. A platform capability never authorizes --headed; only the user's explicit request does.

Setup and permissions

The executable links the Microsoft C runtime statically, so it needs no Visual C++ Redistributable. Run agent-desktop status in the signed-in user's interactive desktop session. permissions.accessibility reports whether UI Automation can be created: granted, denied, or unknown. automation is not_required; screen_recording is not_required when a capture backend is available, otherwise unknown. There is no permission dialog that bypasses a session or integrity boundary. Services, secure or locked desktops, and another user's session are not supported targets. Use agent-desktop permissions to recheck after the user fixes access.

Quote refs in PowerShell: '@s8f3k2p9:e1'; a bare @token invokes splatting. Use $env:NAME = 'value' for environment variables. Windows PowerShell 5.1 drops the double quotes in a JSON argument: pass ($json -replace '"','\"') to batch, which has no stdin or file route. PowerShell appends a line ending to piped text, so --stdin keeps it; use cmd /c "agent-desktop set-value '<ref>' --stdin < file.txt" for exact text.

Platform behavior

  • A covered window can be driven headless. A snapshot of a minimized window marks every element offscreen, so none of its controls can take a ref action. Headless restore of a minimized window is refused with POLICY_DENIED and nothing is sent, because some applications (the Management Console, Character Map) activate themselves when restored whatever show command is used. Stop on that refusal; restoring a maximized window stays headless.
  • UIPI (User Interface Privilege Isolation) blocks input into a higher-integrity process. Ask the user to run the CLI at the target's integrity level when needed; a working observation does not establish input permission.
  • Headless routes use UIA patterns, legacy accessibility and native control messages; none takes the foreground. agent-desktop right-click, agent-desktop focus, an expand that opens a popup (combo box, menu), agent-desktop scroll-to on an item of a Win32 tree view and physical input need headed mode; a semantic value write may work instead when it matches the user's task. Headless agent-desktop type inserts at the caret of a native Edit or RichEdit control, or fills an empty writable ValuePattern value, and reads the control back: delivered_verified when the text shows and core can predict the result, else delivered_unverified. A non-empty field without a native edit, or one that cannot be read, is refused with POLICY_DENIED. type --interval-ms sends one character per action, so in an empty field without a native edit it writes the first character, then refuses with delivered_unverified: use set-value there. Never retry a refusal headed.
  • A ref must be unique in its window, or inside its nearest unique ancestor (a cell inside its row), at capture and resolution. A root drill cannot make identical twins unique. Choose a distinct control.
  • press escape with --app or --window-id on a window that is not in front is refused as before, unless that window shows an open menu, combo box or split button: then the innermost one is collapsed (ExpandCollapsePattern.Collapse), delivered_verified once read back closed. A tree item is never collapsed. collapse of an open combo box or menu item works headless, and reports not_delivered when it is already closed.
  • press --app or --window-id works headless only when that process owns the foreground window. Otherwise it sends nothing and returns ACTION_FAILED (details.check: process_focus, not_delivered). There is no background key route.
  • --trace PATH: the file's folder must exist and have a private DACL (you, SYSTEM, Administrators). A folder that grants Users write gives INVALID_ARGS.
  • A grid reports row_count and column_count. A row is a record: find it by its own name, and its cells through it. agent-desktop click on a grid cell that lists Click selects the row that holds it. A cell carries no grid position.
  • A virtualized list builds only the rows near the screen. agent-desktop select @list "<name>" reaches a far row by name when the list exposes the item container pattern. A ref to a row that scrolled out of the built set answers STALE_REF; select it by name again.
  • set-value and clear on a native Edit or RichEdit control replace the text as an edit (select all, then EM_REPLACESEL), so the app sees a change and asks to save on close. The step is Win32.EM_REPLACESEL. No focus moves.
  • A field whose text is longer than 2048 characters cannot be read: get returns ACTION_FAILED with details.kind: "value_exceeds_read_limit" and the length. Do not retry it. clear, set-value, focus and click on its ref still work.
  • agent-desktop launch takes an absolute path, a bare name in System32 or the Windows directory, a name registered under the App Paths registry key (chrome), or a packaged app's id from Get-StartApps (<family>!<app>, or shell:AppsFolder\<id>); not a display name or PATH search. Helpers of one program count as one instance. An instance with no window (a tray app) cannot be attached to, so the launch starts the program again. Without --activate the process starts with a show-window hint that asks for no activation, and a packaged app is attached to the one running instance that shows a window; it goes to the activation manager, which always raises it, only when it has no window, carries arguments, or asks to activate, and the guard puts the user's window back the same way. A window that takes the foreground or the top of the window order is sent back below the window that had it, and the result reports focus_returned: true, or false with a suggestion. A window you switched to is never touched.
  • Chromium/Electron trees can be thin while accessibility settles. Finish a bounded observation before concluding content is absent.
  • An open application menu is the menu surface; there is no menubar surface. An owned popup window of the app (a ribbon drop-down) is a popover: list-surfaces lists it, snapshot --surface popover reads it. When several popovers are open, name one with --app <app> --window-id <its w-id from list-surfaces>; without a name the read is refused with AMBIGUOUS_TARGET rather than reading a different popover. Shell surfaces are separate from ordinary window inventory. quick-settings refuses with INVALID_ARGS naming action-center.
  • Verified on Server 2019 only: Action Center opens with Win+A (Win+N from build 22000, untested). click on an Expand-only button toggles it and needs --headed; a press that opens a modal returns delivered_verified once a new window shows, so read the dialog by its window id. A TextPattern control with no ValuePattern takes type and get reads its text. A tree hidden by higher integrity returns PERM_DENIED.
  • Notification reads adopt an already-open Action Center headless; opening it and notification mutations require headed permission. Indices can reorder: copy the expected app and title from a fresh listing before a single-item action.
  • agent-desktop wait --notification opens and closes the center per poll when it was closed on entry, but leaves an already-open center open. Budget for the measured 1254.2 ms per poll median plus the polling interval; transient toasts can be missed.
  • agent-desktop cursor-overlay enable reports rendered: true only after renderer acknowledgement. The renderer starts from agent-desktop.exe or the npm agent-desktop-win32-<x64|arm64>.exe. It does not move the physical pointer, and headed actions skip its travel animation.
  • Sandboxes are not available on Windows yet; for your own container see agent-browser.dev/desktop/guides/docker-container.

Value verification is not application commit: delivered_verified with element_value confirms only the field. unavailable means readback evidence was missing, not that delivery failed. post_action_verification means the readback contradicted the request after delivery, so inspect post_state without retrying. Only slider, incrementor, scrollbar, and handle compare numeric values with tolerance; a textfield compares exactly, even if the app reformats it.

Troubleshooting

Read the disposition before applying a fix. Match both the code and message.

Code and message pattern Cause and fix
INTERNAL: EnumWindows failed to enumerate top-level windows The caller runs on a window station or desktop it cannot read, as a sandbox, a service or an ssh login does. The adapter already tried the Default desktop of its station. platform_detail and details give win32_error, window_station, desktop, session_id and desktop_attach_error. Run agent-desktop in the user's interactive session (WinSta0\Default).
PERM_DENIED: UI Automation access is denied for this process A restricted token or noninteractive session cannot use UIA. Run in the user's interactive session with an allowed token.
PERM_DENIED: UIPI, integrity, or elevated target The target has higher integrity. Ask the user to provide a matching-integrity caller; do not assume observation grants input access.
POLICY_DENIED: foreground, physical input, or closed Action Center The route needs headed mode. Stop and tell the user which operation needs it; do not add --headed.
STALE_REF: Stored ref does not match any live element (resolve_no_candidate) The adapter could not land the ref. Take a fresh snapshot in the same session; do not infer delivery from the missing target.
TIMEOUT from close-app, details.cause: dialog_pending A dialog (a save prompt) in details.sheets holds the app; it has not exited. Answer it; --force discards unsaved work.
ACTION_FAILED: post-action verification or requested value mismatch Delivery occurred but readback differs, possibly because the app reformatted the value. Inspect live state and details.post_state; do not repeat the write.
PERM_DENIED: private file DACL grants an untrusted principal The state folder grants access beyond trusted principals. Keep only the user, SYSTEM, and Administrators on the folder, or point AGENT_DESKTOP_HOME at a new folder under the user profile and let the tool create it.
INTERNAL: lock directory is not trustworthy with details.kind lease_directory_untrusted The per-user lock folder under C:\ProgramData\agent-desktop was created by another account or elevation, or an access check on it was refused. details.path names the folder and details.step the failed call. Nothing was sent (not_delivered). Remove that folder as an administrator so the tool creates it again; do not edit its permissions.
PERM_DENIED: private file parent is owned by a foreign principal The state folder's owner is not eligible for this process. Point AGENT_DESKTOP_HOME at a new folder under the user profile and let the tool create it; do not take over another principal's folder.