globalThis.api on its background service worker at chrome-extension://<extension-id>/background/background.js. Call it over the Chrome DevTools Protocol (CDP). See Call the extension over CDP.
Each capability has its own version namespace:
api.agenticAutofill.v1 has three independent operations:
The extension and the SDK work together. You can create and check a request with the SDK, then pass the granted reference to the extension to fill.
Install the extension
Install 1Password Nightly from the Chrome Web Store, version 8.12.46.6 or later, or install it with the extension installation mechanism your browser stack uses. Keep it up to date. See Supported builds for compatibility details.Wait for the extension to be ready
api.initialization.v1 is available as soon as the service worker starts. Its state property is "initializing", "ready", or "failed". Wait with whenSettled() instead of polling state:
whenSettled() resolves to "ready" or "failed". A "failed" result is final for the current service worker lifetime.
After initialization, check that api.agenticMode and api.agenticAutofill are present. If either is missing, the installed extension build or its current configuration doesn’t make this API available. In a browser you manage, the browser policy makes the API available at startup.
Turn on Agentic Mode
Agentic Mode stops normal 1Password browser behavior, such as inline suggestions and save prompts, from exposing the person’s state in pages your agent controls. Turn it on every time your agent starts working in the browser, or set the browser policy so every tab starts in Agentic Mode.fillCredential fails with agenticModeNotEnabled in a tab that Agentic Mode doesn’t cover.
Turn it on for one tab when the agent starts working in that tab:
enable and disable return this envelope:
success before you continue. Turning on a tab you already control returns tab_invalid. Turning on a tab that another agent controls returns tab_unavailable.
Response envelope
Every Agentic Autofill operation takes the person’s current access token and their integration key, and resolves to an envelope rather than throwing:success before you read result or error.
createAccessRequest
Creates an access request for one to five logins. The result contains the created request and an app link that presents it to the person in 1Password.Parameters
Describe what your agent needs, not a specific 1Password item. 1Password asks the person to pick the login that satisfies each entry.Result
Opens the request in 1Password. Open it on a device that has 1Password installed. Treat it as opaque: don’t parse it, change it, or build it yourself, and don’t log it or pass it through a model.
getAccessRequestStatus to learn the outcome.
getAccessRequestStatus
Returns the request’s current state and, once it’s resolved, the logins the person granted. The call returns right away: it doesn’t wait for the person to decide. Check it only while the state ispending, on the schedule in Wait for the decision, and never after a final state.
Parameters
Result
While the person hasn’t decided:state names the outcome and resolved is empty:
pending, resolved, denied, failed, or expired. Every state except pending is final: stop checking once you see one, and treat a state you don’t recognize as final. expired isn’t returned yet. 1Password is adding it for requests nobody decides on, so handle it now. See States.entryId, never by position or type:
fillCredential
Fills and submits one granted login in a browser tab. Call it on the page with the username and password fields, not an earlier page that only asks the person to choose a sign-in method. Agentic Mode must cover the tab.Parameters
The current OAuth access token for the person’s connection. Refresh it before you fill: an expired token is reported as
fillFailed.The credential reference from a resolved request,
grant.reference. That’s the same whether you checked the request with the extension or the SDK.The Chrome tab ID of the tab to fill, from
chrome.tabs.query. A CDP target ID doesn’t work.Result
fill_submitted: 1Password filled the login and submitted the form. It doesn’t guarantee that the website accepted the login or finished signing in. Check the page before the agent continues.fillFailed and autosubmitFailed, 1Password clears what it filled. See When autosubmit fails for what that does to the page.
When autosubmit fails
After 1Password fills and submits the form, it waits for the credentials to leave the page. This happens when a new top-level page loads, or every field 1Password filled is removed from the page, which is common in single-page apps. A field that’s hidden but still on the page doesn’t count as removed. If the sign-in has another page to fill, such as a password page after a username page, 1Password keeps waiting through that page.fillCredential returns fill_submitted only after the whole sign-in completes. If the login has a one-time password but the site doesn’t ask for one, fillCredential returns autosubmitFailed about 10 seconds after the next page loads, even if the sign-in worked.
A failed submit doesn’t fire an event, so 1Password uses a timeout. If neither signal arrives within 10 seconds, it treats the submit as failed and:
- Clears only the fields it filled, in every frame of the tab and in any pop-up windows that belong to the same sign-in, including fields that are now hidden. If the person or the agent edited one of those fields, that edit is cleared too. Fields 1Password didn’t fill aren’t touched.
- Clears each field the same way it was filled: 1Password focuses the field, sets the value to empty, fires
inputandchangeevents, then moves focus away. The 1Password highlight is removed. - Forgets the login’s secret and ends the fill, so later pages in that sign-in aren’t filled.
- Returns
autosubmitFailed.
- The page isn’t reloaded or navigated. The form stays where it was, with the filled fields now empty.
- The site may show validation messages, such as “required”, on the cleared fields. No cleared field keeps focus.
- Values aren’t restored. For example, a username the site filled in before 1Password did ends up empty.
autosubmitFailedmeans 1Password saw no progress for 10 seconds. No new page loaded and the filled fields stayed on the page, or a one-time password page that 1Password expected never appeared.