agent_capability Plugin
Browser (Playwright)
Browser gives workflow agents (`visual_review`) and Coding Mode chats (RuntimeSessions) a constrained, headless Playwright browser: navigate, click, fill, hover, keyboard, drag/drop, upload, evaluate JS, snapshot, screenshot, resize, emulate, wait, close, and provider-neutral Runtime input from the operator panel. Navigation is hard-restricted to loopback URLs (see `LoopbackGuard`) -- the browser can only drive a session's own in-step preview, never an arbitrary network destination. On by default. Browser owns the visual-review judge, including its workflow step, prompt, repository plan, evidence artifacts, and on-demand chat tools. It contributes the judge at `workflow:judge`; disabling Browser omits visual-review loops from new workflows without making composition fail. Browser remains disableable, while the standard plugin guard refuses a disable if a non-terminal workflow still contains a Browser-owned step.
Browser
Browser gives workflow agents (visual_review) and Coding Mode chats (RuntimeSessions) a constrained, headless Playwright browser: navigate, click, fill, hover, keyboard, drag/drop, upload, evaluate JS, snapshot, screenshot, resize, emulate, wait, close, and provider-neutral Runtime input from the operator panel. Navigation is hard-restricted to loopback URLs (see LoopbackGuard) -- the browser can only drive a session's own in-step preview, never an arbitrary network destination. On by default.
Browser owns the visual-review judge, including its workflow step, prompt, repository plan, evidence artifacts, and on-demand chat tools. It contributes the judge at workflow:judge; disabling Browser omits visual-review loops from new workflows without making composition fail. Browser remains disableable, while the standard plugin guard refuses a disable if a non-terminal workflow still contains a Browser-owned step.
Service boundary
@playwright/mcp is Microsoft's own MCP server for Playwright, and it is the entire surface Browser proxies -- McpToolSet's granular tools (browser_navigate, browser_click, ...) forward almost 1:1 to it through BrowserTool.call -> SessionRegistry.fetch -> Session#call_tool. That one choke point is also the whole of Browser's service boundary: every owning session (a workflow Run, or a chat's RuntimeSession -- Coding Mode, planning, or coworker) gets its own Session, wrapping one MCP::Client connection reused across every tool call so a multi-step flow sees the same page Playwright left it in (SessionRegistry, keyed by SessionContext#session_key).
runtime_input is a deprecated compatibility adapter, not a second browser input engine. It delegates target-based click, fill, hover, keyboard, drag, drop, and upload events to these same Playwright-backed tools and recognizes the same Runtime Control Lease. Stable refs come from semantic inspection. Text entry consequently uses Playwright's native input behavior for text, email, password, textarea, contenteditable, and framework-controlled fields. Synthetic DOM dispatch is never used. Input without a snapshot ref (an operator clicking the streamed frame in the Runtime panel, or pasting with nothing targeted) is also native: a click at viewport coordinates goes through Playwright's mouse (or touchscreen for touch), with held Ctrl, Alt, Shift, and Meta pressed around it, and a target-less paste is inserted into the focused element through Playwright's keyboard. Keyboard events carry held modifiers as a Playwright chord such as Control+Shift+S. These paths check and record the same input lease as the target-based tools.
Protocol: streamable HTTP MCP, spoken by the same binary. @playwright/mcp already ships two transports for the identical tool surface: stdio (the default path) and streamable HTTP, entered with --port <port> [--host 0.0.0.0], served at <endpoint>/mcp. Syrus's mcp gem ships a full client for both -- MCP::Client::Stdio and MCP::Client::HTTP -- behind the same transport-agnostic MCP::Client (#connect, #call_tool, #close). So the chosen boundary for the container-backed Browser Plugin Runtime service (below) is: run playwright-mcp --headless --isolated --block-service-workers --port <port> --host 0.0.0.0 as the service's process (mirroring Git Mirror's PluginRuntime::Service container contract), and have Session connect to it with MCP::Client::HTTP instead of spawning a local subprocess.
This was chosen over a bespoke Syrus-specific HTTP API or another bridge protocol because it needs no translation layer at all: the exact same @playwright/mcp tool schema reaches the agent either way, MCP::Client does not care which transport it holds, and BrowserTool and every browser_* tool class stay untouched -- they only ever call session.call_tool(name:, arguments:). The streamable HTTP transport's own session semantics (Mcp-Session-Id) are also exactly what "session reuse per owner, isolated browser state" needs: each owning Session opens its own MCP session against the shared service and gets its own isolated browser context, the same guarantee --isolated gives the stdio path today, without Syrus building any per-owner multiplexing of its own.
Client shape
SyrusBrowser::Session exposes three class-level entry points, all returning a Session wrapping one MCP::Client:
.spawn_stdio(session_key, command:, args:, env:)-- the fallback
path: spawns playwright-mcp as a per-owner stdio subprocess baked into the worker image.
.spawn_service(session_key, endpoint:, headers: {})-- connects to
a Browser Plugin Runtime service at endpoint over streamable HTTP MCP (MCP::Client::HTTP, pointed at <endpoint>/mcp).
.spawn(session_key, ...)-- the fallback-selecting entry point
SessionRegistry's default factory actually calls. Reads SyrusBrowser::Configuration.endpoint (PluginRuntime::Services.endpoint_for("browser"), which never makes a network call -- it reads the last Plugin Runtime reconcile) and picks .spawn_service when it answers an address, .spawn_stdio otherwise.
#call_tool, #close, and the once-per-session "clear browser state on first navigate" behavior live on Session itself and need no transport-specific branching: MCP::Client#call_tool/#connect and MCP::Client::HTTP#close (a session-terminating DELETE) already implement the same contract MCP::Client::Stdio does.
The container-backed service
plugins/browser/container/ builds the image SyrusBrowser::RuntimeService contributes through "plugin_runtime:service". It runs @playwright/mcp exactly as documented above -- --headless --isolated --block-service-workers --no-sandbox --allowed-hosts '*' -- bound to a loopback-only address inside the container, plus a small Go bridge (internal/bridge) that owns the service's actual exposed port (8080).
The bridge exists for one reason: @playwright/mcp's own HTTP transport answers every plain GET with a 4xx (it only understands a POST that starts an MCP session, or a GET carrying an already-established mcp-session-id header), so nothing at its own port can serve as the HTTP health check the PluginRuntime::Service contract expects (healthcheck: { path: "/healthz" }, probed with a plain GET by both PluginRuntime::ManagedDriver and PluginRuntime::ExternalDriver). The bridge answers GET /healthz itself -- from a live TCP dial to the @playwright/mcp child process, not a cached flag -- and reverse-proxies everything else (the real MCP traffic, including the DELETE that ends a streamable HTTP session) straight through. --no-sandbox mirrors @playwright/mcp's own documented container recipe: Chromium's setuid sandbox helper needs privileges this service intentionally does not have, matching the existing Plugin Runtime manager policy of no extra container privileges. --allowed-hosts '*' turns off @playwright/mcp's own Host-header check, which would otherwise reject traffic arriving with the service's Compose DNS name in the Host header instead of the loopback address it bound to -- the bridge's exposed port is the actual network boundary, not that check.
No volumes: a browser session's state lives only as long as its MCP connection (--isolated) and leaves nothing behind when it closes. No env: unlike Git Mirror this service holds no secret to share with Syrus, and Session.spawn_service does not send it any request headers today, so the service accepts every request that reaches its exposed port -- the project network Plugin Runtime places it on, never published to the host, is what keeps that reachable only from Syrus's own web/worker containers.
Images are published by bin/publish-plugin-images, the same convention plugin_runtime and git_mirror use (plugins/*/container/Dockerfile -> ghcr.io/tkadauke/syrus-plugin-browser), tagged to match the Syrus release that runs them (SyrusBrowser::Configuration.image).
Browser only optionally_depends_on Plugin Runtime, not depends_on. Unlike Git Mirror -- which is off by default and exists purely as a Plugin Runtime accelerator -- Browser is on by default and must keep offering all of its tools (workflow visual_review, a chat's browser RuntimeSession) purely through the bundled stdio subprocess when Plugin Runtime is disabled, which it is out of the box on every fresh install (plugin_runtime's own default_enabled is false). A hard depends_on would mark the whole Browser plugin :degraded and withhold every one of its providers -- not just the service -- the moment nobody has separately opted into Plugin Runtime, which is the common case. SyrusBrowser::Configuration.endpoint resolves PluginRuntime::Services by name ("PluginRuntime::Services".safe_constantize) rather than through a bare constant reference for the same reason one level down: it must return nil gracefully even if the plugin_runtime plugin were physically removed from the tree, not just logically disabled.
Safety model
Browser tools declare separate permission capabilities for observation, loopback navigation, interaction, JavaScript evaluation, file/data upload, and closing an owned session. None of them asks the operator: every one acts only through a browser the agent already drives, and page-affecting input is held back by the input lease rather than by a policy prompt. Evaluation and upload retain a conservative high-risk classification, as does ordinary interaction, because the semantic consequence of a page target cannot be inferred safely - but risk describes what they reach, not how often an operator is interrupted.
These descriptors do not replace the hard boundaries: navigation remains loopback-only, upload authority fingerprints exact paths without exposing them in approval copy, and page-affecting Coding Mode calls still require the active Runtime input lease.
Each leased interaction is recorded in the run's input audit. browser_fill text typed into a password field, a field whose autocomplete is current-password, new-password, or one-time-code, or a field that cannot be inspected is recorded only as a redaction marker and its length, as is any typed text that looks like a token or other secret. The page still receives the real text.
Browser navigation is scoped to loopback preview URLs regardless of transport (LoopbackGuard, enforced by NavigateTool before any tool call reaches Session). The service-backed path does not change that: the guard runs in Syrus, not in @playwright/mcp, so it applies identically to a spawned subprocess or a shared service connection.
Operations
Inspecting and restarting the service goes through the generic Plugin Services admin page (/admin/plugin_services, documented in full in plugin_runtime.md), the same as every other container-backed plugin. For browser specifically:
- Status shows
pending/pulling/starting/running/unhealthy/
stopped/error/unavailable/unconfigured, the container image, and the last health-check error, if any -- e.g. GET /healthz: connection refused when the @playwright/mcp child process has died or is still starting. That is always enough to tell "the service is down, Browser is falling back to per-Run subprocesses" from "the service is healthy" without needing to open a shell.
- Logs streams the bridge's and
@playwright/mcp's own stdout/stderr --
process startup, the health-check dial, and any command-level errors. It never contains per-session browser traffic: the bridge (internal/bridge) is a plain reverse proxy with no request-logging middleware, so a navigated URL, a page snapshot, form values typed into a page, or a screenshot never appear in the container's logs, regardless of which owning Run or Coding Mode chat generated them. Logs are diagnostic about the service process, not an audit trail of what agents did with a browser -- that already lives on the owning Run/chat (submitted screenshots, tool call transcripts), not here.
- Details does not appear for
browsereven while it isrunning: the
Details panel is opt-in per service (PluginRuntime::Service#service_details), and SyrusBrowser::RuntimeService deliberately implements no service_details because there is nothing safe and useful to summarize -- the service holds no state across sessions (see "No volumes" above), so there is no session list, page inventory, or history a details view could show. Absence of a Details action here is a guarantee, not an oversight: it structurally keeps live session content out of the admin page.
- Stop/Start/Restart behave exactly as documented for any managed
service. Stopping it is safe at any time -- Session.spawn falls back to the bundled stdio subprocess automatically the next time a Run or chat opens a browser session, no operator action required beyond restarting the service when ready.
Fallback is silent by design. Nothing pages an operator when the service degrades; Session.spawn just stops choosing it (Configuration.endpoint reads nil the moment the health check stops passing) and every new session goes back through the worker's bundled stdio subprocess. The service is an accelerator, never a hard dependency -- see "The container-backed service" above. Use the admin page's state/logs when you want to know *why* it went away, not because anything stopped working.
Device emulation (browser_emulate)
browser_emulate takes an optional preset (iphone-15-pro, desktop) plus explicit overrides: viewport, device_scale_factor, is_mobile, has_touch, user_agent, safe_area_insets, color_scheme, reduced_motion. Unspecified fields keep their current value; desktop resets everything, including insets. It runs through @playwright/mcp's browser_run_code_unsafe, opening a CDP session on the page (Chromium only; other browsers get a tool error), so stdio and Plugin Runtime service sessions behave identically. CDP overrides persist across navigation and reloads. Presets live in SyrusBrowser::EmulationPresets.
Visual Review
Visual review gives the worker agent a configured RuntimeSession target it can drive against its own workflow workspace to catch visible defects — broken layout, missing content, console errors, incorrect rendering, broken interactions — before graders run. An independent reviewer agent forms its own go/no-go judgment, exercises the running app, captures "after" screenshots as Workflow artifacts, and records a verdict that can send the change back for another implementation pass.
Execution is provider-neutral: every configured target is a workflow-owned RuntimeSession. The reviewer gets generic inspect, wait, input, snapshot, and capture tools, while Syrus owns lifecycle, control leases, and teardown on success, failure, retry, cancellation, and missing submission. Existing preview: configuration is translated into a browser target automatically, so current browser reviews do not require a configuration migration. The reviewer prompt carries the selected provider key, advertised capabilities, launch/build options, dimensions, review notes, and required evidence labels. Terminal-only reviews receive generic runtime controls without browser DOM tools; mixed browser/terminal reviews receive both. Terminal evidence is attributed to its target and semantic screen generation in the Review UI.
On by default
Visual review is on by default instance-wide; there is no feature flag to toggle. A repository opts out (or overrides rounds/files/seed notes) per repo via .syrus.yml's visual_review block (see syrus_yml.md); omitting the block (or the enabled key within it) defers to the always-on default.
How it works
Visual review starts a repository preview when needed, opens affected pages in a browser, checks desktop and mobile layouts, exercises relevant interactions, captures evidence, and records approved, needs_work, or skipped. A needs_work verdict enters the configured repair loop; skipped means the change is not visually testable or the environment cannot support a meaningful review.
Draft browser captures are private to the active review until submitted. Submitted screenshots and comparisons appear in the workflow review surface. Draft evidence is bounded and expires; failed curation remains available without publishing misleading evidence.
The review uses the submitted test plan and changed-file surface map to choose pages. It may skip before invoking an agent when configured file patterns do not match. In multi-project repositories it selects an affected preview-capable project and reports ambiguity rather than testing an unrelated app.
Changed-surface coverage
Syrus expects evidence for the actual changed route, screen, or component state. A faithful proxy is acceptable only when the task or diff makes that shared surface the intended target and the reviewer explains the choice. Unreachable routes, authentication walls, missing seed data, unexpected redirects, and preview errors are reported as blockers, not approved from an adjacent page.
Verdicts
approved— the changed surfaces were exercised and look correct.needs_work— findings are actionable and enter the repair loop.skipped— the change is not visually testable or an external environment blocker prevents review.
The reviewer holds input control of the runtime sessions its review started, so it can click, type, and evaluate in its own preview without acquiring a control lease. Input control still serializes controllers: while an operator (or another agent) has taken control of the session, the reviewer's input is refused until control is handed back. A review that submits skipped after the runtime refused its input was not performed, so it is not recorded as a successful skip: the step fails with review_evidence_capture_failed, a retry-in-place infrastructure failure, and the skipped iteration is kept as history marked not reviewed.
Every requested review opinion receives one repair reaction when it returns needs_work, including the final configured round. Findings from prior iterations remain available to later review and repair turns. The reviewer must submit a verdict explicitly. Because visual review is optional, an exhausted final repair proceeds without turning the visual verdict into required approval of the new HEAD. Any required code-review gates invalidated by that repair are still refreshed against the new HEAD before downstream work continues.
Configuration (.syrus.yml)
visual_review:
enabled: true
rounds: 2
required: false
when_files_changed:
- "app/frontend/**/*"
- "app/views/**/*"
seed_notes: "Log in as demo@example.com / password to reach the dashboard."
enabled— explicitly turns visual review on (true) or off
(false) for this repository, overriding the always-on default. Omitting the key (or the whole block) defers to that default (enabled).
rounds— how many visual-review passes run. Range 0–10, default 1.required— whether unavailable browser-preview preparation fails the
workflow. Defaults to false, which records the review skipped, raises a WorkflowWarning, and continues when the preview cannot be prepared. Set to true to fail the workflow instead. A configured terminal runtime target that cannot start always fails coverage: missing workspace affinity, relay startup failure, and relay readiness timeout cannot become successful skips. This does not change reviewer-submitted needs_work findings.
when_files_changed— optional glob patterns; when present, visual
review only runs when at least one changed file matches. Same semantics as a grader's when_files_changed. Omitting it runs visual review regardless of which files changed.
seed_notes— optional free text describing how to reach an
authenticated or populated state in the preview app. Read by the reviewer agent as a hint, not executed.
CLI/TUI targets may declare an opt-in environment block with literal non-secret static values and/or a repository-owned argv command that maps explicit generic runtime inputs to allowlisted output variables. Commands get JSON on stdin and emit KEY=value records; undeclared output is dropped, hard-forbidden process-control names fail coverage, and resolved values are never persisted. See syrus_yml.md for the full schema and security rules.
See syrus_yml.md for the full .syrus.yml reference.
Nested visual_review: blocks are scoped to their project. Their when_files_changed patterns are resolved relative to the nested .syrus.yml, and their seed notes are shown when that project preview is one of the affected choices. Use root settings for repository-wide policy and nested settings for product-specific review scope, seed guidance, or opt-outs.
Seeding requirements
The reviewer drives the same in-step preview start_preview/stop_preview tools spawn (see preview_environments.md). A preview boots from a fresh checkout on every run, so reaching an authenticated or populated view depends on the repository's preview seed command being idempotent and producing demo data. The "Seed preview demo data" Job template (lib/agent_skills/configure-preview-seed-data.md) is a one-time, per-repo onboarding pass that makes the seed mechanism idempotent, adds a demo user and representative sample data if the repo has none, and records how to reach that state in visual_review.seed_notes. Repositories that skip this onboarding still get a running preview, but the reviewer agent may only ever see an unauthenticated or empty-state app. If the documented seed notes don't cover the feature under test, the reviewer agent may run additional ad hoc seed commands itself via its normal shell access before driving the browser.
The browser tool set
The reviewer can navigate, inspect accessibility structure, click, type, select, hover, evaluate page behavior, resize the viewport, and capture screenshots. Reviews normally exercise desktop (1280×800) and mobile (390×844) layouts unless a surface is genuinely single-viewport. Browser access is limited to the active preview and literal local preview hosts.
Screenshot artifacts
Use submit_visual_artifact to publish an intentional browser capture with a title and description. It can capture the current browser or a selected visible element and records page, viewport, and subject context. A file-path upload is reserved for repository-owned render outputs, not arbitrary worker files.
When compatible before-and-after evidence exists, Syrus may generate a visual comparison and quantitative diff. Incompatible dimensions or mismatched subjects are reported and skipped rather than compared misleadingly. Evidence appears in workflow and Job review surfaces.
Manual "Run visual review" trigger
Operators can run visual review on demand — for a fresh look after implementation, or to cover a pass that was skipped or never configured — without waiting for a new implementation. The Job detail page exposes a "Run visual review" action (and chat exposes the equivalent run_visual_review pending action) on implemented or approved Jobs with no active run, gated by the same visual-review plan resolution the automatic loop uses — the action is unavailable if visual review isn't configured/enabled for the repository. This dispatches a standalone manual_visual_review workflow and does not create before/after comparison artifacts by itself. The reviewer runs alone against whatever is already on the branch; unlike the automatic loop, it does not loop back into implement/respond on needs_work. The verdict and critique are recorded on the workflow the same way an automatic pass records them, for the operator to read and act on manually.
The chat run_visual_review tool also accepts an optional prompt of up to 4,000 characters. It appears in the confirmation card and is stored on the resulting workflow so retries and worker handoffs retain it. The reviewer sees it in a separately labelled manual-review section for reproducing a focused viewport or interaction state and capturing the requested evidence. It does not become implementation feedback, does not change repository seed notes, and never authorizes the reviewer to modify the implementation.
The Job detail page also exposes a separate "Run before/after comparison" action when visual-review screenshots already exist. That dispatches visual_diff directly for operator inspection rather than changing the manual visual-review semantics.
Chat exposes the same distinct action as the operator-confirmed run_visual_diff tool. It reuses usable screenshots from a prior visual review and creates a visual_diff Workflow only after confirmation. Missing screenshots and authentication or error-wall captures for another intended surface are reported as unavailable comparisons. Unlike run_visual_review, this tool captures the base revision and returns a before/after comparison artifact; it does not launch a fresh manual visual-review pass.
Coworkers can discover both tools through the shared coworker tool surface. They remain governed by the canonical permission policy: the coworker must be eligible for the capability, receive explicit authority, stay within the owner's visible Jobs, and pass the normal pending-action confirmation. Failure to start a selected browser or other visual-review runtime fails the review coverage; it is not recorded as a successful skipped verdict.
When the preview's seed command runs to completion and exits with an error (exit status 1-125), the review records a needs_work finding instead of failing. The finding names the command, its exit status, and the tail of its output, and the repair loop hands it to the next implement iteration like any other review finding: the branch's migrations or seed data, or database state an earlier command left in the workspace, must be fixed before the change can be reviewed in a browser. Every other start-up failure -- a seed that timed out or was killed, a setup command, a browser that would not launch -- is treated as infrastructure: the failure message and Run log carry the command's exit status and output tail, and the review step is retried in place, without re-implementing the change.
Which workflows include visual review
The automatic visual_review loop runs in initial, retry, pr_comment, chat_feedback, and coding_handoff workflows when visual review resolves enabled and rounds > 0. It does not run in ci_failure, auto_merge, or maintenance workflows (rebase, stack_rebase). The manual trigger's standalone manual_visual_review Workflow is available independently of those chains wherever the Job state and repository configuration allow it.
Feedback workflows (pr_comment, chat_feedback)
pr_comment and chat_feedback lead with a bare top-level respond step, the same way initial/retry lead with implement. When visual review is enabled, the loop runs after the adversarial_review loop and before the grader retry chain, review-first just like initial:
respond → visual_review(1) → [respond → visual_review(2) → ...] → graders
The reviewer prompt includes a note that this is a feedback workflow and the full feedback history (PR comments or chat message) being addressed, and reads the diff from the respond step rather than an implement step.
Coding handoff workflow
coding_handoff has no bare leading implement/respond step — a chat coding session already produced the diff before the workflow started, so coding_handoff_fix plays the "agent_step" role instead, the same shape implement/respond play elsewhere:
visual_review(1) → [coding_handoff_fix → visual_review(2) → ...] → graders
Because the chain has no implement/respond step at all, Visual review falls back to a fresh git diff against the default branch — the same fallback path used by the standalone manual_visual_review workflow. A needs_work verdict is repaired by coding_handoff_fix, which also handles the workflow's grader retry loop.
For coding handoffs, visual-review history is deliberately separated from final publication provenance. A needs_work visual review remains in visual_review_iterations as historical evidence, but a later coding_handoff_fix records latest_coding_handoff_fix and resets the final visual-verification status until another visual_review approves or skips that fixed revision. pr_open and rebase force_push then write coding_handoff_publication_provenance; operators should use that artifact to tell whether the pushed HEAD contains the latest fix and whether visual review verified that final revision.