Letting the agent fill the form while the person keeps the submit button is the right default. The edge case I'd test: hidden or off screen fields. If the form has a hidden input, say an assignee or a webhook URL, can the agent set it through the tool without it ever showing up in the fields the person reviews? Highlighting every field the agent changed before submit, including hidden ones, would close that.
Great catch! You're pointing at a very real human-in-the-loop edge case.
In Chrome's current experimental implementation of declarative WebMCP, standard elements are excluded from the generated tool schema (since they are meant for app-managed state like CSRF tokens or IDs rather than user input), so the agent can't set them directly.
However, your concern is spot-on for CSS-hidden, off-screen, or collapsed fields (like inputs inside closed accordions or tabs): because those are standard form controls in the DOM, the browser exposes them as parameters, meaning an agent could populate them out of the user's sight.
Two practical ways to close that gap right now:
Keep sensitive or non-reviewable values out of the form inputs and attach them inside the submit handler instead.
Surface agent changes explicitly before submission—for instance, using the toolactivated event (or tracking dirty fields) to highlight modified inputs or show a quick summary of what the agent populated before the user hits submit.
Definitely something worth testing as the declarative spec evolves!
Thanks for the detail on how hidden inputs are excluded from the schema. The CSS hidden and collapsed field case is the one I'd test first, since the user never sees what was filled.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
One detail worth underlining for anyone copying this pattern: the form's markup IS the tool schema, so the schema can only be as strict as the HTML. Your priority field works because it is a select with fixed options. Your project field is a free-text input, which means the agent has to guess a valid project name — and if createTask rejects unknown projects, that rejection arrives as a plain string through respondWith() after the human has already reviewed and submitted. The failure lands after the review step, not before it.
The fix costs nothing: wherever the server has an enum, put it in the markup — a select, or a datalist on the text input so the agent sees the allowed values while the user keeps free typing. That one habit is what keeps a declarative tool honest: everything the agent needs to succeed has to be visible in the form itself, because there is no second channel to ask.
I measure AI coding claims in public. LGTM — Let's Get the Measurements: real runs, real numbers, receipts. Every article is an experiment I actually ran. Books & packs: aheadkit.gumroad.com
Ha, good — that's the bit I was most curious about, since the rejection only shows up after the human already reviewed it. Will it cover the timing of it, or mostly the error shape itself?
I research AI tools, APIs & agents — comparing specs, pricing and real user reports — then publish honest rankings so you don't waste money. Research-first, never sponsored fluff.
What I liked most is that the agent flow reuses the exact same submit path and createTask operation — the form isn't a second implementation of task creation, it's just another way in. And respondWith() returning plain strings for both success and validation failure feels like the right level of honesty to the agent. No separate happy-path story, no separate error story.
Reusing the existing form as the tool schema is a neat shortcut: the field labels, required flags, and validation rules already encode what the agent is allowed to set, so you avoid maintaining a parallel tool definition that drifts out of sync. In a desktop app the same idea fits a settings or submission view - expose it to a helper agent, but keep the human confirm step before the state-changing submit fires. Since this declarative API is still experimental, it's worth guarding the tool surface behind a feature flag so a browser spec change doesn't silently strip the annotations.
I write about Next.js + TypeScript + AI engineering, with a focus on making sites discoverable to LLMs and AI search. Long-form notes at mudassirkhan.me
leaving out toolautosubmit is the part that makes this usable. the form stays a proposal and the human review step is just the existing UI, so there is no extra approval layer to build.
the respondWith note caught my eye too. a plain string saying the task was created, when it may only live in memory after a storage failure, is exactly how agents end up reporting success on writes that never landed. we moved to returning a structured status with a persisted flag so the agent can tell accepted from saved.
will the structured outcomes in the later chapter carry a persisted flag, or just success and failure?
We're a place where coders share, stay up-to-date and grow their careers.
Letting the agent fill the form while the person keeps the submit button is the right default. The edge case I'd test: hidden or off screen fields. If the form has a hidden input, say an assignee or a webhook URL, can the agent set it through the tool without it ever showing up in the fields the person reviews? Highlighting every field the agent changed before submit, including hidden ones, would close that.
Great catch! You're pointing at a very real human-in-the-loop edge case.
In Chrome's current experimental implementation of declarative WebMCP, standard elements are excluded from the generated tool schema (since they are meant for app-managed state like CSRF tokens or IDs rather than user input), so the agent can't set them directly.
However, your concern is spot-on for CSS-hidden, off-screen, or collapsed fields (like inputs inside closed accordions or tabs): because those are standard form controls in the DOM, the browser exposes them as parameters, meaning an agent could populate them out of the user's sight.
Two practical ways to close that gap right now:
Definitely something worth testing as the declarative spec evolves!
Thanks for the detail on how hidden inputs are excluded from the schema. The CSS hidden and collapsed field case is the one I'd test first, since the user never sees what was filled.
One detail worth underlining for anyone copying this pattern: the form's markup IS the tool schema, so the schema can only be as strict as the HTML. Your priority field works because it is a select with fixed options. Your project field is a free-text input, which means the agent has to guess a valid project name — and if createTask rejects unknown projects, that rejection arrives as a plain string through respondWith() after the human has already reviewed and submitted. The failure lands after the review step, not before it.
The fix costs nothing: wherever the server has an enum, put it in the markup — a select, or a datalist on the text input so the agent sees the allowed values while the user keeps free typing. That one habit is what keeps a declarative tool honest: everything the agent needs to succeed has to be visible in the form itself, because there is no second channel to ask.
Yes, that's true :) But spoiler: we will have a dedicated article for the error state :)
Ha, good — that's the bit I was most curious about, since the rejection only shows up after the human already reviewed it. Will it cover the timing of it, or mostly the error shape itself?
How to handle errors. And some best practices
What I liked most is that the agent flow reuses the exact same submit path and createTask operation — the form isn't a second implementation of task creation, it's just another way in. And respondWith() returning plain strings for both success and validation failure feels like the right level of honesty to the agent. No separate happy-path story, no separate error story.
Yes, that's what I like as well 😃
Reusing the existing form as the tool schema is a neat shortcut: the field labels, required flags, and validation rules already encode what the agent is allowed to set, so you avoid maintaining a parallel tool definition that drifts out of sync. In a desktop app the same idea fits a settings or submission view - expose it to a helper agent, but keep the human confirm step before the state-changing submit fires. Since this declarative API is still experimental, it's worth guarding the tool surface behind a feature flag so a browser spec change doesn't silently strip the annotations.
leaving out toolautosubmit is the part that makes this usable. the form stays a proposal and the human review step is just the existing UI, so there is no extra approval layer to build.
the respondWith note caught my eye too. a plain string saying the task was created, when it may only live in memory after a storage failure, is exactly how agents end up reporting success on writes that never landed. we moved to returning a structured status with a persisted flag so the agent can tell accepted from saved.
will the structured outcomes in the later chapter carry a persisted flag, or just success and failure?