{"service":"AgentKey","guide_version":"1","base_url":"https://agentkey.waiwiser.com/api/public/agentkey-api","what":"A password vault for AI agents. The owner approves each login; the agent never sees the password.","start_here":{"method":"POST","url":"https://agentkey.waiwiser.com/api/public/agentkey-api/v1/guide","body":{"environment":{"browser":"automation | extension | look_and_click | none","can_run_code":true},"goal":{"action":"login | signup","origin":"https://news.ycombinator.com","site_name":"Hacker News"}},"note":"Send your agent token too and the answer uses your live state (saved logins, trusted executors, waiting work)."},"choose_path":{"api_runtime":{"title":"API runtime (no extension)","use_when":"You run code next to a browser you already control (Playwright, Puppeteer or CDP page objects).","summary":"Enroll your runtime once through the API, ask for a login, then claim the sealed login and fill it in your own open page.","kit":"packages/agentkey-runtime (AgentKeyRuntime.enroll, pending, fillOperation)"},"browser_extension":{"title":"Browser extension","use_when":"You drive a normal Chrome window where the AgentKey extension can be installed, or you cannot run code beside your browser.","summary":"The owner pairs the extension once at https://agentkey.waiwiser.com/extension/pair. You ask for a login; the owner confirms the open tab and the extension fills it."},"glove":{"title":"Glove (last resort)","use_when":"You can only look and click with your own tools: you cannot install the extension and cannot let AgentKey control your browser page.","summary":"Open a glove: a separate browser on an owner-trusted machine that does exactly what you tell it, step by step, and nothing on its own. Every reply shows the updated page; you can send several steps at once and run up to 5 gloves at once, one per job. Sign-ins happen inside the glove; password boxes stay hidden from you.","protocol":{"name":"agentkey-glove/1","connect":"Open a WebSocket to connect_url within 60 seconds. First message: {\"type\":\"hello\",\"ticket\":\"<ticket>\"}. Reply: {\"type\":\"ready\",\"session_id\",...,\"page\"}.","message":"{\"id\":<your number>,\"steps\":[{\"do\":\"<command>\",...}],\"picture\":false}. Steps run back to back; the first failure stops the rest. One reply per message: {\"id\",\"ok\",\"results\":[...],\"page\":{url,title,text,elements:[{ref,role,name,value?}]},\"error\"?:{step,code,help}}.","refs":"Ref numbers come from the latest reply. They are not reused or guessed after navigation. Use a unique text or label to batch steps after opening an unread page.","commands":{"open":"{\"do\":\"open\",\"url\":\"https://...\"} (http/https only)","click":"{\"do\":\"click\",\"ref\":3} or {\"do\":\"click\",\"x\":120,\"y\":340} or {\"do\":\"click\",\"text\":\"Sign in\"}","type":"{\"do\":\"type\",\"ref\":4,\"text\":\"hello\",\"submit\":false} (replaces the field; never a password box)","press":"{\"do\":\"press\",\"key\":\"Enter\"} (copy, cut and paste shortcuts are blocked)","hover":"{\"do\":\"hover\",\"ref\":5}","drag":"{\"do\":\"drag\",\"from\":5,\"to\":9}","scroll":"{\"do\":\"scroll\",\"dy\":600} or {\"do\":\"scroll\",\"ref\":12}","select":"{\"do\":\"select\",\"ref\":7,\"value\":\"US\"}","check":"{\"do\":\"check\",\"ref\":8,\"on\":true}","upload":"{\"do\":\"upload\",\"ref\":10,\"name\":\"file.pdf\",\"data_base64\":\"...\"} (max 5 MB, your own data)","back":"{\"do\":\"back\"}","forward":"{\"do\":\"forward\"}","reload":"{\"do\":\"reload\"}","wait":"{\"do\":\"wait\",\"ms\":800} or {\"do\":\"wait\",\"text\":\"Order placed\"} or {\"do\":\"wait\",\"ref\":4} (max 10 s)","tabs":"{\"do\":\"tab_new\",\"url\":\"https://...\"}, {\"do\":\"tab_switch\",\"index\":1}, {\"do\":\"tab_close\"}","read":"{\"do\":\"read\"} (the page is already in every reply; use this only to refresh it)","picture":"{\"do\":\"picture\"} or \"picture\":true on a message: a screenshot with password boxes blanked","sign_in":"{\"do\":\"sign_in\",\"operation_id\":\"<job-bound operation>\",\"submit\":true,\"verify\":{\"url\":\"https://site.example/account\",\"text\":\"unique authenticated-page text\",\"timeout_ms\":10000}}. Request/use the login with this glove_session_id. Exact session binding is required. completed after submit means the supplied positive check matched; missing/unmatched verification or uncertain submission stays unknown. submit:false is fill only, not login. Never automatically retried.","generate_password":"{\"do\":\"generate_password\",\"length\":24,\"symbols\":true}. Returns only password_id; password stays in the trusted host. length is 12 to 64, symbols is optional.","save_created_login":"{\"do\":\"save_created_login\",\"password_id\":\"<id>\",\"username\":\"alice@example.com\",\"title\":\"Example\"}. On the exact HTTPS signup page, stage an owner-encrypted recovery copy before filling. Returns proposal_id and staged status. username is required; title optional.","fill_generated":"{\"do\":\"fill_generated\",\"password_id\":\"<id>\",\"ref\":12}. Only a password box on the staged origin. Records uncertain BEFORE fill; refuses to fill unless that durable transition succeeds. Repeat for a confirmation password box if needed. Never returns the password.","confirm_created_login":"{\"do\":\"confirm_created_login\",\"password_id\":\"<id>\"}. Send only after independently verifying account creation using authenticated-page evidence. This reports confirmed and pending import, NOT owner acceptance or proof of a saved vault item. No separate owner acceptance is required for automatic import. While the owner's vault is unlocked, the AgentKey mobile app automatically imports the confirmed pending login. Saving does not grant login use. It does not verify the site for you.","discard_password":"{\"do\":\"discard_password\",\"password_id\":\"<id>\"}. Before any possible fill only: retract the staged proposal and forget the generated value. After fill, only the owner may discard the retained recovery copy.","close":"{\"do\":\"close\"}"},"signup":"Account creation needs separate permission from the account owner. Open an ordinary requester-authenticated Glove job and use generate_password, save_created_login, fill_generated, then submit the site form yourself. Verify creation before confirm_created_login. While the owner's vault is unlocked, the AgentKey mobile app automatically imports confirmed pending logins; saving does not grant login use. Closing a job never confirms a signup. Never-filled staged proposals are retracted when the job closes. A possibly-filled but unconfirmed proposal stays uncertain and recoverable until the owner decides. This is the Glove WebSocket protocol, not an npm signup command.","shield":"Blocked: running your own code in the page, cookie/session/profile export, downloads, typing into or reading password boxes, clipboard shortcuts and dragging out of password boxes. Password boxes are hidden in every reading and picture.","limits":"Up to 5 gloves per agent at once, one per job. Each closes after 10 minutes idle, 60 minutes total, when you close it, or when the owner stops it."}},"no_browser":{"title":"No browser (chat or MCP only)","use_when":"You have no browser at all.","summary":"You can check saved logins and ask for approval, but a login can only be filled by a browser executor (an API runtime or the extension) owned by the same person."}},"tokens":{"agent":"Your agent token. From the OAuth connect flow (https://agentkey.waiwiser.com/.well-known/oauth-authorization-server) or the owner's pairing code (POST https://agentkey.waiwiser.com/api/public/agents/register).","runtime":"Your API runtime's own session, sealed to its key by POST /v1/executor/redeem. Refresh with POST /v1/executor/session/refresh."},"routes":[{"method":"GET","path":"/v1","auth":"none","does":"This description."},{"method":"POST","path":"/v1/guide","auth":"optional","does":"Tell AgentKey your goal and environment; get the fastest path and next exact call."},{"method":"GET","path":"/v1/inventory","auth":"agent","does":"Saved sites and labels for your owner. Never passwords."},{"method":"POST","path":"/v1/requests","auth":"agent","does":"Ask for a login: {agent_id, executor_id, origin, protocol_version:\"1\", site_name, signin_url?, aux_origins?}."},{"method":"GET","path":"/v1/requests/{id}","auth":"agent","does":"Request status; grant_id appears once approved."},{"method":"POST","path":"/v1/grants/{id}/use","auth":"agent","does":"Queue one fill: {origin, executor_key_id, idempotency_key}."},{"method":"GET","path":"/v1/operations/{id}","auth":"agent","does":"Status of a queued fill."},{"method":"POST","path":"/v1/executor-presence","auth":"agent","does":"Which of your owner's executors were seen recently: {agent_id}."},{"method":"POST","path":"/v2/target-requests","auth":"agent","does":"Ask approval for one exact open page: {agent_id, executor_id, target_id}."},{"method":"POST","path":"/v1/glove/sessions","auth":"agent","does":"Last resort only. Open a glove for one job: {agent_id, job_id, kind:\"one_off\"|\"standing\", reason:\"no_extension_no_page_control\"|\"signup_and_save\"}. job_id is a UUID. Signup uses signup_and_save; existing-login browsing remains last resort. Returns connect_url and a one-use ticket."},{"method":"POST","path":"/v1/glove/sessions/list","auth":"agent","does":"Your open gloves and whether a glove host is available: {agent_id}."},{"method":"POST","path":"/v1/glove/sessions/{id}/close","auth":"agent","does":"Close one of your gloves: {agent_id}."},{"method":"POST","path":"/v1/executor/glove/host","auth":"runtime","does":"Glove host: advertise {executor_id, connect_url (wss://), capacity}."},{"method":"POST","path":"/v1/executor/glove/redeem","auth":"runtime","does":"Glove host: redeem an agent ticket once: {executor_id, ticket}."},{"method":"POST","path":"/v1/executor/glove/heartbeat","auth":"runtime","does":"Glove host: report gloves {executor_id, sessions:[{session_id,steps,site}]}; the answer lists gloves still allowed open."},{"method":"POST","path":"/v1/executor/glove/sessions/{id}/close","auth":"runtime","does":"Glove host: report a closed glove {executor_id, reason}."},{"method":"POST","path":"/v1/executor/pairings","auth":"agent","does":"Start enrolling an API runtime: {agent_id, code_hash, label?}."},{"method":"POST","path":"/v1/executor/redeem","auth":"code","does":"Redeem the pairing code with your runtime public key: {code, public_key}."},{"method":"POST","path":"/v1/executor/session/refresh","auth":"refresh token","does":"Refresh the runtime session: {refresh_token}."},{"method":"GET","path":"/v1/executor/self","auth":"runtime","does":"Is your runtime trusted (enabled) yet?"},{"method":"POST","path":"/v1/executor/heartbeat","auth":"runtime","does":"Report that the runtime is online: {public_key}."},{"method":"GET","path":"/v1/executor/pending","auth":"runtime","does":"Approved fills waiting for you."},{"method":"POST","path":"/v1/executor/operations/{id}/claim","auth":"runtime","does":"Claim one sealed login (once)."},{"method":"POST","path":"/v1/executor/operations/{id}/complete","auth":"runtime","does":"Report exactly one outcome: {outcome: completed|failed|unknown}."},{"method":"POST","path":"/v1/executor/targets","auth":"runtime","does":"Register one exact open page as a target."},{"method":"POST","path":"/v1/requests/{id}/deny","auth":"owner","does":"Owner only, on their device. Denies a pending request; not available to agents."},{"method":"POST","path":"/v1/grants/{id}/revoke","auth":"owner","does":"Owner only, on their device. Revokes a grant; not available to agents. An unused one-use grant expires within 5 minutes."}],"errors":{"unauthorized":"Send \"Authorization: Bearer <token>\". Agent routes take your agent token; /v1/executor/* routes take your runtime session token. If it expired, refresh it (runtime: POST /v1/executor/session/refresh).","not_authenticated":"Send \"Authorization: Bearer <agent token>\".","rate_limited":"Too many calls. Wait and retry with backoff.","rules_channel_unavailable":"Temporary. Retry shortly.","invalid_request":"The body or path did not match exactly. Send JSON with exactly the listed fields (no extras, no query string). See the route list at GET /v1.","method_not_allowed":"Use GET or POST as listed at GET /v1.","not_found":"Unknown route, or the record is not yours. GET /v1 lists every route; POST /v1/guide shows your current state.","body_too_large":"Send a smaller JSON body.","site_name_required":"Add site_name, the plain service name (for example \"Hacker News\"). Never make the user type it.","signin_url_required":"No login is saved for this site yet. Find its exact HTTPS sign-in page on the same origin and resend with signin_url. Do not guess.","invalid_signin_url":"signin_url must be an exact HTTPS page on the same origin, with no fragment or embedded credentials.","invalid_aux_origins":"aux_origins: at most 4 exact HTTPS origins, no paths or wildcards.","requester_token_required":"This route needs your agent token, not the runtime session token.","executor_token_required":"This route needs your runtime session token (from POST /v1/executor/redeem). Use your agent token for /v1/requests and grants.","not_claimable":"Already claimed, expired or not addressed to this runtime. GET /v1/executor/pending again. Never fill twice.","not_allowed":"AgentKey refused: the runtime may not be trusted yet, the grant may be used or expired, or it belongs to another executor. Check GET /v1/executor/self, then POST /v1/guide.","too_many_pending":"At most 3 pairings can wait at once. Reuse an existing approval link or wait 10 minutes.","invalid_job_id":"job_id must be a UUID. Generate crypto.randomUUID() once for this job and keep it stable on retries.","glove_last_resort":"For authorized signup-and-save, use reason signup_and_save. For existing-login browsing, the glove is a last resort. Send reason \"no_extension_no_page_control\" only if you truly cannot use the extension or give AgentKey control of your page. Otherwise POST /v1/guide for a faster path.","glove_unavailable":"No glove host is running for this owner. The owner's team must run the AgentKey glove program (packages/agentkey-glove) on a trusted machine. Use another path meanwhile; POST /v1/guide.","glove_busy":"Every glove host is full right now. Wait and try again; your glove will not replace anyone else's.","glove_limit":"You already have 5 gloves open. Close one you no longer need (POST /v1/glove/sessions/{id}/close) or wait for one to finish.","job_has_glove":"This job already has a glove. Keep using it, or close it first. Use a new job_id only for a different job.","job_kind_mismatch":"This job_id was used with a different kind (one_off vs standing). Each job keeps one kind; use a new job_id for a different job.","executor_not_configured":"The hosted browser is retired. Use your own browser through the API runtime or the extension; POST /v1/guide picks one.","executor_unavailable":"The executor did not answer. POST /v1/guide to check your executors.","agent_not_available":"That agent_id is not connected to your token. Omit agent_id in POST /v1/guide to see your agents.","request_failed":"AgentKey could not complete this. Check the IDs are yours and current (POST /v1/guide). Never reuse an uncertain grant use with a new idempotency key."},"rules":["Never ask the user for a password, cookie or code in chat. Existing logins are sealed on the owner device. Account creation needs separate owner permission. For an authorized new-account signup, Glove can generate a hidden password and stage an owner-encrypted copy before filling. While the owner's vault is unlocked, the AgentKey mobile app automatically imports confirmed pending logins. Never-filled staged proposals are retracted when the job closes. Possibly-filled but unconfirmed proposals stay uncertain and recoverable until the owner decides, and saving a login does not grant its use.","Link first: send the user the exact link AgentKey returns (\"here is your link\"). Never tell them to open the app or hunt for a request.","A saved login is access, not permission. Wait for an approved grant, and reuse a standing grant instead of asking again.","Never retry an uncertain sign-in or submission. Report \"unknown\" once and check the site state first.","Keep one pending request per need. Poll it; do not create duplicates.","Fill only the existing page whose origin matches the grant. Stop if the page or form is ambiguous."],"rules_updates":{"where":"Every authenticated agent API response carries agent_rules: one entry per agent with current_version and acknowledged_version.","when_status_awaiting_acknowledgment":"Read update.text, follow it from now on, then acknowledge.","acknowledge":{"method":"POST","url":"https://agentkey.waiwiser.com/api/public/agentkey-api/v1/updates/ack","body":{"delivery_id":"<update.delivery_id>","version":"<update.version>","content_hash":"<update.content_hash>"}},"check":{"method":"GET","url":"https://agentkey.waiwiser.com/api/public/agentkey-api/v1/updates"},"example":{"delivery_id":"<UUID from update>","version":1,"content_hash":"<exact hash from update>"},"version_type":"version is a JSON integer, never a quoted string; use the exact update.version value.","note":"Acknowledging means you received and will follow this version. Later versions arrive the same way, as a change list when you are one version behind."}}