Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ does not reconstruct observations for intervals that were missed.

## If manual refresh works, should automatic refresh also work?

Usually for browser-session providers other than Kimi, as long as their
Usually for browser-session providers other than Kimi and Grok, as long as their
permission and session remain valid, and for API-key providers while the saved
key and host permission remain active.
However, manual refresh bypasses scheduled backoff, while automatic refresh
Expand All @@ -49,7 +49,11 @@ recovery. Cursor manual refresh may additionally request Grok Bot and
extra-credit JSON through an already-open Cursor page, or by briefly opening
one inactive spending tab when none is open; automatic refresh never opens or
injects into a page. Scheduled refresh keeps last-good page values until Grok
Bot's weekly reset and explains when they could not be refreshed.
Bot's weekly reset and explains when they could not be refreshed. Grok
Connect or manual Refresh read grok.com from a page because extension-background
requests are rejected; they prefer an already-open grok.com tab and may briefly
open one inactive tab if none is open. Scheduled Grok refresh may inject into
an already-open grok.com tab and never opens a new one.

Kimi has an additional limitation described below.

Expand All @@ -70,6 +74,18 @@ or injects into a Cursor page. Last-good Grok Bot and extra-credit values stay
on the card until Grok Bot's weekly reset; the card says why they could not be
refreshed.

## Why does Grok need a grok.com page?

Grok's session and usage endpoints reject extension-background requests when
the Origin is not `https://grok.com`. AI Limits therefore reads them only by
running bundled exact-origin code in a grok.com page. Connect or manual Refresh
prefer an already-open tab. If none is open, they may briefly create one
inactive `https://grok.com/` tab, wait up to 10 seconds, and close only the tab
they created. Scheduled refresh may inject into an already-open grok.com tab
and never opens a new one. The function does not inspect rendered content,
browser storage, or cookie values directly; Chrome attaches the signed-in Grok
cookies to those same-origin requests.

## Why doesn't Kimi automatic refresh always work, and why can manual refresh open a background tab?

Kimi automatic refresh is best-effort and may not always work; a manual Connect
Expand Down
17 changes: 15 additions & 2 deletions FAQ.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ Chrome 完全关闭或设备休眠时,AI Limits 无法刷新。恢复运行后

## 手动刷新成功后,自动刷新也一定能成功吗?

除 Kimi 外的浏览器会话服务只要权限和会话仍然有效,通常可以;API 密钥服务
除 Kimi 和 Grok 外的浏览器会话服务只要权限和会话仍然有效,通常可以;API 密钥服务
只要保存的密钥和主机权限仍处于有效状态,通常也可以。但手动刷新可以绕过
定时退避,自动刷新则会遵守退避时间。Kimi 手动刷新还可能执行交互式会话
恢复。Cursor 手动刷新还可能通过已经打开的 Cursor 页面请求 Grok Bot 和额外
Credits JSON;如果当前没有打开的标签页,可能会短暂打开一个非活动用量页。自动
刷新绝不会打开标签页或向页面注入代码。定时刷新会保留上次有效的页面数值,
直到 Grok Bot 的每周重置,并说明为何未能刷新。
直到 Grok Bot 的每周重置,并说明为何未能刷新。Grok 的 Connect 或手动 Refresh
会从 grok.com 页面读取用量,因为扩展后台请求会被拒绝;它们会优先使用已经
打开的 grok.com 标签页,如果没有则可能短暂打开一个非活动标签页。Grok
定时刷新可能向已经打开的 grok.com 标签页注入代码,但绝不会新建标签页。

Kimi 还有下述额外限制。

Expand All @@ -60,6 +63,16 @@ Limits 只会在 Connect 或明确的手动 Refresh 期间尝试请求。它会
上次有效的 Grok Bot 和额外 Credits 会保留在卡片上,直到 Grok Bot 的每周
重置;卡片会说明为何未能刷新。

## 为什么 Grok 需要 grok.com 页面?

