Security model
What a site sees, the guards on every conversation, the web accounts used without the extension, what AI Wallet holds and where, how the vault is encrypted and locked, how sites are approved and revoked, and which browser permissions the wallet uses.
AI Wallet keeps the visitor's AI accounts on their computer and answers the sites they approve. This page describes what each party receives and how the wallet protects what it holds, as the code of this release does it.
What a site sees
A site talks to the wallet through four methods: status, connect, disconnect and chat. The wallet protocol describes them. Through them a site receives:
- whether its origin may use the visitor's AI;
- the display name of the account that answers it, such as
ChatGPT, orAuto, and that account's default model; - the text of each answer as it streams, and the answer with its tool calls, its finish reason, the model that answered and the token counts the provider reported;
- a link notice when the visitor changes the account of the site or switches the site off.
AiConnect.fetch, which lets a site's AI SDK answer through the wallet, uses the same chat method and gives the site nothing more. It sends no request to the network: the address the SDK targets is never called, and the API key the SDK requires is the placeholder aiwallet, which the wallet never reads.
A site has no method to read the visitor's credentials, the list of accounts in the wallet, the other approved sites, the room each account has left, or another site's conversations.
Any page can see that AI Wallet is installed, since the wallet places window.aiwallet in every page it serves. Any page can call status, which answers connected: false for an origin the visitor has not approved, and connect, which opens the approval window.
Who else sees the conversation
- The provider of the account that answers, since the model runs on that account. The wallet sends it the messages and tool definitions the site sent, with the visitor's credential.
- Your MCP server, which receives the arguments of each tool call. The SDK calls it from the visitor's page.
- Your page, which builds the conversation and receives the answers.
Web accounts, without the extension
A visitor without AI Wallet can sign in with OpenRouter, or with the TensorPass plan on a site that passes a site key, as the web accounts page describes. That path trusts the site more than the wallet path does:
| Question | AI Wallet | Web account |
|---|---|---|
| Where the credential lives | The wallet's sealed vault, in the extension's storage | The localStorage of the site's origin |
| Who can read it | The wallet's background only | The site's page and every script it loads |
| Who calls the provider | The wallet's background | The site's page |
| What the site learns of the account | Its display name and default model | Its display name, its model and its credential |
The sign in runs in a popup the page opens from the visitor's click, with a PKCE challenge (S256) and a random state the page checks on the way back. The popup hands the code to the page that opened it in a message limited to that page's own origin, and closes itself. A page that receives a code it did not ask for, or a state it did not draw, drops it.
TensorPass binds what it issues to a site:
- The sign in opens only for a site key TensorPass issued, and returns only to an address on the key's domain, or on
http://localhostandhttp://127.0.0.1. The consent step names that origin as the browser reports it. - The code is traded for tokens only from the same origin, checked on the
Originheader the browser sets, which a page cannot change. - The plan token has the scope
chatand lasts 15 minutes. TensorPass accepts it on the chat and model list routes only, from the origin it was issued to. The billing, subscription and account routes refuse it. - The answers count against the visitor's own plan budget, as answers through the wallet do. The gateway limits the requests of each token and of each site key in a minute and at the same moment, and answers a call past them with status 429 and a
Retry-Afterheader. A visitor's normal use stays well under those limits. - A refresh token works once, as for the wallet: a second use of the same token ends the sign in. A sign in left unused for 30 days ends.
- Revoking the site key stops its sign ins and every token issued through it at once.
An OpenRouter key is bound to the visitor's credits and to nothing else. It works from any origin and any server until the visitor deletes it on their OpenRouter keys page. A site that offers it loads only scripts it trusts on the pages of its chat. Sign out removes the key from the site.
Guards on the conversation
The modules, the Web Components and useAiChat guard every conversation in the visitor's page, with no setup. The guards page describes each check:
- A random salt drawn for each conversation closes an envelope around the site's instructions and around every tool result, so text planted in a site's data reaches the model as data.
- A question that tries to replace the instructions, asks for them or holds a long base64 blob stops before it reaches the model, in English, French and Hebrew.
- An answer stops at its first piece that repeats the instructions or the salt, draws an image, links outside the hosts the site allows, gives an email address nobody provided, or names something the site keeps internal, and the site's safe answer shows in its place.
The guards run in the visitor's page, where the visitor can read the page's code, the instructions and every tool result. They protect the visitor and the site from planted text and from what the model writes, and the instructions and tool results hold public facts only. The names a site keeps private, such as its internal services and hosts, stay in a policy that only its server reads. Anyone can call a site's MCP server without the page, so the server checks each result before it returns it, bounds every input, caps each result and limits each address.
The chat on tensorpass.app's home page runs this way. Its docs MCP server takes 60 requests a minute from each address and bodies up to 16 KB, keeps every result under 20,000 bytes by serving long pages in parts, and checks every result against its server's policy. The pen test of the aiconnect-hardening Agent Skill runs its attacks against those guards and that server on every change, in the site's tests.
What the wallet holds
The wallet keeps its data in Chrome's extension storage. Local storage persists on disk. Session storage lives in memory and is cleared when the browser closes or the extension reloads. Both are closed to content scripts: Chrome keeps session storage to the extension's own pages, and the wallet sets local storage to the same level each time its background starts, which needs Chrome 140 or later. No wallet unlocks until Chrome has applied it, so a page that took over its renderer cannot read the sealed vaults or the sealed recovery words, or rewrite the preferences.
| Data | Storage | Protection |
|---|---|---|
| The vault of each wallet: each connected account with its credential and default model, the approved sites with the account and model of each, the default account | Local | Sealed with that wallet's vault key |
| The recovery phrase of each wallet | Local | Sealed with a key derived from the password |
| The list of wallets: when each was created, whether its recovery words were saved, and which one is in use | Local | Plain |
| The vault key of each wallet the password opened, while the wallet is unlocked | Session | Held by Chrome in memory, out of reach of content scripts |
| A sign in in progress: the provider, the code to confirm, and the login's own secret such as a PKCE verifier or a device code | Session | Removed when the sign in finishes or is cancelled |
| Preferences: language, theme, lock delay, thinking effort, what each site may use | Local | Plain |
| The tokens each site used today | Local | Plain |
| The usage ledger of each wallet: for each day, site, account and model, the number of calls answered, the input and output tokens the provider reported and the time the answers took. It holds no question and no answer, and a day leaves it after 90 days | Local | Sealed with that wallet's vault key |
| The room each account has left, by account | Local | Plain |
| Each account's model list, kept for a day | Local | Plain |
| The answers in progress (site and account), the account Auto last used for each site, and when each site started its chats of the last minute | Session | Plain |
Credentials are stored in the vault only. The background reads them to call the provider they belong to, for answers, model lists and token renewal.
Vault encryption
The wallet works like a crypto wallet: a recovery phrase is the root of the vault key, and a password protects the phrase for daily use.
- Recovery phrase. A new wallet creates a 12 word BIP39 phrase from 128 bits of randomness, with the English word list. The visitor sets a password only; the phrase waits in Settings.
- Vault key. The wallet turns the phrase into its BIP39 seed, then derives 32 bytes with
HKDFoverSHA-256, a salt of 32 zero bytes and the info stringaiwallet vault key v1. - Vault. The vault's contents are serialized as JSON and encrypted with
AES-GCMunder the vault key, with a new random 12 byte nonce on every write.AES-GCMauthenticates what it decrypts, so decryption with a wrong key throws an error. - Password seal. The phrase is encrypted with
AES-GCMunder a key derived from the password withPBKDF2,SHA-256, 600,000 iterations and a random 16 byte salt. A password needs at least 8 characters. - Unlock. The password opens the phrase of every wallet it seals, each phrase gives its vault key, and the wallet keeps those keys in
chrome.storage.session. Chrome holds that storage in memory, clears it when the browser closes, and does not expose it to content scripts. - Automatic lock. An alarm locks the wallet once the delay the visitor chose in Settings has passed since they last acted in one of the wallet's own pages, or since an approved site's chat was last answered: 5, 15 or 30 minutes, 1 hour or 4 hours, with 30 minutes by default. A page that only asks the wallet for its state leaves the alarm where it is, and so does a chat the wallet refuses. An alarm that rings during an answer waits the delay again. Locking removes the vault keys from session storage and stops the answers in progress, and the background keeps no decrypted vault in its memory after it.
Password and recovery words
- Settings shows the 12 words after the visitor types the password. Once an account is connected, the wallet reminds the visitor to save them until they confirm.
- Changing the password seals the same phrase under the new password. The vault key does not change.
- Changing the password seals every phrase it opened under the new password.
- Restoring from the words brings the wallet of that phrase into use. In a browser that still holds its sealed vault, the phrase opens it and the accounts come back. Each sealed vault lives in this browser's extension storage only, so a restore in another browser starts with an empty vault.
- The lock screen offers the restore for a forgotten password: the wallet restored takes the new password the visitor chooses. The other wallets keep the earlier password until each is restored from its own words.
Several wallets
- A browser keeps several wallets, each on its own 12 words, with its own accounts and approved sites. One password opens them all.
- Settings adds a wallet, new or restored from its words, sealed with the password in use, and moves from one wallet to another.
- Words this browser has never held open a new empty wallet beside the others. A wallet's vault opens with the key of its own phrase only, so the others stay as they were.
- A move to another wallet stops the answers in progress, and the open pages of the sites of the wallet left behind receive a link notice of what the wallet answers them with now.
Site approval and revocation
- First connection. A site's first
connectopens the approval window, when the page asks right after the visitor clicked or typed in it; a page asking at any other moment gets no window, so it cannot choose when the window takes the visitor's keys. A locked wallet shows its unlock form first. The window names the site by the domain that owns it, with its full host below, and shows the account that will answer it. Approve takes no input until the window has been on screen for a second, after an unlock in the window too. Approve saves the origin; Decline, or closing the window, refuses it. - Account per site. An approved site starts on the visitor's default account. The visitor can give each site another account, another model of that account, or Auto, from the side panel.
- Later visits. An approved site reads its link with
statusand connects without a prompt. While the wallet is locked,statusreports every site as not connected, andconnectorchatsent after a click opens the unlock window first, which names the site. - Visibility. The side panel lists the sites that use the visitor's AI and shows which account is answering a site at the moment, with a Stop button that cancels the answer.
- Revocation. Switch off in a site's view removes the site from the vault. A site can also remove itself with
disconnect. An answer the site was receiving stops, its open pages receive a link notice ofconnected: false, and its nextconnectasks the visitor again. - Removing an account. An answer that account was giving stops, and the sites that answered with it move to the default account that remains.
- A page that leaves. A tab that closes or navigates away stops the chats it had running.
What a site can ask
The wallet reads every message of a page before it acts on it, and keeps each site within limits a page has no way to raise. The visitor sets the first three in Settings.
| Limit | Value |
|---|---|
| Tokens one origin uses in a day, input and output together | 500,000, 2,000,000, 10,000,000 or 50,000,000, with 2,000,000 by default |
| Chats one origin starts within a minute | 30, 60 or 120, with 60 by default |
| Chats one origin runs at the same moment, over all its tabs | 2, 4 or 8, with 4 by default |
| Chats all origins together run at the same moment | 12 |
| Length of one request as JSON | 8,000,000 characters |
| Output tokens a request may ask for | 64,000 |
| Tools a chat may offer | 128 |
A chat takes its share of the origin's day before a provider is asked: the most its answer can cost as far as the wallet can tell, which is the text of the request at one token for each byte, 4,000 tokens for each image, and the output tokens it asks for, or 64,000 when it asks for none. A chat whose share does not fit what is left of the day is refused, so chats sent at the same moment cannot take the same room. When the answer ends, the tokens its provider reports replace the share. A whole answer that comes without that count is counted by the wallet: its input as the share counted it, and its output at one token for each byte the model wrote, which leaves out what a model reasons without showing it. An answer that did not reach its end keeps its share: one the page or the visitor stopped, one its provider cut, one cut when Chrome stops the wallet's background. A provider that refused the request gives the share back. On Auto, each account the wallet asks takes its own share.
An account that refuses the output setting, such as a ChatGPT plan, answers as long as its provider lets it. Its answer is counted at what the provider reports, and at its share when it is stopped before that count arrives.
A request past a limit, or one the wallet cannot read, is refused with its status before any provider is called, as the wallet provider page lists. From the moment an answer is stopped, nothing more of it reaches the page.
Origin binding
The wallet identifies a site by the origin Chrome reports for the runtime port the page's content script opens. The page's own messages carry no origin, so one site cannot act as another. Each origin, with its scheme, host and port, is approved on its own. Only pages with an http or https origin are served: a sandboxed page, whose origin is opaque, gets no answer and no window.
The wallet's own messages
The side panel, the approval window and the unlock window talk to the background with runtime messages that can unlock the vault, reveal the phrase or approve a site. The background accepts them only from the extension's own pages: it checks that the sender is this extension and that the sender's URL is one of its pages. Content scripts, whose sender is the web page they run in, and other extensions are refused.
Calls to providers
- The background service worker calls each provider directly, with the account's credential, from the extension's host permissions.
- When a call needs an access token that is about to expire, the wallet trades the account's refresh token for a new one and saves the new credential in the vault. Chats that need the same token share one renewal, and a renewal that ends after its account was removed writes nothing.
- When a provider refuses a call, the page receives the provider's status and the account's name. The provider's own error text, which can carry details of the visitor's account, stays in the wallet.
- Some providers expect headers a browser request cannot set, such as the
User-Agentof their own command line tool, and some reject requests that carry anOriginheader. The wallet sets and removes these headers through Chrome'sdeclarativeNetRequestsession rules, which apply only to requests the extension starts and reach only the provider hosts the manifest lists. - The wallet reads the usage and rate limit headers of its own provider calls to show how much room each account has left. It matches each call to its account by the credential the call carries.
- Each answered call is added to the wallet's usage ledger, which the visitor reads in Settings per day, per site and per account. The ledger stays in the browser, sealed with the wallet's vault key. An answer stopped before its end comes with no report from its provider and adds nothing.
Permissions
| Permission | What the wallet uses it for |
|---|---|
storage | The sealed vaults, the sealed phrases, the vault keys in session storage, and the preferences. |
alarms | The automatic lock. |
declarativeNetRequestWithHostAccess | Setting and removing provider headers on the wallet's own calls, on the provider hosts only. |
identity | Chrome's sign in window for logins that come back to the wallet's callback address. |
sidePanel | Opening the wallet in Chrome's side panel from the toolbar button. |
webRequest | Reading the usage and rate limit headers of the wallet's own provider calls. |
system.display | Reading the size and work area of the visitor's screens, to open the wallet's window at the top right of the screen that holds the site's browser window and a provider's sign in window beside it. The wallet stores none of it. |
The host permissions list the sign in and API hosts of the supported providers, written into the manifest at each build from what the account connectors declare they call, and the two local addresses, http://localhost and http://127.0.0.1, that a provider's sign in comes back to. The content scripts that place window.aiwallet run on every HTTPS page, and on http://localhost and http://127.0.0.1, so any site can offer the wallet to its visitors.
At install, Chrome announces the access to sites that those content scripts need, and nothing else. The wallet holds no tabs permission, so Chrome gives it no tab's address. To show the site of the current tab in the side panel, the background asks the content script in that tab to say it is there, and reads the origin from the sender Chrome names for the answer. To tell open pages that their link changed, it sends every tab a message that names no site, and a page that uses the wallet asks again on its own port.
Reporting a vulnerability
Write to [email protected] to report a vulnerability in AI Wallet, in the SDK packages or in this website. Send it in private: a public issue or pull request shows the problem to everyone before a fix exists. A useful report names the version or the commit you tested, what an attacker can do and from which position (a web page, an approved site, a model's answer, a tool's result or another extension), and the steps that reproduce it. Behaviour this page describes as intended is by design, and a report that the design itself is wrong is welcome. The address is listed in security.txt, as RFC 9116 defines it.
Wallet provider
The window.aiwallet provider that AI Wallet places in every page, its discovery events, its four methods, the events a chat streams, errors with their statuses and link notices, written so another wallet or SDK can implement it.
Providers
Every AI account AI Wallet supports, how the visitor connects it and who pays, and how model choice, the room meter and Auto routing work.