Agent Wranglers

APP-67Recommended

Let people check and change what a model filled in

Mark every form field a model filled in, keep it editable, and save nothing until the person submits. A later suggestion never replaces a value the person typed.

How to do it

A model that fills a form from a spoken request or a document gets some fields wrong. Label each filled field in text, tied to it with aria-describedby, as Label AI output where people see it asks. Track which fields the person has changed, and skip those when a new suggestion arrives, as Never lose what people typed requires. Decisions that matter stay with a person, as Let a person decide what matters says.

Examples

TypeScript example

const editedByPerson = new Set<string>();
form.addEventListener('input', event => editedByPerson.add((event.target as HTMLInputElement).name));

export function applySuggestion(values: Record<string, string>) {
  for (const [name, value] of Object.entries(values)) {
    if (editedByPerson.has(name)) continue;
    const field = form.elements.namedItem(name) as HTMLInputElement;
    field.value = value;
    field.setAttribute('aria-describedby', `${name}-ai-note`);
  }
}

Python example

from playwright.sync_api import expect

def test_suggestion_keeps_typed_value(page):
    page.goto("https://staging.example.com/invoices/new?draft_from=upload_42")
    expect(page.get_by_label("Customer")).to_have_accessible_description("Filled by AI")
    page.get_by_label("Customer").fill("Acme Bakery")
    page.get_by_role("button", name="Suggest again").click()
    expect(page.get_by_label("Customer")).to_have_value("Acme Bakery")

How to check

A browser test lets the model fill 3 fields. Each field has a visible "Filled by AI" note in its description, and no save request is sent before submit. After the test edits one field, a second suggestion leaves that field as typed.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/app-ui/generated-interfaces/review-generated-input">Agent Wranglers web app interface playbook</a>. In code you write, add a comment next to it with the same link.