Grok 的会话和用量接口会拒绝 Origin 不是 `https://grok.com` 的扩展后台请求。
因此 AI Limits 只会在 grok.com 页面中运行捆绑的精确来源代码来读取这些接口。
Connect 或手动 Refresh 会优先使用已经打开的标签页;如果当前没有打开的标签页,
可能会短暂创建一个非活动的 `https://grok.com/` 标签页,最多等待 10 秒,并且
只关闭它自己创建的标签页。定时刷新可能向已经打开的 grok.com 标签页注入代码,
但绝不会新建标签页。该函数不会直接检查页面渲染内容、浏览器存储或 Cookie 值;
Chrome 会把已登录的 Grok Cookie 附加到这些同源请求。

## 为什么 Kimi 自动刷新不一定成功,而手动刷新可能打开后台标签页?

Kimi 自动刷新属于尽力而为,并不保证每次都能成功;手动 Connect 或 Refresh
Expand Down
41 changes: 34 additions & 7 deletions PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Last updated: August 26, 2026

AI Limits is a locally running Chrome extension by TiantianFlow. This policy
describes version 0.4.3.
describes version 0.4.4.

AI Limits is an independent project. It is not affiliated with, endorsed by,
or authorized by any supported provider, its parent company, or its affiliates.
Expand Down Expand Up @@ -52,9 +52,10 @@ data, or other relay keys.
ChatGPT, Claude, Kimi, Cursor, Grok, Mistral, and Perplexity use signed-in
browser sessions. AI Limits sends read-only requests to those providers' own
web-session services, and browser cookies may accompany requests to the same
provider origin. Requests normally run directly from the extension; the manual
Cursor enrichment described below runs in an already-open exact-origin page or,
if none is open, in one inactive spending tab created for that attempt. ChatGPT
provider origin. Requests normally run directly from the extension; the Cursor
and Grok page-origin reads described below run in an already-open exact-origin
page or, if none is open during Connect or manual Refresh, in one inactive tab
created for that attempt. ChatGPT
and Kimi access credentials, the derived ChatGPT account identifier, and the
selected Claude organization UUID and capabilities may be held in memory long
enough to complete the related collection attempt and request sequence. Those
Expand All @@ -79,6 +80,31 @@ background worker is interrupted. AI Limits attempts to remove it when
recovery finishes and also performs best-effort abandoned-lease cleanup when
the background worker starts.

For Grok, grok.com rejects extension-background session and usage requests
when the Origin is not `https://grok.com`. AI Limits therefore does not fetch
grok.com from the extension worker. It checks for one already-open tab matching
`https://grok.com/*` and uses the optional `scripting` permission to run a
bundled function in that page's main JavaScript world. During Connect or an
explicit manual Refresh only, if none exists, the same path may create one
inactive `https://grok.com/` tab. That create-wait-read path has a 10-second
deadline. When it finishes or times out, the extension attempts best-effort
cleanup of only the tab and lease it owns; browser shutdown or API errors can
delay or prevent cleanup. The function verifies the exact `https://grok.com`
origin, sends the signed-in session, usage-pool, subscription, and chat-mode
rate-limit requests, and returns only those responses for schema validation in
the extension context. It does not read rendered page content, local or session
storage, or cookie values directly. Chrome does attach the signed-in Grok
cookies to these fixed same-origin requests. AI Limits never activates a Grok
tab. Scheduled refresh may inject into an already-open grok.com tab and never
opens a new one. Raw page-probe bodies are request-local and are not persisted.

While that owned Grok tab is active, the extension stores only a generated lease
identifier with the temporary tab ID and creation timestamp in
`chrome.storage.session`. This transient metadata supports cleanup if the
background worker is interrupted. AI Limits attempts to remove it when the
owned tab is released and also performs best-effort abandoned-lease cleanup
when the background worker starts.

