# AI Browser recipient, version 1

This helper runs in the AI's existing permitted runtime. By default (direct write) nothing it opens goes through your tool output as a card or a login: the open line carries `cdp`, your browser's debugging address (`http://127.0.0.1:<port>`, or the browser's `ws://` socket), and the helper puts the release into that browser itself. Where it cannot reach your browser, the person may approve on their phone that you type the values yourself (`delivery: "ai_types"`, [below](#ai-typed-delivery)).

- **A card** is typed into the approved store's checkout in your browser: the number, the expiry and the name on the card at open, the security code after `ai_browser_checkout_begin` allows Pay. Each filled field is masked and left out of accessibility snapshots. The helper prints only which kinds of field it filled and how many. The contact details and answers the person approved are still printed, for you to type where the store asks.
- **A store login** is written into your browser as cookies and printed only as cookie names and a count.
- **A signed-in job's program helper** (`node runner.mjs signed-in-job --cdp <address>`, below) works the same way.

Without a debugging address, nothing opens for direct write: prepare with `delivery: "ai_types"` instead. You made the key each release is sealed to, so you could still open it yourself and read a checkout's fields: this keeps the card out of your tool output and chat, not out of your reach. Only On Device keeps the card from you entirely. It provides no private-fill, encrypted-only-log or verified-erasure guarantee. It never pays. The restricted ChatGPT plugin does not support this lane.

Before requesting a phone hold, verify the current AI session has a permitted interactive browser that can navigate, inspect checkout and interact with its controls, and, for direct write, whose debugging address you can give this helper. Search/fetch tools and this helper do not supply one. Connection eligibility does not verify current browser access. If unavailable, explain the requirement and offer continuing in a browser-enabled session. For a personal checkout only, On Device may also be offered after the person's choice. Household purchases require the requesting member's AI browser; never fall back to On Device. Keep the saved personal default unchanged.

## Download and start

1. Read this connection's current `shareless_capabilities`. Its AI Browser routing metadata and prepare protocol identify the supported recipient artifact, URL and SHA-256. A public download does not enable card or store login release.
2. Download `runner.mjs` and `artifact-manifest.json` from `https://app.shareless.ai/ai-browser-checkout/v1/`. Compare their bytes' SHA-256 with the values in the authenticated capability response before execution. The manifest also identifies the guide and third-party notices. A matching hash establishes byte identity, not independent trust in the server or execution. A runner you kept from an earlier checkout may be too old for this one: when its SHA-256 is not the capability response's, download it again.
3. Run `node runner.mjs` with Node 22.23.3 or later. No npm install, repository, TypeScript support or API credentials are required. Keep the process alive with **writable stdin across tool calls**. A one-shot command that closes stdin cannot wait for phone approval. Do not substitute saved private keys, a background listener or a platform restriction workaround.
4. Read the `ready` JSON line. Pass its fresh `recipientPublicKey` to `ai_browser_checkout_prepare` with the public proposal, exact fields (none for `store_login`) and a stable idempotency key, and its `runner` object as `runner`, as given. The proposal's `merchantOrigin` is the origin of the page where the card is entered (the payment step), which may not be the product page's: this helper finds that tab by its exact origin. Never pass private keys. If the runtime cannot preserve the process, stop before requesting a hold. If it cannot give the helper its browser's debugging address, prepare with `delivery: "ai_types"`. For personal `merchant_saved`, skip this helper: browser availability, the hold and one-attempt begin protocol still apply.

**A runner too old for the checkout.** `runner` in `ready` says what this helper opens: `protocol`, the highest AI Browser version whose releases it opens, and `currencies`, the currencies a release may be in. The manifest's `opens` says the same for the published runner. Prepare refuses a card or a store login whose release this helper could not open, before the person's phone is asked: the answer is `runner_update_required` with `missing` (such as `"currency:INR"`) and `runner`, the current runner's `url`, `sha256`, `manifestUrl` and `manifestSha256`. Nothing was created and the idempotency key is still unused: download and check that runner, start it, and prepare again with the same proposal and idempotency key, the new `ready` line's key and its `runner`. A `ready` line without `runner` is from a runner published before 2026-11-20; prepare takes it to open version 5 releases in every currency but INR. On 2026-11-20 a runner from before INR refused two INR releases after the person had held for each: the check comes before the hold instead.

Installing this helper creates no new browser capability or permission: it uses a debugging connection your runtime already has. Test process persistence and the browser connection with synthetic values before using real details. No platform integration is certified merely by these files being available.

If the execution tool needs a terminal to keep stdin open, use its ordinary PTY/TTY option. The helper detects a terminal and uses raw input to avoid canonical line truncation and input echo; it restores the previous terminal mode when closing normally. Raw Ctrl-C and Ctrl-D cancel the session. This prevents the terminal's own extra echo, not the tool provider's recording of arguments or output. Pipe EOF still cancels immediately.

## Open the approved release

After the phone hold, read this connection's current **approved** `ai_browser_checkout_status`. Its `binding` is exactly what this helper checks the release against, computed by the server from that approved request and its `approved_release_committed` receipt: send it as given. A binding you assemble from the same authenticated response stays valid: bind `amountCapCents` to `approvedCapCents` when it is a number, else to `amountCapCents` (the phone seals the cap the person approved), and take `sealedDigest` from the `approved_release_committed` receipt, matched to the exact request, attempt and contract hash. For exported evidence, verify the signature against ShareLess's published receipt keys and compare the readable receipt with signed canonical bytes. Never take the expected binding from merchant HTML or the encrypted payload itself.

Open the store's checkout in your browser at its payment step first, in one tab at the approved merchant origin exactly. Then send exactly one JSON line to the same process, keeping stdin open until it answers. Its `binding` is the status reply's, as given; for a card it reads:

```json
{"v":1,"op":"open","sealed":"<approved base64url wire>","binding":{"requestId":"<request>","attemptId":"<attempt>","contractHash":"sha256:<hash>","merchantOrigin":"https://merchant.example","amountCapCents":1250,"currency":"USD","expiresAt":"<approved ISO expiry>","recipientPublicKey":"<ready key>","requiredFields":["card"],"sealedDigest":"sha256:<digest of decoded wire>"},"serverShare":"<status serverShare>","cdp":"http://127.0.0.1:<port>"}
```

A current phone seals every release split (v2): `serverShare` is the status reply's share. An older phone's whole (v1) release has no `serverShare`.

The helper checks the line itself before its key is touched: that it is JSON with every member (`serverShare` for a split release) and the binding's keys, that the binding's `recipientPublicKey` is this process's key, and that its `sealedDigest` is the SHA-256 of the bytes `sealed` decodes to. A line that fails is `invalid_command` with `"retryable":true`, naming members only (`missing`, `mismatched`), never a value; the process waits for the corrected line. What only the decrypted release can show, a binding the sealed payload contradicts, is one attempt: `release_rejected`, and the release is spent. A release the helper refused gave you nothing and registered nothing for proof of deletion, so no receipt can answer its checks. For a release you never opened (refused, or one you will not open), call `ai_browser_checkout_report` before begin with outcome `release_not_opened` and nothing else: the request ends, its release is no longer served, and its deletion checks close as not opened. It is refused once a decryption or fill was reported or a receipt was sent. A new purchase is a new request.

**Before anything is decrypted** the helper reaches the browser, finds the tab whose origin is the binding's `merchantOrigin`, and finds the card form in it and in its frames, payment frames of other sites included. It finds fields by their autocomplete tokens first (`cc-number`, `cc-exp`, `cc-exp-month`, `cc-exp-year`, `cc-csc`, `cc-name`), then by their names, labels and placeholders. Only a visible field in an `https` frame takes a card value. Anything that cannot be used yet is answered with `"retryable":true` and costs nothing, and the process stays ready for the same line:

- `cdp_required`: the line has no `cdp` and its binding no `delivery`. When the approved status says `delivery: "ai_types"` (its `binding` carries it), add it to the binding and send the line again without `cdp`: no new request is needed. Otherwise send it again with `cdp`, or prepare a new request with `delivery: "ai_types"` (`nextAction: "prepare_with_ai_types"`).
- `cdp_invalid`, `cdp_not_local`, `cdp_unreachable`: the address cannot be used. Plain `http` and `ws` are accepted only on this computer; a browser elsewhere is reached over `https` or `wss`.
- `checkout_tab_not_found`: no tab is at the store's origin. A store that takes payment on another site's page is not supported for direct write: prepare a new request with `delivery: "ai_types"`.
- `checkout_tab_ambiguous`: more than one tab at the store's origin shows a card form. Close the others.
- `card_fields_not_found`, with `kinds`: no field for the card number or the expiry yet. Bring up the card form (choose card as the payment method).
- `card_fields_ambiguous`, with `kinds`: more than one field for a kind. Close the other card form.

Then it decrypts, registers the released values for proof of deletion when that is configured, and types the card with trusted input at a person's pace: each field is masked (`-webkit-text-security: disc`), focused and typed with key events (payment frames refuse a value set by script), each key once the field shows the one before, read back once its value holds still to check it took, and then left without focus, `aria-hidden` and `inert`. Text on the page that shows the whole number, such as a picture of the card, is masked the same way. Before it prints anything, it reads every field back again and asks your browser's accessibility tree about each one. Success prints:

```json
{"v":1,"type":"opened","details":{"name":"...","email":"..."},"card":{"directWrite":true,"filled":["number","expiry","name"],"fields":3,"cvcField":true},"cvcPending":true,"hygiene":{...},"verifiedErasure":false,"note":"..."}
```

`details` holds only the approved contact fields (`name`, `email`, `phone`, `shippingAddress`, `billingAddress`): type them where the store asks. `card.filled` lists the kinds typed and checked (`number`, `expiry`, `name`, and `cvc` for a whole release), and `fields` how many fields that took (a month and a year are two). `card.notFilled` lists a kind the release had a value for and no field on the page took; `card.noValue` a field the page shows that the release has no value for, such as the name on the card when the release carries none: type the cardholder's name there yourself if the person gave it. `card.echoesMasked` counts page text that showed the number and is now masked. A number or an expiry the page will not take ends the open as `card_fill_failed` with `kinds`: what was typed is emptied again and the attempt is spent, so prepare a new request, with `delivery: "ai_types"` if the page keeps refusing the helper's typing. A field your browser's accessibility tree still shows after it was hidden ends it as `card_not_hidden` with `kinds` the same way: a page snapshot would read the card there.

**Never read those fields back.** Do not read their values, take a DOM or HTML dump of the payment form, or run a script on it. A screenshot shows dots in them and an accessibility snapshot leaves them out (the runner checks each field before it prints `opened` or `cvc`; tested with Chrome 157 and the Chrome DevTools MCP snapshot); a value read or a DOM snapshot would still return the digits.

**The security code.** A split release holds the security code back: `opened` carries `"cvcPending":true`. Check the live merchant, items, currency and total, then call `ai_browser_checkout_begin`. After it answers `allowed:true`, send one more line with that reply's share:

```json
{"v":1,"op":"cvc","cvcServerShare":"<begin cvcServerShare>"}
```

The helper finds the security code field again first: one it cannot find is `cvc_field_not_found` or `cvc_field_ambiguous` with `"retryable":true`, the share still unused, so bring the field up and send the same line again. It then opens the code, registers it, types it and discards the key, and answers `{"v":1,"type":"cvc","card":{"directWrite":true,"filled":["cvc"],"fields":1},"hygiene":{...},"verifiedErasure":false}`. The code is never printed. Pay once.

**After Pay.** Keep the process open until the store shows the outcome, then send `{"v":1,"op":"clear"}`. The helper empties every field it filled with the same trusted keys, puts the page back as it was, answers `{"v":1,"type":"cleared","card":{"cleared":<n>,"gone":<n>,"left":<n>,"unreachable":<n>}}` and ends. A field whose page went away (the store moved on after Pay) is `gone`. If anything is `left` or `unreachable`, close the checkout tab and tell the person. Closing stdin, a stop signal, a refusal and the 15-minute lifetime empty the fields the same way, so do not close the process before Pay. Decline any offer by the browser to save the card.

## AI-typed delivery

Where this helper cannot reach your browser (no debugging address: a hosted browser your runtime drives only through its own tools), prepare with `"delivery":"ai_types"`. The person's phone then says plainly that you will see and type the values yourself and that your records may keep them, and their hold approves exactly that. Every phone that may approve must be at AI Browser version 5, or prepare answers `ai_types_unsupported`. `merchant_saved` takes no delivery.

The approved status's `binding` carries `"delivery":"ai_types"` (a binding you assemble adds it). The phone seals the same word into the release, and the helper opens it only when both say so (`release_rejected` otherwise). An open line that carries both `delivery` and `cdp` is `invalid_command`. Open without `cdp`:

```json
{"v":1,"op":"open","sealed":"<approved base64url wire>","binding":{"requestId":"<request>","...":"...","delivery":"ai_types"},"serverShare":"<status serverShare>"}
```

The helper answers with the contact details and answers whole, and for the card only what follows:

```json
{"v":1,"type":"opened","details":{"name":"...","shippingAddress":"..."},"card":{"delivery":"ai_types","pieces":[{"field":"number","of":4},{"field":"expiry","of":1},{"field":"holder","of":1}],"cvcPending":true},"hygiene":{...},"verifiedErasure":false,"note":"..."}
```

Then ask for one piece at a time, typing each where it goes before asking for the next:

```json
{"v":1,"op":"piece"}
```

Each answer is one piece, `{"v":1,"type":"piece","field":"number","index":1,"of":4,"text":"4111"}`: the number's display groups in order (typed into the number field one after another), the expiry as `MM/YY`, then the name on the card. A `piece` within 1.5 seconds of the last is `piece_too_soon` with `"retryable":true`. The last piece carries `"last":true`. After `ai_browser_checkout_begin` allows Pay, `{"v":1,"op":"cvc","cvcServerShare":"<begin cvcServerShare>"}` answers the security code as one more piece, also 1.5 seconds after the last. A piece the checkout has no field for, such as the name on the card, can be left unasked: the `cvc` line gives the code all the same, and that piece can still be asked for after it.

A line out of turn costs nothing and keeps the release, each answer with `"retryable":true`: a `piece` once every piece is given is `no_more_pieces`; a `cvc` line without begin's share is `begin_first`; a `cvc` line for a release that carries its code as one of its pieces (sealed whole) is `pieces_remaining`; any other line, the open line sent again included, is `invalid_command`. A store login comes one cookie per piece (`name`, `value`, `domain`, `path`, `secure`, `httpOnly`, and `expires` and `sameSite` when set) for your browser tools to load.

Splitting the card keeps the whole number out of any single line of your records and out of plain card-number scans. It is obscurity, not protection: your records may still hold every piece, and that is what the person was told. Never assemble the number, never repeat a piece in chat or a report, and answer the deletion checks that follow: each printed piece is registered for proof of deletion as the `"text":"4111"` pair it was printed as.

**Trace codes.** A version 5 request carries `traceCode`, for example `SL-7K2Q9`. The phone writes it into the shipping and billing address as `ATTN SL-7K2Q9` right after the street, and into an email with plus addressing as `name+sl7k2q9@gmail.com`. Type them exactly as given: the code lets the person trace a later copy of their details back to this checkout, its AI, store and time. It is not a secret.

## A field the vault does not hold

This optional-ask lane currently applies to personal checkouts. Household contracts accept the requested standard contact fields from the member and the selected card from the payer. A size or variant already present in the AI's cart is public proposal metadata, not a newly released vault value. Do not claim ShareLess deletion evidence for it or ask for unsupported private values in chat.

When the store's form wants something outside the six released fields (the name of the card's bank, a company name, a delivery note), send it as an ask in `ai_browser_checkout_prepare`: `asks: [{"id": "bank_name", "label": "Name of bank", "required": true}]`, at most three, `shareless_card` only. `label` is the store's own field label; `id` is a slug of yours. The person types each answer on the phone's review and it is sealed with the card under the same hold. Never ask for it in chat.

