AI agent instructions
AI agent instructions
Agentic Autofill
With 1Password Agentic Autofill, your agent asks for access to a login, a person approves it in 1Password, and the 1Password browser extension fills and submits the login form in the Notte session. Notte keeps only opaque references to the approved logins.Agentic Autofill is in partner preview. Its routes are not in the API reference or the Notte SDKs yet, so the examples below call the HTTP API directly.
Before you start
- A 1Password Business account whose administrator allows AI agents to autofill. See 1Password for agents security.
- Connect 1Password in the Notte console: Settings > Integrations > 1Password > Connect, then sign in to 1Password. The connection belongs to you, not to your workspace.
- A Notte API key of yours, set as
NOTTE_API_KEY. The routes use the 1Password connection of the person who owns the key.
How it works
- Start a session with
"onepassword": true. It starts in theauthenticatingstate: CDP, page actions and live viewers are refused until you release it. - Create an access request for up to 5 websites. The response holds an
app_link. Send it to the person, who opens it on the device where 1Password runs. Never put it in a model’s context. - Poll the access request until it is no longer
pending. Onceresolved, it lists one grant per approved login. - Call
fillwith a grant and the login page URL. The extension fills the username and password and submits the form. For a login that spans several pages, callfillon each page. - Release the session. Fills stop, every page reloads, and the session opens to your code, CDP and viewers like any other session.
Routes
All routes take your API key as a bearer token.
Each entry of an access request takes:
website: the site’s HTTPS URL. A bare host such asgithub.comis read ashttps://github.com.reason(optional): up to 100 characters, sent to 1Password with the request.keywords(optional): up to 5 words of up to 50 characters each, sent to 1Password with the request.
pending is final, and only resolved returns grants. A grant has an id, its website and granted_at.
Filling. With url, the session opens that page first; without it, the fill runs on the current page. The page must be on the grant’s website, or the fill fails with origin_mismatch. status is 1Password’s result: fill_submitted means the form was submitted, not that the site accepted the login. Check the returned url (without its query string or fragment) to see where the site sent you, then call fill again if it shows another login step.
Releasing. If a fill is still running, release answers 409 with onepassword_fill_in_progress; call it again. After release, fill is refused with onepassword_session_released. To sign in again, start a new session.
Reusing grants
A grant stays valid for 30 days. Save itsid, and in a later session started with "onepassword": true, call fill with it directly, without a new access request. If fill answers onepassword_grant_invalid, create a new access request.
Why the session is locked until release
While 1Password fills a form, the username and password are in the page until the form is submitted. Any script attached to the browser over CDP could read them. So a session withonepassword: true runs no customer code at all until you release it: no CDP, no page actions, no viewers. Release reloads every page, since a form submitted by script can keep the password in the page, and the browser refuses fills from then on. Request bodies are left out of the session’s network logs before a fill, and session replay is off for these sessions.
After release, your code gets the signed-in browser, including its cookies. The integration protects the password, not the login session it produces.
Limits
A session withonepassword: true cannot also use:
- a secret proxy, whose certificate authority could read the login request
- Demonstrate (
demonstrate) auth_ids- an external
cdp_url - the routes that create a session and connect to it in one call
onepassword_needs_reauth. Connect 1Password again under Settings > Integrations.
1Password SDK with a service account
Use the 1Password SDK to read login fields and fill them in a Notte browser. The values pass through your code. The Python and TypeScript examples submit a test form without printing the field values.Set up
Create a 1Password service account with read access to a test vault containing a dummy Login item. SetOP_SERVICE_ACCOUNT_TOKEN, OP_USERNAME_REF, and OP_PASSWORD_REF. Field references use op://vault/item/field; see 1Password’s reference syntax.
Set NOTTE_API_KEY from Notte, then clone the Notte repository and open examples/onepassword. Its README includes the installation commands.
- Python
- TypeScript
Use Python 3.11+ and uv. Run
uv sync --locked, then uv run python python/demo.py.Use your login page
The example fills and submits an in-memory test form. Reuse itsfill_login or fillLogin helper on your page and adapt the labeled field and button locators. It resolves only the two supplied references.
Each attempt owns its Notte browser and closes it after success or failure. The result includes the session ID and submission status.
In a Notte Function
The 1Password SDK (onepassword) is installed in the Functions runtime, so a scheduled Function can sign in with no person present:
- Store the service account token as a Function Secret named
OP_SERVICE_ACCOUNT_TOKEN, in the console under Settings > Function Secrets. Every run receives it as an environment variable. - Upload the Function with the code check relaxed (
restricted=False), since reading environment variables needsos.
merchant_login.py