For Cursor, the base monthly and on-demand request runs from the extension.
During Connect or an explicit manual Refresh only, AI Limits checks for one
already-open tab matching `https://cursor.com/*`. If one exists, it uses the
Expand Down Expand Up @@ -108,9 +134,10 @@ owned tab is released and also performs best-effort abandoned-lease cleanup
when the background worker starts.

For conservative Chrome Web Store disclosure, AI Limits classifies its
current-tab exact-provider-origin checks as **Web history** access. For Kimi and
Cursor, the extension learns only whether a tab at that fixed provider origin
is currently open so it can complete the user-requested provider operation.
current-tab exact-provider-origin checks as **Web history** access. For Kimi,
Cursor, and Grok, the extension learns only whether a tab at that fixed
provider origin is currently open so it can complete the user-requested
provider operation.
This open-state result is used locally for that attempt and is never retained,
transmitted, or assembled into a list of visited pages.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ is asked only for the exact instance origin entered in onboarding. Same-origin
instances share that browser-global grant only; their credentials, labels,
usage, and History remain independent. The optional
`cookies` is requested only for Kimi session access. `scripting` is requested
for Kimi interactive recovery and for Cursor's manual/connect-only page
enrichment. Fixed API-key providers receive only optional access to their own
for Kimi interactive recovery, Cursor's manual/connect-only page enrichment,
and Grok page-origin session and usage reads. Fixed API-key providers receive only optional access to their own
API origins. Public setup pages are opened normally and do not receive
extension host access. The extension does not request the broad `tabs`
permission.
Expand Down Expand Up @@ -174,7 +174,7 @@ pnpm verify:zip
```

The command rebuilds the extension, creates
`.output/ai-limits-0.4.3-chrome.zip`, opens the archive, and verifies its
`.output/ai-limits-0.4.4-chrome.zip`, opens the archive, and verifies its
manifest, entrypoints, permissions, and forbidden-file rules.

## Provider compatibility
Expand Down
7 changes: 4 additions & 3 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ API 密钥连接时才会逐个请求。New API、LiteLLM、ClawRouter、sub2api
LLM Proxy 因来源可配置而声明动态可选主机能力,但 Chrome 实际只会请求设置中
输入的那个实例来源。同一来源的多个实例只共享这一浏览器全局授权;凭据、标签、
用量和 History 始终相互独立。可选的
`cookies` 权限只用于 Kimi 会话访问。`scripting` 权限用于 Kimi 交互式恢复,
以及 Cursor 仅在 Connect 或手动刷新期间执行的页面增强。固定 API 密钥服务只会
`cookies` 权限只用于 Kimi 会话访问。`scripting` 权限用于 Kimi 交互式恢复、
Cursor 仅在 Connect 或手动刷新期间执行的页面增强,以及 Grok 在 grok.com
页面中读取会话和用量。固定 API 密钥服务只会
获得各自 API 来源的可选访问权限;公开设置页面按普通网页打开,不会获得扩展
主机访问权限。扩展不会请求范围更广的 `tabs` 权限。

Expand Down Expand Up @@ -143,7 +144,7 @@ macOS 文件选择器中正常显示。点击扩展工具栏图标即可打开
pnpm verify:zip
```

该命令会重新构建扩展,创建 `.output/ai-limits-0.4.3-chrome.zip`,打开压缩包,
该命令会重新构建扩展,创建 `.output/ai-limits-0.4.4-chrome.zip`,打开压缩包,
并验证清单、入口文件、权限和禁止包含的文件规则。

## 服务兼容性
Expand Down
13 changes: 13 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ values directly. Chrome attaches signed-in Cursor cookies to those same-origin
requests. Scheduled refresh never injects into a Cursor page, and no raw
dashboard JSON is persisted.

