Free and open source · bring your own AI key

Let users change your app. Then ask if it's better.

PMF Harness is a drop-in feedback button. A user points at something and says what they'd change; a small copy or layout change is drafted (by simple rules, or by your own AI key on your server), applied for that user only, and followed by one question: is this better? You see which changes win before anyone else gets them.

One script tag. No account, no hosted service, no keys of ours. Changes are limited to wording and layout, checked against an allow-list before they touch the page.

The user asks, pointing at the button

{
  "text": "make this button bigger, it's way too easy to miss",
  "target": {
    "selector": "#signup",
    "text": "Sign up",
    "styles": {
      "font-size": "13px",
      "padding": "6px 10px"
    }
  }
}

They get this change, then "Is this better?"

{
  "format": "pmf-harness/change@1",
  "summary": "Made the button bigger (13px to 19.5px).",
  "scope": "user",
  "ops": [
    {
      "op": "style",
      "selector": "#signup",
      "props": {
        "font-size": "19.5px",
        "padding": "9px 15px"
      }
    }
  ],
  "drafter": "rules"
}

Drafted by the built-in rules, by the same code that ships in the script. With your server, your AI key drafts instead.

The loop

Feedback widgets collect requests and leave the rest to you. PMF Harness closes the loop for the small ones, so you only read the ones that need a developer.

1

Ask

A user presses Suggest a change, points at an element, and writes what they'd change. The widget records the element (selector, text, styles) and an outline of the screen. No form values, ever.

2

Draft

Built-in rules handle the common ones ("bigger", "should say…", "remove this", "more space") with no AI. Connect your server and your own model drafts the rest. Bugs, features and account issues go to your queue instead.

3

Try it, for one user

The change is applied for that user only, like a feature flag of one. It survives re-renders and page loads, and undoes cleanly.

4

Is this better?

The user keeps it or undoes it. Every verdict is recorded. When most people who tried a change say it's better, roll it out to everyone, or copy it as a brief for your coding agent to make it permanent.

Safe by construction

An app that changes itself from user input is an attack surface. The change format can only express copy and layout, and every change is validated twice: on your server and again in the browser.

  • Six operations: set text, set one of four harmless attributes, set allow-listed CSS properties, hide, reorder siblings, toggle existing classes. No HTML, no scripts, no URLs, no event handlers.
  • CSS values can't load anything: url(), expression(), @import, position and friends are refused.
  • Selectors can't reach html, body, script, iframe or the widget itself, and must match exactly one element on the page.
  • Changes apply to the requesting user only until you roll them out. Users can undo anything, any time.
  • Your server rate-limits drafts per user, never stores screenshots, and keeps admin actions behind a token.

How the safety model works

Add it to your app

Start in local mode (rules only, data in each user's browser), then add the server when you want AI drafting and everyone's verdicts in one place.

1. The script

<script src="https://cdn.jsdelivr.net/gh/theguysaccount/pmf-harness-self-evolving-app@v0.1.0/dist/pmf-harness.js" data-app="my-app" defer></script>

That's local mode: a Suggest a change button, rule-based drafting, and the "is this better?" loop, with nothing leaving the browser.

2. Your server (optional)

npm install github:theguysaccount/pmf-harness-self-evolving-app#v0.1.0 @anthropic-ai/sdk
ANTHROPIC_API_KEY=… PMF_ALLOWED_ORIGINS=https://your.app \
PMF_ADMIN_TOKEN=… node node_modules/pmf-harness/server/pmf-server.mjs

Then add data-endpoint="https://your.api/pmf" to the script tag. Or mount the handler in Next.js, Express or Hono: server docs.

3. Review and roll out

Open your app with ?pmf-admin=1, or call PMFHarness.admin({ endpoint, adminToken }) from your console, to see requests, drafted changes, verdicts and the queue. Roll a winner out to everyone, or copy it as a coding-agent brief.

Questions

Does PMF Harness change my code?

No. Changes are applied at runtime in the user's browser, from a small allow-listed change format. When a change wins, copy it as a brief from the admin view and have your coding agent (or you) make it permanent in the source.

Do I need an AI key?

No. The built-in rules draft the common requests (sizes, wording, removing, spacing, alignment, colours) with no AI at all. To draft anything else, run the reference server with your own Anthropic API key; it calls Claude (claude-opus-5-5 by default) with structured outputs and validates every answer. PMF Harness never ships or uses a key of its own.

Can a user break my app with it?

Each change can only set text, four harmless attributes, allow-listed CSS, hide an element, reorder siblings or toggle existing classes, on elements matched by a unique selector. No HTML, scripts, URLs or event handlers. A change applies to the requesting user only, and they can undo it. See the safety model.

Where is feedback stored?

In local mode, in each user's browser (localStorage). With your server, in your own store (a JSON-lines file by default, or your database). Nothing goes to the PMF Harness project.

How do I decide what to roll out?

The admin view shows, per change, how many users who tried it said it was better. A change is marked ready when at least five users tried it and 70% or more kept it. Rolling out sends it to everyone through your server's /changes endpoint.

What does it cost?

Nothing: it's MIT-licensed open source. If you use AI drafting, you pay your model provider for your own usage; the server rate-limits drafts per user so feedback can't run up a bill.

Using it? Add the badge to your README: Built with PMF Harness

[![Built with PMF Harness](https://theguysaccount.github.io/pmf-harness-self-evolving-app/badge.svg)](https://theguysaccount.github.io/pmf-harness-self-evolving-app/)