All plugins

visual-oracle

Makes a UI claim measurable before an agent reports success: captures a page as a baseline, then pixel-diffs later renders and answers PASS, FAIL or REVIEW with independent change regions (bbox, pixel count, area, density), a diff image, an overlay and per-region crops. Waits for document.fonts.ready, an optional selector and two identical frames so a capture is settled, records the Chrome version and viewport that produced it, and refuses to guess when rendering never stabilises. An optional visual change contract declares expected changes and protected regions so a declared change can pass while an undeclared one fails; selectors name locations, not meaning. Masks accept rectangles or CSS selectors and are applied before capture, a selector matching nothing is an error, and masks may not cover more than half the viewport. Only public http and https are rendered: file://, data:, private ranges and the cloud metadata address are refused on the URL and on every request the page makes, redirects included, with localhost, 127.0.0.1 and ::1 allowed and VO_ALLOW_HOSTS for anything else. Disclosure - renders the URL you give it in a local Chrome over the DevTools protocol (no Selenium, Playwright or pip install), so the page's own network requests happen in that browser; reads the PNGs it produced and writes baselines, diffs, overlays, crops and report.json under HERMES_HOME/plugin-data/; runs no shell command of its own and no background service; the baseline is never updated automatically; image input must be a real PNG and a header claiming more than 8192 px on a side is refused before decompression; no telemetry. Disclosure — renders the http(s) URL you give it in a local headless Chrome over the DevTools protocol (no Selenium, Playwright or pip install), so the page's own network requests happen from your machine; refuses non-http(s) schemes and private, link-local and cloud-metadata addresses on the URL and on every request the page makes (localhost, 127.0.0.1 and ::1 allowed, more via VO_ALLOW_HOSTS); launches Chrome with --no-sandbox only when running as root, without user namespaces, or with VO_NO_SANDBOX=1; reads the PNGs you point it at and writes baselines, diffs, overlays, crops and report.json under HERMES_HOME/plugin-data/visual-oracle/; a failing or REVIEW check keeps the agent's turn open through the pre_verify hook; runs no shell command of its own and no background service; the baseline is never updated automatically; no telemetry.

valenciayunaToolsUpdated 21 days ago

About

Makes a UI claim measurable before an agent reports success: captures a page as a baseline, then pixel-diffs later renders and answers PASS, FAIL or REVIEW with independent change regions (bbox, pixel count, area, density), a diff image, an overlay and per-region crops. Waits for document.fonts.ready, an optional selector and two identical frames so a capture is settled, records the Chrome version and viewport that produced it, and refuses to guess when rendering never stabilises. An optional visual change contract declares expected changes and protected regions so a declared change can pass while an undeclared one fails; selectors name locations, not meaning. Masks accept rectangles or CSS selectors and are applied before capture, a selector matching nothing is an error, and masks may not cover more than half the viewport. Only public http and https are rendered: file://, data:, private ranges and the cloud metadata address are refused on the URL and on every request the page makes, redirects included, with localhost, 127.0.0.1 and ::1 allowed and VO_ALLOW_HOSTS for anything else. Disclosure - renders the URL you give it in a local Chrome over the DevTools protocol (no Selenium, Playwright or pip install), so the page's own network requests happen in that browser; reads the PNGs it produced and writes baselines, diffs, overlays, crops and report.json under HERMES_HOME/plugin-data/; runs no shell command of its own and no background service; the baseline is never updated automatically; image input must be a real PNG and a header claiming more than 8192 px on a side is refused before decompression; no telemetry. Disclosure — renders the http(s) URL you give it in a local headless Chrome over the DevTools protocol (no Selenium, Playwright or pip install), so the page's own network requests happen from your machine; refuses non-http(s) schemes and private, link-local and cloud-metadata addresses on the URL and on every request the page makes (localhost, 127.0.0.1 and ::1 allowed, more via VO_ALLOW_HOSTS); launches Chrome with --no-sandbox only when running as root, without user namespaces, or with VO_NO_SANDBOX=1; reads the PNGs you point it at and writes baselines, diffs, overlays, crops and report.json under HERMES_HOME/plugin-data/visual-oracle/; a failing or REVIEW check keeps the agent's turn open through the pre_verify hook; runs no shell command of its own and no background service; the baseline is never updated automatically; no telemetry.

visual-oracle