An ID's number, expiry or issuing country may be asked this way, such as a passport's for a flight: name the document in the label ("Passport number", "Passport expiry date", "Passport issuing country"), and the phone starts each answer from the person's saved ID, under the same hold with Face ID. A password or passcode, a one-time or verification code, a PIN, a card number, a card's expiry or security code, and a bank account or routing number are refused whole. A phone that cannot show asks yet answers `asks_unsupported` and nothing is created: ask the person to update the app, or continue On Device.

For a contract that carries asks, the status `binding` carries them by id, in the contract's order (a binding you assemble adds them the same way): `"asks": [{"id": "bank_name", "required": true}]`. `opened` then carries `"answers": {"bank_name": "<what the person typed>"}` beside `details`; an optional ask the person left blank is absent. Type an answer into the store's field of that label and nowhere else.

## Proof of deletion

A card release leaves its contact details and answers wherever your runtime records tool output, and the card in your browser's checkout until the helper empties it; a store login leaves the store's cookies in your browser. The person is shown whether you later showed them gone, and may require that before another card release. A store login opens a deletion check like a card release; the requirement itself refuses only a card release. The verifier is [Provenex](https://pypi.org/project/provenex-core/), installed and keyed by your own runtime; this helper only drives it. A receipt is the result of your own scan, signed by your own key: evidence of what you found, never independent verification, and it covers only the places you enrolled.

**Once per runtime**

1. `pip install 'provenex-core>=1.1.0'` (Python 3.10 or later). A virtual environment is fine: put its `bin` folder on the helper's `PATH`, or name the command in `SHARELESS_PROVENEX_BIN`.
2. `provenex keys init --output-dir <private folder>` writes `private.pem`, `public.pem` and `index_secret`. Keep the folder outside every store you enrol. Never print or send `private.pem` or `index_secret`.
3. Write a hygiene config JSON beside them:

```json
{
  "index": "hygiene.db",
  "index_secret": "<the text inside index_secret>",
  "receipt_private_key": "private.pem",
  "stores": [
    {"store_id": "runtime-logs", "path_globs": ["<where tool calls and their output are recorded>/**/*"], "class": "runtime-log", "owner": "agent-runtime", "links": []},
    {"store_id": "tmp", "path_globs": ["<your temp folder>/**/*"], "class": "temp-artifact", "owner": "agent-runtime", "links": []}
  ]
}
```

Enrol every place your runtime writes what a tool printed: tool and exec records, session transcripts kept on disk, temp folders, downloaded artifacts. A place you leave out is a place a copy can survive unseen. A file that cannot be read as text makes a receipt INCOMPLETE, so enrol text stores.

4. Call `ai_browser_verifier_register` (through `shareless_invoke` when it is not in your tool list) with `package: "provenex-core"`, the installed `version`, the whole text of `public.pem` as `publicKeyPem`, each store by `storeId` and `class` only (no paths), and under `uncovered` the places you cannot delete from: `chat-transcript`, `model-provider`, `browser-service`, `screen-recording`, `backups`, `other`.

**Every card release**

1. Start the helper with `SHARELESS_PROVENEX_CONFIG=<absolute path of the config>`. `ready` then carries `"hygiene": {"configured": true, "ready": true}`; `ready: false` names why the verifier cannot be reached, and a card release or a store login will be refused until it can, so fix it and start again before prepare. `SHARELESS_PROVENEX_BIN` and `SHARELESS_PROVENEX_PYTHON` override where the `provenex` command and its interpreter are found.
2. On `open`, and again on `cvc`, the helper registers every released value under `shareless:<requestId>` before it prints one or puts it into your browser, through the verifier's own interface over stdin: never on a command line, where a process list and an exec record would keep it. What it registers is the list the person's phone computes too, so the phone can check a receipt searched for every value: each value as JSON prints it, each line of an address, the card number as digits and in display groups (as a checkout's field and a browser's saved session hold it), and a value too short to search for alone (the security code, the expiry) as its printed pair, `"cvc":"123"`, which a runtime would only show by printing the release itself. For a store login it registers each cookie value of 8 characters or more, as JSON prints it and as your browser holds it. `opened` carries `"hygiene": {"registered": true, "documentId": "shareless:<requestId>", "forms": <count>}`. If the verifier refuses or records something else than it was sent, the answer is `hygiene_failed` and nothing is printed, typed or written; the attempt is spent, so prepare again.
3. After the purchase, let the helper empty the card fields (`clear`), then delete the tool records, logs and temp files that hold what it printed. For a store login, also delete the store's cookies from your browser.
4. Read `hygiene` in any reply for the request, or `ai_browser_deletion_status`: it names the open check (`checkId`) and `sealTo`, the phone key a receipt is sealed to. Then write one JSON line to `node runner.mjs seal-receipt`:

```json
{"v": 1, "op": "prove", "config": "<absolute path of the config>", "requestId": "<request id>", "checkId": "<check id>", "sealTo": {"deviceId": "<id>", "publicKey": "<key>"}}
```

It runs `provenex verify-absence` for that request, seals the receipt to the phone, records the purge when nothing was found, removes the copy it wrote, and prints `{"type": "sealed_receipt", "sealedReceipt", "receiptId", "verdict", "issuedAt", "receiptDigest", ...}`. Send those five fields with the `requestId` and `checkId` to `ai_browser_deletion_proof`. For a receipt you produced yourself, `{"v": 1, "op": "seal_receipt", "receiptPath": "<absolute path>", ...}` seals it the same way; removing that file is then yours.

A PRESENT or INCOMPLETE receipt is sealed and sent too: it is the honest answer. Purge what it names and send a fresh one for the same check. A receipt lists a fingerprint of every released value, and a card number's fingerprint can be reversed by trying every number, so treat a receipt like the card: never paste one into chat, a report or another tool, and never keep one in an enrolled store. The server cannot read what you send; the person's phone opens it and checks the signature against your registered key, that the receipt was issued after the check was asked, that every released value was searched for, and that nothing was found or left unread. A receipt is held to its request by what it searched for, so answer each check with a scan made for that check's `documentId`. A scan hashes every character of every enrolled file, so a large store takes minutes.

Checks follow each card release, a week and a month later, and whenever the person asks. `ai_browser_deletion_status` lists the ones that wait; a lapsed check can still be answered.

## Household checkout and separate deletion receipts

The requesting member's AI executes the purchase. The household primary holds to release their selected card; the member separately holds to release only the requested contact fields. A card-only request needs no member-contact hold. Both phones need household-aware version 4 support. Household requests support `shareless_card`; merchant-saved payment, store login and optional asks are refused. A refusal is not permission to switch payment paths or reuse an older request.

The status `binding` carries the canonical contract's exact `household` object (a binding you assemble copies it): `v`, `householdId`, `requestId`, `memberUserId`, `primaryUserId`, `memberLabel`, `primaryLabel`. Do not infer or replace either account identity. The sealed payload must match this context and the contract hash, use split release, and keep the CVC for begin. A registered verifier is required before opening a household release. The payer's card goes into the checkout like any card; the name on the card is typed only when the payer's card carries one.

The runner registers card forms under `shareless:<requestId>:payer` and member contact forms under `shareless:<requestId>:member`; CVC forms join only the payer set at begin. Its `hygiene.proofs` lists the source registrations. Status returns separate proof checks and receipt targets in `hygiene.proofs`; a card-only checkout has no member disclosure check. Use each check's own `source`, `checkId` and `sealTo`:

```json
{"v":1,"op":"prove","config":"<absolute config path>","requestId":"<checkout id>","checkId":"<this source's check id>","source":"member","sealTo":{"deviceId":"<member's device>","publicKey":"<member's signed receipt key>"}}
```

Run separately with `source:"payer"` and the payer check's target for the card/CVC receipt. Submit the returned proof to its exact check. The phone checks only that person's expected values; a passing member check cannot clear a failed payer check. Never send a combined receipt to either person: fingerprints are sensitive too. Household proof uses `prove`, which scans the source document; the helper refuses `seal_receipt` with a source because an arbitrary supplied receipt might contain the other person's fingerprints. A failed or incomplete scan remains visible to its own source owner.

## Open a store login

For `store_login`, the binding's `requiredFields` is `[]` and the same command opens the store's login, never a card. A store login is always a split release: add `"serverShare":"<status serverShare>"` to the open line, as for a card, and `"cdp"`; there is no second step. The helper reaches the browser before it decrypts anything, writes the cookies into the browser's default profile as session cookies with `httpOnly` and `secure` as given, and answers `{"v":1,"type":"opened","storeLogin":{"directWrite":true,"cookies":<count>,"names":[...]},"hygiene":{...},"verifiedErasure":false}`: names and a count, never a value. A cookie the browser would not take is listed under `notWritten`. The browser address codes above apply, and a line without `cdp` is `cdp_required`. A write that fails after decrypting is `browser_write_failed`; nothing is printed and the attempt is spent. The helper refuses a package with any card or contact field, a cookie outside the store's own site, more than 200 cookies or 64 KiB, or a cookie carrying a card number. Pages you open from a separate browser context do not see the default profile's cookies.

Open the store's checkout and confirm you are signed in. Use the login for this purchase only: never change the account, its password, addresses or saved card. If the store does not accept the login (it asks you to sign in), do not sign in or retry: before begin, call `ai_browser_checkout_report` with outcome `session_rejected` and nothing else. Nothing was paid, and the phone drops that store's login (the person signs in at the store again before it is lent another time). Then pay with a card in the same browser, as the reply's `nextAction` `prepare_shareless_card` says: prepare a new `shareless_card` request, with a new idempotency key and a new runner's ready key, for the store's guest checkout, or, where your browser is signed in to the store on its own, for that checkout with `requiredFields: ["card"]`. After begin, report `failed` or `unknown` as usual.

A request that expired before begin paid nothing: its `nextAction` is `prepare_new`, a new request with a new idempotency key and a new runner. A request the person declined on the phone ends with `stop`: ask them in chat before preparing it again.

## A signed-in job's program helper

For a signed-in job (`signed_in_job_prepare`, full connector only: a password sign-in, a look-up, no saved details) on a browser you reach over its debugging connection, run `node runner.mjs signed-in-job --cdp <address>` and keep it running. It checks that it can reach the browser, makes a job key (X25519) and a program key (Ed25519), and prints one line: `{"v":1,"type":"ready","mode":"signed_in_job","jobKey":"...","programKey":"...","note":"..."}`. Send both as `helper: {"kind":"program","jobKey":"<jobKey>","programKey":"<programKey>","directWrite":true}`.

After the person's hold it fetches its own package once from `https://app.shareless.ai/api/vault/signed-in-helpers`, with requests signed by the program key; no answer to you carries the package. It opens it, refuses one for another job or site, with a cookie outside the site, a saved detail or a card number (`{"type":"open_failed","code":...}`: nothing is written), writes the site's cookies into the browser's default profile as session cookies with `httpOnly` kept, and prints `{"v":1,"type":"loaded","jobId":"...","site":"...","cookies":<count>,"placeholders":[]}`.

When you report the job (`signed_in_job_report`), when the job ends, or when the process gets SIGTERM or SIGINT, it deletes every cookie of the site and its subdomains, clears local storage, IndexedDB, cache storage, service workers and file systems of the site's origins it saw opened, and session storage in the site's open pages; then it searches the browser for what it lent: a cookie under the site with a lent name or value, a lent value of 8 characters or more anywhere, and the site's open pages' storage. It cleans and searches once more if something is found, and if something is still there it sends nothing (`receipt_withheld`): the phone then shows the receipt as missing. Otherwise it sends a receipt signed with the key the phone put in the package, prints `{"v":1,"type":"receipt","jobId":"...","receipt":"checked"}` and exits 0. Downloads are not searched; the receipt says so.

No line it prints holds a cookie value, the sealed package or the server's share. Errors are fixed codes: `cdp_invalid`, `cdp_not_local`, `cdp_unreachable` (before any key exists), `origin_invalid`, `server_refused`, `server_unreachable`, `already_opened`, `receipt_refused`, `cleanup_failed`, `arguments_not_supported`. It waits up to 20 minutes for the hold (`{"type":"ended","reason":"no_job"}`), and a stop signal before the hold ends it with no key used.

## Pay once

Opening is **not payment permission**. After the card is in the checkout, re-read the live merchant, items, currency and total. An estimate's total may rise into the room the person approved, never above that same cap. Only the unique `allowed:true` reply from `ai_browser_checkout_begin` permits one payment attempt. A lost or uncertain reply requires reconciliation, never another Pay click. Report the actual observed outcome as completed, failed or unknown; the server labels it AI-reported. This helper neither calls begin nor clicks Pay.

## Lifecycle and shutdown

The helper reports `key_created`, `decrypt_requested`, `decrypt_completed` and `key_reference_discarded` with a process clock ID and timestamp. The latter means it invoked disposal and dropped a reference, not that all copies were erased. When forwarded to ShareLess, these are agent reports. The corresponding MCP events are `recipient_key_minted`, `payload_decrypted` and `key_reference_discarded`; there is no event for `decrypt_requested`. Do not attribute browser actions to this helper's clock or invent `fields_filled` or `pay_clicked` observations.

`clear`, EOF, SIGINT, SIGTERM, SIGHUP (a closing terminal), a command sent while another is still being opened or once everything is given, or the 15-minute lifetime ends the process, and each first empties any card fields it filled (`cleared`; under `ai_types` you typed them, so there is nothing for it to empty). EOF during decryption suppresses subsequent output, so do not pipe a line and immediately close stdin. A new process generates a different key and cannot recover an old release. The helper creates no files, opens no network listener and exposes no private-key API; it connects only to a browser address you give it and, as a program helper, to the service. Its host can still inspect memory, and you can still read the browser it typed into.

Input is one UTF-8 JSON line, at most 131,072 bytes, with no extra keys. End the write with a real LF byte (`\n`); some process tools do not append it. If the complete JSON was written once without a terminator and the same process is still waiting, append only the missing LF. Do not resend the packet because output is pending. Errors use fixed codes without echoed input: `arguments_not_supported`, `invalid_command`, `input_too_large`, `already_consumed`, `release_rejected`, `hygiene_failed`, `card_fill_failed`, `card_not_hidden`, `browser_write_failed`, `household_hygiene_required`, `startup_failed`, and with `"retryable":true` the browser, tab and field codes above, `piece_too_soon`, `no_more_pieces`, `begin_first`, `pieces_remaining`, and `invalid_command` for a line the helper cannot use before its key is touched or while a release waits for its next step. A release completed (the security code typed, or a whole release or store login opened) and then ended exits 0; cancellation or refusal exits 1. Neither exit code confirms a purchase.