Grok collection may use `chrome.scripting` to run a bundled function in the
main JavaScript world of one already-open exact-origin grok.com page, or, on
Connect or manual Refresh only, of one inactive grok.com tab created for that
attempt. The returned session, usage-pool, subscription, and rate-limit
payloads are treated as untrusted and must pass the same extension-context
schemas and semantic validation as any provider response. The function
verifies `https://grok.com`, does not inspect rendered content, browser
storage, or cookie values directly, and never falls back to an
extension-background grok.com fetch. Chrome attaches signed-in Grok cookies to
those same-origin requests. Scheduled refresh may inject into an already-open
grok.com tab and never opens a new one. No raw page-probe bodies are
persisted.

Chrome's trusted extension contexts include the background worker and the side
panel. The side-panel code does not request or read the credential record, but
Chrome storage change events can expose local change objects to trusted
Expand Down
2 changes: 1 addition & 1 deletion SUPPORTED_PROVIDERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Balance presentation is explicit by provider:
| Claude | Signed-in browser session | General and model-specific limits plus extra usage when reported | **OBSERVED** | Uses private web-session interfaces. Organization selection is request-local; a provider-supplied display label may be retained. |
| Kimi | Browser session with targeted credential recovery | Subscription total and Kimi Code limits | **OBSERVED** | May read the exact legacy `kimi-auth` cookie or `localStorage.access_token`. Manual Connect or Refresh may briefly open one inactive Kimi tab so Kimi can refresh its own session. Automatic refresh never opens a tab and may defer when no usable session is available. |
| Cursor | Signed-in browser session plus manual page enrichment | Cursor-model and other-model monthly limits, Grok Bot weekly usage, and on-demand/extra-credit data when reported | **OBSERVED** | Base usage refreshes in the background. Connect or manual Refresh can request Grok Bot and extra-credit JSON through one already-open `cursor.com` tab, or by briefly opening one inactive spending tab when none is open. Chrome attaches signed-in Cursor cookies to those fixed same-origin requests, but AI Limits does not inspect cookie values directly. It never activates a Cursor tab and closes only the tab it created. Automatic refresh never opens or injects. Last-good page values stay visible until Grok Bot's weekly reset, and the card explains when they could not be refreshed. |
| Grok | Signed-in browser session | Weekly or monthly usage pool as the subscription limit, with Grok Build and Chat composition when those buckets account for the whole pool, plus the SuperGrok-family plan label | **OBSERVED** | Uses private web-session usage interfaces on `grok.com`. Short-window per-mode rate-limit responses are not rendered. The browser may attach Grok cookies; account identifiers and raw subscription payloads are not persisted. This is consumer Grok, not Cursor's Grok Bot. |
| Grok | Signed-in browser session plus page-origin reads | Weekly or monthly usage pool as the subscription limit, with Grok Build and Chat composition when those buckets account for the whole pool, plus the SuperGrok-family plan label | **OBSERVED** | grok.com rejects extension-background session and usage requests, so AI Limits reads them from an already-open grok.com tab. Connect or manual Refresh may briefly open one inactive grok.com tab when none is open. Chrome attaches signed-in Grok cookies to those same-origin requests, but AI Limits does not inspect cookie values directly. It never activates a Grok tab and closes only the tab it created. Scheduled refresh may inject into an already-open grok.com tab and never opens a new one. Short-window per-mode rate-limit responses are not rendered for SuperGrok pool accounts. This is consumer Grok, not Cursor's Grok Bot. |
| Mistral | Signed-in browser session | Month-to-date spend, token totals, and available credits | **INFERRED** | Chrome attaches same-origin cookies, but cannot expose the CSRF cookie value needed to construct `X-CSRFTOKEN`; live testing must confirm the service accepts the request without that header. |
| Perplexity | Signed-in browser session | Recurring, purchased, and promotional credit pools plus plan inference | **INFERRED** | Uses a private billing endpoint and Chrome-attached same-origin cookies. Grant expiry and waterfall attribution follow the inferred wire contract. |
| ElevenLabs | User-created API key | Subscription credit and voice-capacity limits | **OBSERVED** | The guide recommends **User → Read**. AI Limits calls the documented subscription endpoint and stores the validated key locally; no browser session is reused. |
Expand Down
Loading
Loading