No screenshot, no "looks fine".

A Hermes Agent plugin that turns the sentence "the UI is fine" from an opinion into a
measurement. It captures a page once as a baseline, then compares later renders pixel by pixel and
answers with numbers, boxes and images, and it will not let an agent close a turn while the page
is showing something the agent has not looked at.

visual_base(name="checkout", url="http://localhost:3000/checkout")
visual_check(name="checkout", url="http://localhost:3000/checkout")
# FAIL  checkout: 22.774% changed (allowed 0.2%)
#   region [653, 241, 347, 236] 80192px density 0.979
#   region [0, 227, 341, 186]   61004px density 0.962
#   diff: …/checkout/last/diff.png

Why this exists

An agent edits CSS, the page still renders, nothing throws, and every test still passes. So the
agent reports success. Meanwhile the payment button is hidden behind a panel, the nav overlaps the
title, or a sprite has been cut in half.

These are not exceptions. They are not caught by unit tests. And the one thing that cannot catch
them is the model's own opinion of its own work, which is exactly what "looks fine" is.

The usual fix is a human staring at a screenshot afterwards. visual-oracle moves that stare into the
loop, as a check the agent has to pass before it can say it is done.

What it is not: it does not judge design, it does not know what "beautiful" means, and it never
claims a page is correct. It reports what changed, where, and whether that change was declared.

What a check gives you

Every visual_check returns a verdict and the evidence behind it:

{
  "status": "FAIL",
  "changed_pct": 22.774,
  "changed_pixels": 141196,
  "total_pixels": 620000,
  "regions": [
    {"bbox": [653, 241, 347, 236], "changed_pixels": 80192, "area": 81892, "density": 0.979},
    {"bbox": [0, 227, 341, 186],   "changed_pixels": 61004, "area": 63426, "density": 0.962}
  ],
  "reasons": ["22.774% changed, over the 0.2% threshold, largest region at [653, 241, 347, 236]"],
  "artifacts": {
    "diff":    "…/last/diff.png",
    "overlay": "…/last/overlay.png",
    "regions": ["…/last/region-0.png", "…/last/region-1.png"]
  }
}
  • regions are independent boxes, not one box swallowing the whole screen
  • density tells you whether a box is one solid change or a few scattered pixels
  • diff.png is the page in grey with changed pixels in red
  • overlay.png is the baseline blended over the current render
  • report.json on disk holds the same payload for anything that wants to read it later

How it works

1. Capture, a real browser session, no driver

Chrome is launched with --remote-debugging-port=0; the port and WebSocket path are read from
DevToolsActivePort in a throwaway profile, and ws.py (a ~120-line WebSocket client, standard
library only) speaks the DevTools protocol to it.

That is what makes the waiting possible, and the waiting is what stops false positives:

cause of a false positivewhat the capture does about it
webfonts swap in after first paintblocks on document.fonts.ready
element animates into placeoptional wait_selector, then a stability check
page still settlingrequires two consecutive identical frames
images that never loadreported; require_images=true makes it an error
continuous animationrefuses to guess, raises "rendering never stabilised"

Each capture records what produced it: URL, viewport, Chrome version, protocol version, timestamp,
font status, number of frames needed, mask report, broken images, byte size.

2. Diff, decoded and compared in-process

pngdiff.py reads the PNG chunk stream, inflates the pixels and undoes the per-scanline filters
(None / Sub / Up / Average / Paeth), then compares channels with a tolerance. No Pillow, no
ImageMagick, no service.

Changed pixels are grouped on an 8×8 block grid and merged into connected regions, so a page with
three separate changes reports three boxes.

3. Verdict, three states, never a shrug

PASS    within policy: under the threshold, or exactly the change the contract declared
FAIL    outside policy: protected region touched, unexpected region, or over max_changed_pct
REVIEW  the policy cannot be evaluated reliably, or the change needs a human decision

REVIEW matters: a visual difference is evidence of a change, not proof of a defect. When the
plugin cannot decide honestly, it says so instead of picking the convenient answer.

4. Gate, the turn does not close on a failing check

pre_verify fires once per turn, before the agent finishes. On FAIL or REVIEW it returns:

{"action": "continue",
 "message": "[visual-oracle] FAIL on 'checkout': 22.774% changed (allowed 0.2%)\nregions: [653,241,347,236], [0,227,341,186]\ndiff: …\nlook at the diff. Fix the layout, or state plainly what changed and why."}

