Install
openclaw skills install magicpayHandle approved login, identity, checkout, donation, subscription, payment pages, and typed action approvals through the magicpay CLI.
openclaw skills install magicpayMagicPay is for approved product workflows that need stored user data and
explicit approval on a login, identity, checkout, donation, subscription,
payment, or other sensitive page. A MagicPay product workflow session is the
parent. Browser launch or attach happens after magicpay start-session and is
recorded as a child resource inside that active session.
Stored values come from user-approved MagicPay Memory items — logins,
identities, payment cards, wallets, and reusable profile fields that the user
saved earlier. This skill's job is to bring those approved values to the
current form through Memory plan-fill and apply-fill without raw values
passing through the LLM prompt. MagicPay hides stored raw values from the
calling model; it does not make an untrusted runtime safe. If the browser,
OS, or shell is compromised, MagicPay alone does not protect against that.
MagicPay also cannot protect secrets that the user already typed into the agent chat. The safest path is to use saved MagicPay Memory or a MagicPay request path that keeps raw values out of the agent prompt.
Use this skill when the remaining product work is to:
start-session;magicpay plan-fill;magicpay apply-fill;solve-captcha.MagicPay works best as a focused companion to a browsing tool. It owns the protected product workflow; the browser is only the execution resource used inside that workflow.
When this skill runs in OpenClaw, do not start MagicBrowse as the first
browser path. Use OpenClaw's built-in browser tool, guided by the bundled
browser-automation skill, for normal page work: opening pages, checking tabs,
reading snapshots, taking screenshots, clicking controls, filling
ordinary fields, and continuing after MagicPay applies Memory fill.
This does not change the MagicPay product order. If the user task is a MagicPay
workflow, run magicpay status or config recovery, then magicpay start-session
before browser preparation. The active MagicPay product workflow is the parent;
OpenClaw's built-in browser is the normal page-work owner, and MagicPay binds a
browser child only when a MagicPay browser-dependent command needs one.
Use MagicBrowse only as fallback if OpenClaw's native browser cannot reliably reach, inspect, or continue the page. Do not switch to MagicBrowse just because MagicPay mentions browser continuation.
Consequential actions require matching typed approval. Before any submit, protected action, purchase, login, identity submission, account change, or other consequential action, get the matching typed MagicPay approval:
authorize-payment,sign-message, orconfirm-action. After typed approval, proceed with exactly that action; do not ask for a second approval unless the approved page facts changed. MagicPay fills planned fields only; the browser owner handles continuation.
Payment authorization facts are collected by the agent. Before
magicpay authorize-payment, collect visibleamount,currency,recipient, and optionaldescriptionandrecurringfrom the current page and the user's task. Ask the user when the amount, currency, recipient, recurring status, or task/page facts are ambiguous. Do not change existingitemRefselector behavior;itemRefremains a selector, not an action param. A successfulauthorize-paymentcovers the matching payment form fill and final Pay/Submit action while those facts stay unchanged.
Fill and hand back. Use
magicpay plan-fillto build a value-free Memory plan, thenmagicpay apply-fillto materialize approved values and write the planned fields. MagicPay stops before final commitment controls. Continue the browser task with the browser owner. When the runtime has native browser automation available, keep that native browser path as the normal continuation owner.
Product session first. Normal MagicPay product work starts with
magicpay statusor config recovery, thenmagicpay start-session. Only after the active product workflow exists should you runmagicpay launchormagicpay attach <cdp-url>to bind a browser child. Do not launch or attach a standalone browser as the first MagicPay product step. This same product-session-first order applies even when native browser automation is used for page preparation and continuation.
Approval is channel-neutral. A pending MagicPay approval can be completed in MagicPay web/mobile UI or by OTP when the user chooses that channel. Do not ask for OTP before a pending approval request exists, do not claim OTP is mandatory, and do not reveal, store, repeat, or summarize OTP digits.
Credential and browser authority are sensitive. Do not print, log, or share
MAGICPAY_API_KEY, the local MagicPay config file (~/.magicpay/config.jsonby default or$MAGICPAY_HOME/config.json), or CDP endpoints. Memory refs and item ids are operational refs: pass them only between MagicPay commands; do not show them to the user, include them in reports, or send them to external tools. Usemagicpay attachonly for a private browser/session the user approved for this task, and only inside the active product workflow. If the machine or workspace is shared or compromised, stop and ask the user to rotate/revoke the key.
Browser cleanup is separate. MagicPay owns the protected workflow, not the browser.
magicpay closecloses or clears the browser child while keeping the product workflow active.magicpay end-sessioncompletes only the MagicPay workflow and deliberately leaves browser teardown to the browser owner unless the user explicitly approved cleanup.
Memory plans stay value-free.
magicpay plan-fillobserves the current page, fetches value-free Memory descriptors, and asks the Memory matcher for semantic target matches. It must not receive raw values, precomputed target matches, catalogs, materializers, or browser writers from the agent. If the matcher is unavailable, fail closed and surface that state.
Provider-backed cards need payment authorization before reveal.
magicpay plan-fillmay report a non-blocking blocker withkind: "payment_card.authorization_required"when MagicPay Memory has a provider-backed payment card but the active workflow session has not been authorized to reveal card handles. This is not a matcher failure and not permission to inspect, infer, print, or ask the user for PAN/CVV. If that card is needed for the payment, collect the visible payment facts and runmagicpay authorize-payment; after approval, rerunplan-filland thenapply-fillfor the current page.
CAPTCHA solving is recovery-only. Only call
magicpay solve-captcha [--timeout <s>]when a real CAPTCHA is confirmed present on the current browser child inside the active MagicPay workflow. It must not be used as generic page waiting or challenge detection. When continuing through MagicBrowse after a successful solve, callmagicbrowse mark-captcha-resolvedbefore the nextmagicbrowse act "continue...".
MagicPay Memory holds saved items and field descriptors. The public fill path uses value-free descriptors and opaque refs during planning, then materializes only the approved values needed by the active plan during apply.
Treat a Memory item as a user-owned reusable data record, not as a single field.
The item label is the human-readable name for that record and should describe
the group of fields that future fills may choose together. Good labels name the
purpose: Airline login, Traveler profile, Home shipping address, Wallet,
or Facts about user. Do not put raw values in the label, do not use one field
name as the item label when the item contains a broader record, and do not create
one item per field unless the user is saving one truly standalone fact.
Use Facts about user only for global profile facts with no narrower record.
Use narrower labels for site/account-specific logins, traveler profiles,
addresses, wallets, payment-related records, and other coherent groups. When
chat-provided reusable facts need saving, list Memory items first, update the
semantically suitable editable item, and create a new item only when no suitable
record exists.
The user's MagicPay Memory holds reusable items with stable field names,
human-readable hints, opaque refs, and optional public value types. Field names
are stable identifiers chosen by the product/runtime, such as username,
password, full_name, date_of_birth, or phone; hints explain when a
field is useful without containing raw values.
Public editable value types are only:
date — canonical value YYYY-MM-DD;phone_number — canonical E.164 value, for example +14155550100;person_name — non-empty full name string.When no value type is present, Memory fill treats the field as ordinary direct
fill and does not split or normalize it. Internal card value types such as
payment_card_number and payment_card_expiry belong only to provider-backed
payment-card Memory surfaced by MagicPay after authorization; do not set or
request those types through public Memory CRUD.
Do not assume emptiness or abundance from prior context. If you need to know
whether saved Memory can fill the current page, run magicpay plan-fill and
branch on its result. Do not read or print raw Memory contents yourself.
Provider-backed payment cards are special: before payment authorization,
plan-fill can show that a card exists through an
authorization_required Memory availability entry, but it does not expose
card field handles. Card handles appear only inside the active MagicPay
workflow session after the matching payment authorization is approved.
magicpay CLI on PATH. Install the reviewed package version with
npm i -g @mercuryo-ai/magicpay-cli@latest if missing.magicpay init <apiKey> (or
MAGICPAY_API_KEY in the environment). Sign up at
https://agents.mercuryo.io/signup.magicpay launch [url] after start-session, or use an approved private CDP
endpoint for magicpay attach <cdp-url> inside the active session.For MagicPay JSON output, branch on fields in this order: success, then
outcomeType, then command-specific error, reason, or fill.outcome.
Use message and prose reason as user-facing text only. Do not parse text
to discover whether a result is memory_fill_required,
secret_validation_failed, verification_required, or another machine code.
magicpay status. If it reports a missing key, a
cliUpdate, or still fails after init (in which case run
magicpay doctor), follow the recovery rules in
references/workflow.md.magicpay start-session [name]. This creates
the product session and product telemetry root before any browser child is
required.magicpay launch [url] when MagicPay should create the browser child;magicpay attach <cdp-url> only for a private browser/session the
user approved for this task;magicpay solve-captcha [--timeout <s>].
magicbrowse mark-captcha-resolved, then magicbrowse act "continue...". If that act returns needs_handoff again, the wall
is not actually cleared — surface to the user, do not re-mark.
Otherwise (continuation stays in MagicPay or another browser tool)
continue the normal browser or MagicPay form flow on the same page.magicbrowse mark-captcha-resolved. Surface the failure to the user.magicpay plan-fill.
If the planner needs context, pass a short human-readable
--planner-hint <text>. Do not pass page targets, target matches, Memory
catalogs, raw values, materializers, or browser writers.
payment_card.authorization_required or a warning that the Memory store
contains a payment card but authorization is required, treat it as
machine state from the backend: the card exists, but card handles are not
available yet in this workflow session. If the current task needs that
card, collect amount, currency, recipient, optional description,
and optional recurring, run magicpay authorize-payment, then rerun
plan-fill.magicpay apply-fill.
MagicPay refreshes the page state, materializes approved Memory values, and
fills only planned fields through the browser bridge. It does not click Pay,
Book, Send, Submit, or other final commitment controls.
apply-fill reports memory.choose_candidate, use candidate labels
only for explaining choices to the user. Submit the selected backend-owned
choiceId with magicpay choose-memory --choice <choiceId>, then let
that command continue the fill.amount, currency,
recipient, and optional description and recurring, then run
magicpay authorize-payment --amount <number> --currency <code> --recipient <name> .... Use --item-ref only as the existing Memory item
selector. After success, continue with that exact payment and do not
ask again before final Pay/Submit unless amount, currency, recipient, or
recurring status changed.magicpay sign-message --item-ref <walletItemId> --message <text>.
After success, sign that exact message; ask again if the message changed.magicpay confirm-action --summary <text> [--details <text>].--return-pending to the typed
action command. Tell the user they can approve the same request in
MagicPay UI or provide the OTP they received. If they provide OTP, run
magicpay confirm-otp --otp <digits>, then run magicpay wait-request.
If they approve in MagicPay UI, skip confirm-otp and still run
magicpay wait-request.observe or the equivalent). User success is not "fields were filled";
keep going only from the fresh visible form state.magicpay end-session once the sensitive step
is complete. This does not define browser cleanup. Return control to the
browser owner, or run magicpay close only when you need to close or clear
the browser child while keeping product workflow semantics separate.When the flow deviates — changed forms, denied approvals, ambiguous forms, page changes mid-fill — consult references/workflow.md and references/statuses.md.
Ask the user only when:
magicpay launch nor an
approved private CDP endpoint is available inside the active session;MAGICPAY_API_KEY, the local MagicPay config file, or
CDP endpoints. The config file is ~/.magicpay/config.json by default or
$MAGICPAY_HOME/config.json when MAGICPAY_HOME is set. Treat Memory item
ids as operational refs: pass them between MagicPay commands when required,
but never show them to the user or include them in reports/logs.magicpay status as the normal readiness check; doctor is not a
startup step.npm i -g @mercuryo-ai/magicpay-cli@latest.plan-fill after meaningful page changes instead of reusing a stale
plan.magicpay end-session for workflow completion. Use magicpay close only to
close or clear the browser child, then let the browser owner decide whether
to leave any page open or close its own owned session.payment_card.authorization_required from plan-fill as a
non-blocking catalog state: a provider-backed card exists, but card handles
stay hidden until authorize-payment succeeds in the active workflow
session. Do not ask for raw card details and do not materialize a card
through any other path.solve-captcha only after confirming a real CAPTCHA on the current
browser child inside the active product workflow; when continuing through
MagicBrowse after a successful solve, call magicbrowse mark-captcha-resolved
before the next act.authorize-payment for payments, sign-message for wallet message
signing, or confirm-action for consequential actions without a more
specific typed command.--return-pending to the typed
action command, followed by either MagicPay UI approval plus wait-request,
or confirm-otp --otp <digits> plus wait-request.magicpay authorize-payment for payment authorization. Collect
amount, currency, recipient, optional description, and optional
recurring from visible checkout facts first, and ask the user if any of
those facts are missing, conflicting, or ambiguous.itemRef selector behavior. Keep itemRef outside
action params and use it only when intentionally selecting a known Memory
item.Open an extra reference only when it helps:
session_stop.If a term (itemRef, fillRef, resolutionPath, session_stop, etc.) is
unfamiliar, check the MagicPay glossary.
For the exact security boundary — what "protected" guarantees and where that guarantee stops — see MagicPay SDK security model.