This document summarizes what Pi for Excel stores, where data flows, and key trust boundaries.
- Excel taskpane app in Office webviews (WKWebView/WebView2/browser)
- Hosted static build + optional local helper services (CORS proxy, tmux bridge, Python bridge)
- Credential flows (API keys + browser OAuth)
- Extension runtime model (host vs sandbox)
- Provider API keys (IndexedDB
ProviderKeysStore) - OAuth credentials (IndexedDB settings
oauth.<provider>) - Workbook contents read by tools
- Conversation/session history (IndexedDB)
- API keys: IndexedDB store via pi-web-ui storage backend
- OAuth credentials: IndexedDB settings (
oauth.<provider>) - Sessions/settings: IndexedDB
/logincan add/replace/disconnect providers- Disconnect removes provider key and OAuth credentials for that provider
/settingsincludes API key + proxy configuration
Taskpane communicates with:
- Office JS CDN (
appsforoffice.microsoft.com) - configured model/OAuth providers
- optional local HTTPS proxy (
https://localhost:<port>) - optional local bridge services (tmux / Python)
Hosted taskpane is protected with CSP in vercel.json (scripts/styles/fonts/connect constrained to required endpoints).
- Taskpane webview (untrusted workbook/model text can enter UI)
- Local helper services (proxy/bridges are separate trust boundaries)
- Remote providers (LLM + OAuth endpoints)
- Extension runtime boundary (host runtime vs sandbox iframe runtime)
- Marked safety patch blocks unsafe link protocols
- Markdown images are rendered as links (no automatic
<img>fetch) - Dynamic HTML sinks use escaping helpers where needed
- CSP reduces script/connect exfil paths
- OAuth credentials are stored in IndexedDB settings (no legacy localStorage fallback)
- No intentional token logging in auth restore/proxy paths
- Provider disconnect clears both API key and OAuth credentials
- Loopback client requirement
- Allowed-origin CORS allowlist
- Strict target filtering/allowlists for proxy traffic
- Optional bearer-token auth on tmux/python bridge POST endpoints
- Bounded payload sizes + execution timeouts in helper servers
- Remote
http(s)extension URLs are blocked by default (/experimental on remote-extension-urlsrequired) - Untrusted extension sources (inline code + remote URL) run in sandbox iframe runtime by default
- Rollback kill switch exists for maintainers (
/experimental on extension-sandbox-rollback) and should be temporary only - Capability permissions are persisted per extension (
extensions.registry.v2) - Capability enforcement is feature-flagged via
/experimental on extension-permissions
- IndexedDB is not an XSS boundary; same-origin script execution can read stored credentials.
- Built-in/local-module extensions are trusted and run in host runtime.
- Capability policy enforcement is opt-in (
extension-permissionsflag) in current rollout. - Sandbox runtime intentionally limits API surface (for example, no raw
api.agentin sandbox). - Host-specific CSP behavior still needs smoke testing across Excel macOS/Windows/Web.
- Tool-argument schema validation is intentionally disabled in Office builds (Ajv uses runtime code generation blocked by Office CSP, so the browser build aliases Ajv to stubs).
- Prefer localhost HTTPS proxy only; remote proxies can observe prompts/tokens.
- Keep dependencies updated (CI + Dependabot + audit checks).
- When adding new outbound endpoints, update CSP + proxy/docs/tests in the same PR.