Introduction¶
The DeepSeek Harness (DSH) ecosystem is known for its plugin-based extensibility, allowing developers to extend agent behavior by attaching different capabilities. When performing web automation tasks, a common pain point is how to let an AI agent reuse an existing login state, operate in real environments, and handle login intercepts, CAPTCHAs, or native dialogs. The dsh-browser-playwright-codex plugin provides a solution through Playwright. It does not rely on headless mode; instead, it drives a visible browser window and hands control back to the user when an obstacle is encountered.
Plugin Positioning¶
This is a network-enabled tooling plugin maintained by developer miqian-nomad. Its core purpose is to allow an AI agent to leverage the browser accounts already logged in by the user and perform form filling, list scraping, and multi-tab operations on real web pages. The plugin runs in a visible browser window, and the user can take over at any time. When a step requires human intervention, such as a CAPTCHA, it automatically stops and waits for instructions.
Core Features¶
The plugin provides the following capabilities:
- Account reuse and state persistence: Using Playwright’s Profile mechanism, the plugin can continue operating with an account that the user has already logged into. As long as the Profile remains unchanged, the login state is usually preserved even if the window is closed or Harness restarts.
- Visible window and focus management: The browser window is displayed on the desktop, allowing the user to observe what the AI is doing. When the window is minimized, the plugin does not steal system focus, allowing the user to continue using the computer in the background.
- Interactive interruption and waiting: When encountering a login page, two-factor authentication, a CAPTCHA, or a native browser dialog (
alert/confirm/prompt), the plugin automatically stops and reports the status, then waits for the user to intervene using tools such asbrowser_dialog, rather than blindly clicking. - Stable element references: After obtaining a page snapshot with
browser_snapshot, the plugin assignsrefnumbers to visible elements. This reference approach is more stable than CSS selectors. When a reference becomes invalid, it fails fast and provides an explanation. - Multi-tab support and screenshots: Supports managing, switching, opening, and closing tabs; taking page screenshots; and extracting structured data, with the latter requiring the corresponding capability to be enabled.
Installation and Enabling¶
Installing this plugin requires specifying a Harness Profile. The plugin is published on npm (since v0.5.1) and can also be installed directly from the repository.
dsh plugin --profile <name> add dsh-browser-playwright-codex
After installation, the plugin automatically attaches the related tools. Note that, by default, the powerful tools browser_evaluate (JavaScript execution) and browser_cdp (Chrome DevTools Protocol) are neither registered nor enabled, which helps reduce security risks.
Typical Usage¶
After installation, you can start using it without additional configuration. The default tool prefix for the plugin is browser_.
Below are some common use cases:
- Scraping a list: Ask the AI to open a specific web page and extract the titles and links of the first five stories.
Open https://news.ycombinator.com and list the titles of the first five stories with their links.
- Querying orders: Access a site that requires login and extract the delivery address from the most recent order.
Go to my orders page on <site> and tell me the delivery address on the most recent order.
- Form filling and preview: Fill in a contact form, but stop before submitting and show the filled content.
Fill in this contact form, but stop and show me the filled form before you submit it.
Considerations¶
When using this plugin, there are several key points to keep in mind:
- A snapshot must be obtained first: Any
ref-based operation, such as clicking or filling, must first runbrowser_snapshotto obtain valid element references. - Reference invalidation:
refvalues are document-context based. If the page structure changes, the references become invalid, and the plugin fails fast with an explanation to avoid clicking the wrong element. - Irreversible operations: Form submission, payment, deletion, and sending messages are irreversible operations. It is recommended to review the form content before executing, or to ask the AI to stop before performing the operation.
- Security restrictions: For security reasons,
browser_evaluatehas been disabled due to serious findings. To enable advanced functionality, the corresponding Capability must be enabled at the deployment level.
Conclusion¶
dsh-browser-playwright-codex addresses state synchronization and visibility issues when agents operate in real web environments. Through its visible window and interruption mechanisms, it reduces the difficulty of debugging automation. If you need to handle complex login flows or scenarios requiring human confirmation in a DSH environment, this is a tool worth trying.