The agent gets the numbers and the image paths. Hermes bounds this with agent.max_verify_nudges,
so it can never become an unbounded loop.

Visual change contracts

Declaring intent before touching the page is what separates "changed as planned" from "changed
something else":

visual_check("checkout", url="…", contract={
    "expected_changes": [
        {"target": "#cta", "change": "move", "description": "move pay below the price"}
    ],
    "protected_regions": ["#nav", "#price"],
    "max_changed_pct": 3.0,
})

Deterministic rules:

  1. under threshold and nothing declared → PASS
  2. any region overlapping a protected_regions box → FAIL
  3. region overlapping an expected target → counted as expected
  4. change: "move" also accepts the hole the element left (same footprint, ±15%)
  5. over max_changed_pct → FAIL
  6. leftover regions matching nothing declared → FAIL
  7. expected change declared but not observed → REVIEW
  8. contract selector missing from the page → REVIEW

Selectors describe location, not meaning. The contract cannot know that moving #cta below
#price is the right move. It knows the pixels inside #cta moved and nothing else did. The
judgement beyond that stays with a human, on purpose.

States that only exist after a tap

A page can match pixel for pixel while the bug hides behind a click. Pass a short deterministic
script and the baseline captures that state instead of the landing screen:

visual_base("menu-open", url="http://localhost:3000/", steps=[
    {"click": "#menu-btn"},
    {"wait_selector": "nav.menu.is-open"},
    {"settle_ms": 180},
])

Supported steps: click (CSS selector), wait_selector, scroll (pixels), settle_ms. A click on a
missing element and a wait that times out are both errors, never silent skips. The applied steps are
recorded in the capture metadata, so a baseline always says how that state was reached.

Without this, the same page reports 0.0% changed and passes while the opened menu covers the pay
button. tests/audit_steps.py reproduces exactly that case.

Masks

visual_check("feed", url="…", mask=[[0, 0, 1280, 80],   # coordinates
                                    "#live-clock"])      # CSS selector

