Safety model

An app that changes itself because a user asked is an attack surface: a request could try to inject a script, deface the page for others, phish with fake text, or run up an AI bill. PMF Harness is built so that none of these is expressible.

What a change can do

A change is a summary plus at most eight operations, each on one element:

OperationEffectLimits
textReplace the element's visible textPlain text only, 300 characters, set as text (never HTML)
attrSet aria-label, title, placeholder or altThose four only; no href, src, style or on… handlers
styleSet CSS properties48 allow-listed layout and typography properties; values can't contain url(, expression(, @import, attr(, braces, semicolons, comments or !important
hideHide the element
movePut the element before or after a siblingSame parent only: no moving things into other parts of the page
classAdd or remove class namesPlain identifiers only

Not allowed anywhere: HTML, scripts, URLs, event handlers, position (no overlays), background-image, content, filter, cursor, or selectors that reach html, head, body, script, style, link, iframe, object, embed, template, the widget itself, or :has().

Where it's checked

  1. On your server, every drafted change goes through the validator before it's returned, and changes recorded through /events are validated again.
  2. In the browser, the widget validates every change, from your server or from a custom drafter, before applying it, then checks it against the page: each selector must match exactly one element, and moves must stay within one parent. Anything that fails goes to the developer queue instead.
  3. The model is told that page text, selectors and the screen outline are data, not instructions, and its answer is constrained to a JSON schema. Even a successful prompt injection can only produce a change that passes the checks above.

The validator is one file, src/patch.js, shared by the server and the browser, with tests for each refusal.

Who sees a change

  • A drafted change applies to the user who asked, in their browser, until you roll it out.
  • They're asked whether it's better, and can undo it at any time from My changes.
  • Only you, with the admin token, can roll a change out to everyone. A change is marked "ready" only after at least five users tried it and 70% or more kept it, so one person can't push a change by voting for it.

Cost and abuse

  • The server limits drafts per user (default 10 an hour) and per IP (three times that).
  • The request text is capped at 2,000 characters and the screen outline at 3,000.
  • Without your API key the server never calls a model; the rules need no AI at all.

Privacy

  • The widget never reads form values, and skips anything inside data-pmf-private (or data-private).
  • The screen "capture" is a short text outline of headings, buttons, links and labels, not a picture. A real screenshot is opt-in (data-screenshot="on"), asked for by the browser every time, sent only to your server for that one draft, and never stored.
  • In local mode nothing leaves the user's browser. With your server, data goes only to you and to the model provider you chose.
  • Users aren't identified unless you pass your own user id.

Reporting a vulnerability

Use GitHub's private vulnerability reporting on the repository.