Skip to content

Make browser confirmation conservative by default - #4

Open
vsolano9 wants to merge 1 commit into
AgentPostmortem:mainfrom
vsolano9:fix-3-conservative-confirmation
Open

Make browser confirmation conservative by default#4
vsolano9 wants to merge 1 commit into
AgentPostmortem:mainfrom
vsolano9:fix-3-conservative-confirmation

Conversation

@vsolano9

Copy link
Copy Markdown

What & why

The confirmation gate trusts recipe authors to label only clicks with write: true. That allows a mutating goto, typing, an unlabeled click, or even write: false to reach the browser without confirmation. This adopts the issue’s conservative-by-default option: recipes run unconfirmed only when every step is provably read-only.

Closes #3

Changes

  • treat typing, every click, and navigation away from the canonical entry URL as confirmation-required
  • keep only waits and redundant canonical entry navigation on the unconfirmed path
  • retain the legacy write field for recipe compatibility without allowing it to waive confirmation
  • return an action-neutral confirmation error at the request boundary
  • align README, runnable example, source comments, and assistant context with the enforced contract
  • add an exhaustive nine-scenario gate table exposed through npm test

Validation

  • RED: path/query navigation, typing, unlabeled click, and write: false click all bypassed the old gate
  • npm test — 10/10 pass; repeated successfully 20 consecutive times
  • Node 20 test run — 10/10 pass
  • local Wrangler /run integration — mutating goto, type, and write:false click each return the exact HTTP 400 confirmation error before browser launch
  • npm run typecheck — pass
  • npx wrangler deploy --dry-run — pass; no deployment
  • git diff --check — pass
  • fresh npm ci — pass; reports the existing dependency advisories (10 total, 4 high in production dependencies); no dependency or lockfile changes

Checklist

  • Focused change with a clear description
  • Ran format / lint / tests (repository provides typecheck and tests; both pass)
  • Updated docs or CHANGELOG if relevant
  • Linked the related issue

Require confirmation for typing, all clicks, and navigation away from the canonical entry URL. Keep only waits and redundant entry navigation read-only, add exhaustive gate tests, and align public/runtime documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The confirmation gate ignores goto, so a mutating URL runs unconfirmed

1 participant