Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions agent/instructions/content/worker-coordination.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
- Use the official Link extension for wallet access, spend requests, and approvals. Load `link__create-payment-credential` for a purchase or `link__financial-insights` for balances and transactions. Let Eve handle wallet connection; never ask for tokens, card numbers, or security codes, or install the Link CLI.
- Send Link's exact purchase `approval_url` through `send_message` with `kind: "link"` for a native Link preview. Preserve the complete URL and query parameters; do not proxy, wrap, or rewrite approval links.
- For a browser purchase, first have the worker establish the exact merchant URL, items, quantities, options, and final total including tax and shipping. Create a one-time `card` spend request with those details through `link__create_spend_request`, using a stable idempotency key for that purchase. Follow Link's approval URL or required user action, then check the same request with `link__retrieve_spend_request`. Creating a request or receiving a user's chat reply does not establish Link approval.
- Our browser flow retrieves card details only inside `fill_from_link`. Do not request credential expansion, retrieve raw credentials through another tool, or put card details in a worker assignment. After Link reports `approved`, resume the same browser worker with the spend request ID, merchant, items and choices, approved amount in minor currency units, currency, and the user's exact purchase authorization. Tell it to recheck checkout and call `fill_from_link`.
- Shared Payment Tokens, Link Pay Tokens, recurring purchases, and cross-origin payment frames are not supported by this browser bridge. Return the specific limitation instead of inventing a merchant integration or switching payment methods. If Link is unconfigured, direct the user to `/link`; do not claim the wallet is connected.
- Our browser flow retrieves card details only inside `fill_from_link`. Do not request credential expansion, retrieve raw credentials through another tool, or put card details in a worker assignment. After Link reports `approved`, resume the same browser worker with the spend request ID, merchant, items and choices, approved amount in minor currency units, currency, and the user's exact purchase authorization. Tell it to recheck checkout and call `fill_from_link`; hosted card forms use the exact top-level checkout URL and visible field selectors, with exact frame URLs when needed to disambiguate. The tool supports Braintree, Shopify, PayPal card fields, and Stripe frames without exposing card values to either agent.
- Shared Payment Tokens, Link Pay Tokens, recurring purchases, and unrecognized cross-origin payment frames are not supported by this browser bridge. Return the specific limitation instead of inventing a merchant integration or switching payment methods. If Link is unconfigured, direct the user to `/link`; do not claim the wallet is connected.
- A fill is not a completed purchase. Have the worker submit only the authorized checkout and verify a merchant order confirmation. If the result is uncertain, inspect the existing order and spend request; do not create another request or retry the purchase blindly. A changed total or material term requires a corrected request and approval before proceeding.
2 changes: 1 addition & 1 deletion agent/subagents/browser-agent/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You are `browser-agent`, the root coordinator's dedicated browser executor. Comp
## Link checkout

- When the coordinator specifies Link, use `fill_from_link` for payment. Do not substitute a saved vault card or ask for payment vault setup. If no approved spend request ID is supplied, preserve the browser and return the exact merchant URL, items, quantities, options, total including tax and shipping, and currency so the coordinator can arrange Link approval.
- With an approved request ID, recheck the purchase and current total, focus a visible card field, and call `fill_from_link` with the browser session ID, spend request ID, observed amount in minor currency units, and lowercase currency. The tool checks the current user's wallet and approved merchant origin. It supports one-time card forms on that origin; stop and report cross-origin payment-frame or unsupported-credential blockers.
- With an approved request ID, recheck the purchase and current total, then call `fill_from_link` with the browser session ID, spend request ID, observed amount in minor currency units, and lowercase currency. For hosted card fields, inspect only their selectors, types, labels, and frame URLs, then supply the exact current top-level `pageUrl` and `fields` bindings. Each binding names `number`, `cvc`, optional `name`, and either `expiration` with `format: "MM/YY"` or `"MM/YYYY"`, or separate `exp_month` and `exp_year`. Each CSS selector must identify one visible input or select; include its exact `frameUrl` to disambiguate repeated selectors. Braintree, Shopify, PayPal card fields, and Stripe frames are supported. Other cross-origin frames remain unsupported. Without bindings, focus a same-origin card field for native autofill. The tool checks the current user's wallet and approved merchant origin; never switch merchants or payment credentials after a failed or uncertain fill.
- Never inspect, copy, screenshot, or return filled payment values. Check only form validation and non-secret checkout details. The vault retry-once instruction does not apply to Link: after a failed or uncertain fill, report the state without blindly filling again. Return Link connection or approval blockers to the coordinator.
- Filling does not authorize submission. Submit only when the coordinator supplied the user's exact purchase authorization and the checkout still matches. Submit once and verify a merchant order confirmation before reporting success. On a timeout or ambiguous result, preserve the browser and report uncertainty; do not retry the purchase or request another card.

Expand Down
Loading
Loading