Selector masks are resolved before the capture: the element keeps its space but is set to
visibility: hidden, so a clock or a carousel cannot pollute the diff.

  • a selector matching nothing is an error, not a silent no-op
  • masks may not cover more than 50% of the viewport ("a check that ignores half the screen cannot
    fail")
  • every ignored rectangle is listed in the capture metadata, so a human can audit exactly what was
    excluded

Tools

toolwhat it does
visual_basecapture (or accept) a baseline: fonts waited, optional selector wait, stable frames
visual_checkrender now, diff, apply contract and masks, return PASS / FAIL / REVIEW with artefacts
visual_listevery baseline in this session with its last verdict and region count
pre_verify (hook)keeps the turn open while the last verdict is FAIL or REVIEW

Tests

python3 tests/pngdiff_proof.py       18/18   decoder and diff, generated fixtures
python3 tests/audit_code.py          11/11   shipped diff vs a naive reference
python3 tests/visual_proof.py        16/16   end to end through Chrome
python3 tests/audit_contract.py      12/12   contract and mask matrix
python3 tests/audit_resilience.py     5/5    hook under broken stores
python3 tests/audit_integration.py    9/9    Hermes dispatcher, call site, nudge budget
python3 tests/audit_steps.py          9/9    state capture: menu closed vs open
hermes plugins validate .            passed

pngdiff_proof.py generates PNGs using every filter type and both colour models, then asserts:
identical images, a single changed pixel, three disconnected regions, corner bounding boxes, mask
correctness, dimension mismatch, bad signatures, truncated files, broken IDAT streams, unsupported
colour types, and byte-identical JSON for identical inputs.

visual_proof.py drives Chrome: font wait, selector wait, an unstable page that must fail loudly, a
declared move that passes a contract, a protected region that fails it, a missing contract target
(REVIEW), selector masks, the mask coverage limit, required-image failures, artefacts on disk, and
the hook refusing to close a turn.

Demo

demo/ contains the fixture used in the recording: baseline.html, broken.html, fixed.html;
the bug is one panel landing on top of the pay button, plus demo.mp4 (30s, English narration).

Real numbers from that run: the broken state is 22.774% changed with two regions, and the fixed
state is 0.0%.

Requirements and limits

  • Python 3.10+
  • Hermes Agent with the pre_verify hook (tested on 0.21.x; requires_hermes not declared yet)
  • Chrome or Chromium for url= captures; image= works without a browser
  • PNG: 8-bit RGB/RGBA, non-interlaced. Anything else raises PngError naming the format
  • selector masks and contracts need a live page; with image= there is no DOM, so selectors
    produce REVIEW
  • sub-tolerance colour shifts (< 8 per channel) are not reported
  • the diff is geometry: a wrong colour inside an unchanged shape may not register

Full parameter reference: docs/configuration.md. Example artefacts: docs/examples/.
Audit results, including four bugs found and fixed: docs/audit.md.

Layout

__init__.py   tools, contract evaluation, storage, pre_verify hook, register()
capture.py    DevTools capture: fonts, selectors, stability, selector masks, metadata
cdp.py        Chrome session over the DevTools protocol
ws.py         minimal WebSocket client (standard library only)
pngdiff.py    PNG decode, pixel diff, regions, diff/overlay/crop artefacts
tests/        deterministic decoder tests + real-Chrome end-to-end tests
docs/         configuration reference, example report and images
demo/         fixture pages and the recorded demo

What it will and will not render

Only http and https are rendered. Everything else is refused before Chrome is asked:

  • file:// and data: URLs, which would turn a screenshot into a way to read the host
  • localhost, 127.0.0.1 and ::1 are allowed, because that is where a dev server lives
  • private ranges (10/8, 172.16/12, 192.168/16, fc00::/7), link local (169.254/16, which includes the
    169.254.169.254 metadata address), loopback outside the allow list, and names like
    *.local, *.internal, metadata.google.internal

The check runs on the URL you pass, and on every request the page makes, redirects included, via
CDP Fetch interception: a request to a refused host is failed before it leaves the browser, and the
capture errors out naming the URL. A redirect to a blocked host therefore cannot produce a screenshot
of it.

To allow another host, list it explicitly:

export VO_ALLOW_HOSTS="staging.internal,10.0.0.12"   # comma separated, exact host names

Chrome runs with its sandbox unless the sandbox cannot work: as root, or inside a container without
user namespaces, --no-sandbox is added, and VO_NO_SANDBOX=1 forces it. That flag is a real
downgrade, so it is not the default.

Input limits

image= must be a PNG (the signature is checked, not the extension). A PNG whose header claims more
than 8192 pixels on a side is refused before any decompression, so a tiny file cannot ask for
gigabytes of memory. A contract may be an object, or a path to a JSON file inside the plugin data
folder
; a path elsewhere is refused rather than read.

README from the reviewed commit 4aaec61; it updates when the author re-pins.

More by valenciayuna

2 plugins by valenciayuna in the catalog.

valenciayunablastradiusReads a destructive shell command before it runs and reports what it would actually delete: how many files, how many git can restore, how many it cannot, the total size, and which of them look valuable, then lets policy decide whether to show the report, block the call, or demand a one-shot blast_allow. Covers rm and rm -rf, git clean, git reset --hard, truncate -s 0, > file and : > truncating redirects, and mv overwrite, including nested bash -c, subshells, and chained commands with cd tracking; anything it cannot resolve is reported as unmeasured instead of guessed. Snapshots and verified restore exist as a separate step (blast_snapshot, blast_restore); restore skips files edited after the snapshot unless overwrite_conflicts is set. Disclosure - no network; reads file metadata, directory listings, and the output of read-only git calls (git ls-files, git check-ignore, git rev-parse); writes snapshot copies under HERMES_HOME/plugin-data/; strict policy blocks the tool call while balanced and relaxed report and continue; local terminal backend only; no telemetry. Disclosure — no network and no telemetry; on every terminal call it reads file metadata, directory listings and the output of read-only git calls (git ls-files, git check-ignore, git rev-parse); it writes snapshot copies under the Hermes plugin data dir (or BLASTRADIUS_SNAPSHOT_DIR), and blast_restore with confirm writes snapshotted files back to their original paths, skipping files edited since unless overwrite_conflicts is set; its blocks add to Hermes approval and never replace it, and the agent can relax them through blast_policy or a one-shot blast_allow (BLASTRADIUS_ALLOW=1 turns them off); local terminal backend only.CommunityDesktop app1

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section