Skip to content

Latest commit

 

History

History
209 lines (180 loc) · 68.3 KB

security.md

File metadata and controls

209 lines (180 loc) · 68.3 KB

Security: what is enforced, what is a convention, what is on you

The loudest objections to hosted always-on agents were about custody: an agent that never sleeps, holding your credentials, on someone else's cloud. Self-hosting answers the custody question. It does not answer prompt injection — that follows an agent wherever it runs. This page is precise about which is which.

Enforced by the gateway (in code, covered by tests)

Boundary How it holds
Only you can drive the gateway Every API call, the live stream, screenshots and screens need the gateway token — a random secret in gateway/data/auth-token (mode 0600). A browser signs in once through the link printed at startup and keeps an HttpOnly, SameSite=Strict cookie; scripts send Authorization: Bearer <token>.
Other websites cannot act as you Anything that changes state, and the WebSocket, must come from the gateway's own origin (or the UI's, OPENSUPERBOT_WEB_URL), and requests with a body must be JSON — which no other page can send without a preflight the gateway never answers. A page you happen to visit cannot approve a hold, post into a thread or read the stream.
Your network cannot reach it The gateway listens on 127.0.0.1 unless you set OPENSUPERBOT_HOST.
A bot cannot approve its own holds The token never enters a bot's workspace. A bot's shell or browser can reach the host, but cannot authenticate.
Only you can grant a standing approval A rule is created only when you approve a hold with Always allow… from your signed-in browser. Its scope is fixed by the gateway: one teammate, one kind, one exact destination, with an expiry you pick. The destination must have the shape of one place — one email address, one channel or handle, one account, page or thread; wildcards, lists, "everyone" and whole services are refused, and so is anything over 200 characters. Destinations are compared whole: case is ignored except in a URL's path. Purchases, bookings and "other" (including every MCP write) can never become rules. Bots have no tool to create, widen or extend one; you revoke them from the computer panel.
Rules only cover work you started A rule lets a hold through only in a turn you started — your message, your decision, your answer, your question to the group — and only while the turn has not seen untrusted external content (outside-data): no webhook payload or tainted teammate handoff (bot_ref) in the teammate's view, and no browser page read (browser_goto, browser_extract, browser_click, browser_back, browser_screenshot), connector read, MCP read, or tainted shared wiki search/read (wiki_search / wiki_read) in that turn. Turns started by a routine, a webhook or a teammate's handoff always ask, and the chip says why. The model is never told which destinations a rule covers. What this does not cover: files you attach, files in the teammate's workspace, shell output, or untrusted text that already landed in an earlier turn's chat history (outside webhook or tainted bot_ref cards) do not mark a fresh turn outside-data — content from those sources could still steer a hold to a destination you once allowed. Keep standing rules for destinations where a wrong send is cheap.
Only work you started changes your setup save_memory, forget_memory, create_routine and stop_routine are offered only in a turn you started — your message, your decision, your answer, your question to the group. In a turn started by a routine, a webhook or a teammate's handoff they are left out of the tool list, refused if the model names them anyway, and the attempt is logged; the teammate can still tell you what it would change. Unlike standing rules, webhook data still in view does not block them in a turn you started, because you are there to see the chip. Handing work to a teammate stays possible from any turn: the receiving turn counts as a handoff and has the same limits.
A webhook opens one routine and nothing else POST /hooks/routines/:id (alongside the one-time OAuth callback GET /oauth/connector/:nonce) sits outside the gateway token. Each routine has its own random key: sent as a header or ?key=, or used by GitHub as the secret behind an X-Hub-Signature-256 signature over the exact body. Both are compared in constant time; a wrong key, a wrong signature and an unknown id all get 404. A repeated GitHub delivery runs once, and so does a captured signed request replayed under a different delivery id (the signature itself is remembered); a delivery refused because the last run was still going is not counted, so GitHub's redelivery of it runs. Bodies over 1 MB are refused as they arrive, before they are buffered, and at most 16,000 characters reach the model. The body is posted into the thread as an outside data card when the teammate picks it up, so you can see what set it off. The key never enters the thread or the model's context — only the computer panel shows it.
A payload stays inside its fence What a webhook delivered reaches the model between two lines that carry the payload's own SHA-256 fingerprint, with every payload line prefixed by │. Writing a convincing end-of-payload line from inside would mean finding a text that contains its own hash.
An upgrade keeps a way back Before a schema upgrade the gateway writes a complete copy of the database next to it and keeps the three most recent. It refuses to upgrade if the copy fails.
Bots cannot reach each other All bot computers share one Docker network with container-to-container traffic switched off. And because on Docker Desktop a container can still reach ports published on the host, everything a computer publishes wants that computer's own secret: its shell/file shim and its browser control port (CDP) a per-container token, its screen a per-container VNC password.
Each Docker computer is a cage Its own container with memory, CPU and process limits, no-new-privileges, and only its own workspace and isolated /var/lib/bot-browser profile mounted. Every port is published to 127.0.0.1 only, and the shim strips SHIM_TOKEN and VNC_PASSWORD from commands it runs.
A local computer's files stay in its folder read_file and write_file resolve inside that teammate's folder — /workspace maps to it — and a path that leaves it by name or through a symlink is refused. Its browser profile lives outside that folder, downloads land inside <workspace>/downloads, and browser_goto accepts only http: / https: URLs (with file: requests aborted in Chrome), so the teammate cannot read your disk or its own cookie store through the browser or file tools.
A local computer's commands are off, then caged Commands are off until you turn them on for that teammate in its panel. On, they run under Seatbelt (macOS) or bubblewrap (Linux): they can write only the teammate's folder and a private tmp; your whole home directory — keys, documents, other projects, your own browser profile, the gateway's data dir — is unreadable, except the runtime managers (~/.nvm, ~/.volta, ~/.pyenv, ~/.cargo/bin, …) that are put back read-only; a data dir outside your home is hidden too; HOME points at the folder and the environment is a short whitelist. The switch refuses to turn on until a self-check shows the sandbox blocks a write outside the folder, a read of the gateway token and a listing of your home directory. A command that outlives its timeout, or that you stop, is killed with its whole process group.
A file you send cannot run as a page The gateway decides what an uploaded file is from its content, not from the type the client declared, and accepts only images, PDFs, plain text and Markdown; a page dressed up as an image is refused. It serves uploads with nosniff and a sandboxing Content-Security-Policy, images inline and everything else as a download. An upload is stored under a random id, never under the name it came with.
A PDF you send cannot take the gateway down A PDF's text is extracted in a separate thread with a memory ceiling, a 20-second limit, and caps of 200 pages and 2 million characters. A document that breaks the parser, or runs into a limit, is stored without text and reported as such; the upload itself still succeeds and the gateway keeps running. Pages are not rendered and scripts in the document are not run.
A bot cannot steer where your files land The original of a file you send stays in <data>/uploads, outside every workspace. The copy for a teammate goes onto its computer through the computer itself: into a container through Docker's archive API, where paths resolve inside the container, and onto a local computer through the same folder check as write_file, creating a new file only and never following a link at the name. The gateway does not write into a container's mounted folder from the host, where a link planted by the bot would point at your own disk.
A bot cannot put code in front of you The screen page and its noVNC code are served by the gateway from its own copy; only the raw VNC stream comes from the bot's computer. Nothing a bot changes inside its container reaches your browser as a page.
Standing rules only change through the chip MEMORY.md lives outside the bot's workspace. The only ways to change it are save_memory, forget_memory, accepting a rule_proposal card, and the remove button in the computer panel, and each of them posts a diff chip; a MEMORY.md a bot writes into its own workspace is ignored. Screenshots — the evidence — are stored outside it too.
Controlled Dreaming never auto-writes MEMORY.md Both propose_memory_rule (capped at one created proposal per turn) and the 14-day repeated-discard detector (≥ 2 operator discards for the same (kind, target) or (kind, action)) only post an editable rule_proposal card in SQLite (rule_proposals) — never touching MEMORY.md until you explicitly click Save to MEMORY.md. Proposed and edited rules are sanitized into a single line (CR/LF, control characters and leading bullet markers stripped, max 300 characters) and deduplicated against existing memory, pending proposals and previously dismissed proposals. For propose_memory_rule, the gateway — never the model — computes sourceTainted from turnTainted or origin === 'webhook' and displays an amber External source — review carefully warning badge on the card.
Handoffs are allowlisted By default only the chief of staff can reach everyone. Peer directions need OPENSUPERBOT_A2A_ALLOW, and relays stop after two hops.
A watch routine cannot act Its turns are offered only read-only tools — including if you answer a question it asked with ask_operator — and any other tool the model names is refused by the gateway: no shell, no writing files, no clicking, typing or key presses in the browser, no connector writes or drafts, no MCP write tools, no wiki writes, no handoffs, no changes to rules or routines. What it holds never matches a standing rule. It can still load pages, so it can still be steered by what it reads; it just has nothing to act with.
A prepare routine gathers context without acting outward Its turns are offered only the watch read-only tool set plus wiki_upsert, wiki_patch and workspace write_file (alongside read-only MCP tools), and that capability boundary is preserved across ask_operator resumptions. Any other tool the model names is refused at runtime by the gateway: no shell, no interactive browser mutations (browser_click, browser_type, browser_press), no external connector writes or drafts, no MCP write tools, no teammate relays (message_bot), and no operator-only setup tools (save_memory, forget_memory, create_routine, stop_routine). What it holds never matches a standing rule.
Quiet Hours buffers only non-urgent scheduled checks When opt-in Quiet Hours are enabled (quietHoursStart–quietHoursEnd, evaluated in the gateway timezone), only non-urgent scheduled watch and prepare reports and final text replies are buffered in SQLite (quiet_digest_items) and flushed together as one Morning Digest card when the window ends, when Quiet Hours are disabled, or when you click Deliver now. Urgent alerts (urgent: true on message_user), approvals (hold_for_approval and connector/MCP write holds), ask_operator questions, login requests, error/budget notices, operator-started turns, act routines, webhook routines and manual runs (force: true) always break through immediately.
A batch is approved item by item The gateway stores the exact items a bot held and the ones you left ticked; the bot is told that subset and nothing else. A batch can never become a standing rule.
Per-teammate connector isolation Connected app accounts (connector_accounts) grant zero access by default: a teammate only sees connector tools and accounts explicitly listed for it in bot_connectors (and when two or more accounts in the same domain are granted, every call must name the exact account id). Neither <data>/composio-key (0600 on macOS and Linux; owner-only ACL on Windows) nor upstream OAuth tokens ever enter any teammate container, local workspace, command sandbox or model prompt.
Gateway-executed connector writes & draft snapshot lock Outward connector writes (mail_send, mail_reply, mail_archive, calendar_create_event, calendar_update_event, notion_create_page, notion_append, slack_send_message) are intercepted in gateway code before calling the upstream provider. Approval chips are built strictly from real parameters — reading back actual draft contents on mail_send({ draftId }) and Reply-To / sender / recipient headers on mail_reply, locking held draftId snapshots against in-place mail_draft mutation while pending, and freezing the exact request in SQLite. On Approve (or 👍), the gateway re-verifies the teammate's grant, account status and draft snapshot integrity, then executes the frozen request directly in a single attempt (reporting uncertain without auto-retrying on timeout or 5xx to prevent duplicate sends).
Connector outside-data taint & OTP/reset-link redaction Reading any connector read tool (mail_list, mail_read, calendar_list, notion_search, notion_read_page, slack_list_channels, slack_read_messages) taints that turn as outside-data, so standing Always allow… rules cannot auto-approve subsequent hold_for_approval holds or connector writes in that turn. mail_list also hides automated/bulk mail unless includeAutomated: true, and mail_read strips HTML scripts/styles and click-tracking URL parameters (utm_*, fbclid, gclid, long opaque tokens, …) and redacts 4–8 digit OTP codes ([redacted-otp]) and password-reset / magic-login / verification URLs ([redacted-security-link]) before text reaches the model.
Per-teammate MCP server isolation & sanitized stdio host boundary Configured MCP servers (mcp_servers) grant zero access by default: a teammate only sees mcp__<server>__<tool> tools from enabled servers explicitly listed for it in bot_mcp_servers, and models have no tool or endpoint to create, edit or delete MCP servers. Secrets in <data>/mcp-secrets.json (0600 on macOS and Linux; owner-only ACL on Windows) never enter any teammate container, local workspace, command sandbox or model prompt, and any secret values echoed in stderr or HTTP errors are redacted ([REDACTED]) before reaching last_error or tool output. When spawning a stdio server (shell: false), the gateway builds the child environment from a short OS allowlist plus that server's explicit env — stripping OPENSUPERBOT_*, model API keys, Composio keys and gateway tokens — and advertises empty client capabilities ({}), refusing server-initiated sampling/createMessage or roots/list requests.
Gateway-executed MCP writes & 3-tier read/write policy Every discovered MCP tool defaults to write (held for approval and hidden from watch routines) unless you explicitly mark it read in toolPolicies or enable trustReadOnlyHint on that server (and even then, a tool with destructiveHint: true stays write unless overridden individually). Every write MCP call is intercepted in gateway code before reaching the server and stored as an other hold (canRemember = false, so MCP writes always ask item by item and never become standing rules) with its exact FrozenMcpExecution arguments frozen in SQLite. On Approve (or 👍), the gateway re-verifies that the server still exists, is enabled and is still granted to that teammate, then executes tools/call directly in a single attempt — recording uncertain without auto-retrying if the process exits, stream drops, 5xx returns or timeout fires after dispatch.
MCP outside-data taint & legacy SSE same-origin check Calling any read MCP tool taints that turn as outside-data (omitting external image, audio and binary blocks from text tool output and capping output at 16,000 characters), so standing Always allow… rules cannot auto-approve subsequent hold_for_approval holds or connector writes in that turn (and the post-approval follow-up turn after an MCP write starts tainted as well). Remote Streamable HTTP servers validate http: / https: URLs (refusing embedded credentials and forbidden framing headers) and, when falling back to 2024-11-05 HTTP+SSE, enforce endpointUrl.origin === baseUrl.origin before posting requests — preventing a cross-origin endpoint event from leaking custom Authorization headers or steering requests elsewhere.
Per-teammate Credential Vault & zero-exposure fill Vault items (vault_items) grant zero access by default: a teammate only sees metadata (id, slug, allowedDomains, field names — never raw values) for items explicitly granted in bot_vault_items, and browser_fill_secret is excluded from watch routines. Raw values live only in <data>/vault-secrets.json (0600 on macOS and Linux; owner-only ACL on Windows) outside SQLite and outside every container/sandbox. Before filling, the gateway verifies HTTPS (or an explicitly listed loopback host), matches page.url() against strict allowedDomains (rejecting broad wildcards such as *, *.com, or *.co.uk), and enforces that secret-kind fields only fill <input type="password"> elements. Items set to always — or any on_taint item during a routine, webhook, handoff, or outside-data tainted turn — are held as gateway-executed vault_fill approvals (canRemember = false, zero plaintext in SQLite) that re-verify grant and exact expectedOrigin before filling (generating live RFC 6238 TOTP codes at fill time). Subsequent computer tool outputs in that turn are redacted against used vault secrets.
Today Feed taint preservation & read-only Idea Incubation Feed cards published via publish_feed (capped at 3 per turn) or projected from watch / feed-surfaced routines automatically inherit tainted = 1 whenever the turn was not operator-started or touched outside-data — the model cannot clear that flag. Promoting a tainted proposal into the Idea Inbox preserves tainted = 1, follow-up/dispatch turns start tainted so standing approval rules cannot silently fire, and clicking Incubate (read-only) always runs the chosen teammate in strict watch mode (read-only tools only, zero writes or external actions).
Gateway-owned Goals & anti-tampering authority split Long-term goals, milestones and progress logs live strictly in gateway SQLite (goals, goal_milestones, goal_updates), never in a bot's workspace. manage_goal (creating/editing goals, changing success criteria or status, adding/completing/removing milestones) is restricted to OPERATOR_ONLY_TOOL_NAMES (omitted and refused in routine, webhook, relay and watch turns). Non-watch participating teammates may only call update_goal_progress (capped at 2 notes per turn, active assigned goals only), which never mutates definitions or milestones and automatically marks non-operator / outside-data notes tainted = 1. Every tool-driven change posts a visible goal_updated diff chip and lands in the SQLite actions log; active goal prompt injection is hard-capped at 2,400 characters; pausing, finishing or archiving a goal removes it from prompts and automatically skips scheduled runs of linked routines (routines.goal_id).
Spaces (declarative blocks + sandboxed HTML) & per-teammate role isolation Live Spaces (spaces, space_items, space_bots) validate every schema through parseSpaceSchema() across 10 block types (metrics, table, kanban, checklist, timeline, chart, markdown, action_bar, cards, html) — rejecting unknown block types, prototype-pollution keys, non-http(s) table/card links, unsafe image URLs, and oversized payloads (<=12 blocks / 256 KB schema / 120 KB per HTML block / 200 items per space). Any html block renders strictly inside an opaque null-origin <iframe sandbox="allow-scripts"> (no allow-same-origin, allow-top-navigation, allow-forms, or allow-popups) with an injected CSP (default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src https: http: data: blob:; font-src data:; connect-src 'none'; frame-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'), so Space scripts can never access gateway cookies, DOM, APIs, or external network endpoints; links inside HTML blocks post back to the host and open only after http(s) validation. Teammates have zero access by default until explicitly granted viewer or editor in space_bots. manage_space (creating spaces or editing layouts, HTML blocks, and action_bar buttons) and create_nba_space (fetching fixed public NBA scoreboard/standings endpoints with redirect: 'error' and bounded reads, storing verified records with tainted = 1, and tainting the turn outside-data) are restricted to OPERATOR_ONLY_TOOL_NAMES so untrusted pages or routines can never forge Spaces, HTML, or action buttons; chat Markdown opens only strict #space=space-[0-9a-f]{8} fragments in-window while keeping external links http(s) / mailto with noopener noreferrer; space_read is safe in watch runs (and propagates outside-data taint if the space holds tainted items); space_upsert_item / space_delete_item require editor access in non-watch turns (capped at 10 writes per turn) and automatically mark non-operator / outside-data records tainted = 1 with visible space_updated audit chips. Action buttons execute only prompts stored in the gateway database.
Operator-edited approvals (Edit & Approve) Pending connector writes (mail_send, mail_reply, slack_send_message, notion_create_page, notion_append, calendar_create_event, calendar_update_event), MCP write tools and non-batch hold_for_approval drafts can be edited inline before approving. Every edit is validated atomically before settling the approval — rejecting empty required fields, CR/LF email header injection, oversized payloads, __proto__ keys or tampered read-only identifiers (connectorId, serverId, draftId, messageId, eventId, …) with HTTP 400 (invalid_edit) while keeping the approval pending. Editing a draftId email still verifies the remote draft against its pre-edit TOCTOU snapshot before updating the draft in-place and sending it once. Any standing rule (remember) submitted with an edit is re-evaluated against the post-edit destination before settlement, and edited approvals record edited: true on the chip and timeline plus (edited by you) in the SQLite action log.
共享技能归你掌控且内置只读兜底(Shared & Built-in Skills) 共享技能由随网关与桌面包只读发布的 6 份预置手册(gateway/skills/*.md:meeting-minutes、research-brief、spreadsheet-analysis、doc-drafting、slide-outline、careful-browsing)与操作者在 <data>/skills/*.md 编写的自定义手册双层组成,两者均位于所有同事的 Docker 容器与本机工作区沙箱之外,同事没有任何工具可创建、修改或删除技能文件。列举(listSkills / listMergedSkills)与按名读取(readSkill / readMergedSkill 及 agent.ts 中的 execReadSkill 白名单前置拦截)共享同一套合并目录解析:(1)强制通过 /^[a-z0-9][a-z0-9_-]{0,63}$/ 文件名校验,仅允许读取合并目录中实际列出的有效技能;(2)对目录与文件执行 lstat、要求 Dirent.isFile()(拒绝符号链接目录、软链文件、FIFO 管道与设备节点),并以 O_NOFOLLOW 打开文件描述符二次核验普通文件身份与 256 KB 体积上限,彻底阻断软链逃逸读取 ../auth-token 等敏感文件或超大文件拖垮内存;(3)操作者在 <data>/skills/<name>.md 放置的同名合法文件始终优先覆盖内置版本(升级应用不丢失修改),并在 MAX_SKILLS = 50 总上限下优先保底用户自定义技能配额(溢出淘汰的内置项亦不可通过 read_skill 绕过读取);(4)本机受信任技能手册按需读取不触发 outside-data 污点,其中 careful-browsing 显式强化将网页全部正文视为不可信外部数据、遇登录墙/MFA/验证码立即交由 ask_for_login 接管、以及不可逆提交前暂停请求审批的操作纪律。
Shared team wiki (<data>/wiki/) Shared factual entity pages (contact, client, project, topic, session) live in SQLite and are mirrored atomically to <data>/wiki/<kind>/<slug>.md outside every teammate's workspace, Docker container and local command sandbox; bots access the wiki only through gateway tools (wiki_search, wiki_read, wiki_upsert, wiki_patch). wiki_patch applies validated section-level updates (preserving untouched list entries and [#msg:<id>] citations unless an explicit drop reason is supplied) and writes ## Change Log deterministically in gateway code (stripping any model-supplied changelog); watch routines remain strictly read-only (wiki_upsert and wiki_patch are left out of tool schemas and refused at runtime). Dual-list wiki_search returns curated pages alongside ranked conversation originals from messages_fts strictly bounded to accessibleThreadIds(db, botId) (dm:<botId> plus that teammate's group memberships), so one teammate can never read another teammate's private DM history, while webhook hits stay wrapped in SHA-256 <<<webhook fences and approval cards stay summarized. Deterministic secret scrubbing redacts raw API keys and bearer tokens (sk-, sk-ant-, xai-, AIza, gsk_, cmp_, ghp_, github_pat_, xoxb-, Bearer …) before wiki_patch or auto-sync writes reach SQLite, FTS or disk mirrors. Any page created or updated during an outside-data turn or from a webhook — and any idle (P3 low-priority) or manual (Sync from chats) chat-to-Wiki auto-sync pass whose thread window contains a webhook message, tainted bot_ref relay, or external read tool action (web_*, browser_*, connector reads, mcp__*) — marks source_tainted = 1 (and neither teammates nor auto-sync can clear that flag on subsequent edits); reading or matching a tainted page or untrusted original via wiki_read or wiki_search marks the turn outside-data — propagating across A2A relays and group rounds — so untrusted external content cannot be laundered through the wiki to bypass standing Always allow… rules until you review and save the page in Team wiki. Behavioral rules stay exclusively in tamper-evident MEMORY.md, never in the wiki.
Background tasks stay isolated (origin: 'background') Offloaded tasks run in a per-teammate secondary lane (1 running + up to 5 queued, at background local-LLM priority so interactive chat preempts between steps) with origin: 'background'. They cannot recursively spawn, steer or cancel background tasks (delegate_background_task, steer_background_task, cancel_background_task are omitted and refused at runtime), cannot mutate standing rules or routines (save_memory, forget_memory, create_routine, stop_routine are blocked), and every outward action (hold_for_approval, connector writes, MCP writes) always waits for your approval — never matching standing Always allow… rules (recording ruleHeld: 'background' whenever a standing rule would otherwise match). External-data taint propagation (outside-data and sourceTainted on wiki writes, propose_memory_rule and message_bot) is preserved identically, including taint propagated from tainted foreground turns through delegate_background_task and steer_background_task. Browser tools (browser_goto, browser_extract, browser_click, browser_type, browser_press, browser_scroll, browser_back, browser_screenshot, ask_for_login) acquire a lazy per-bot browser lease mutex so foreground chat and background tasks never clobber the same persistent page; non-browser tools run freely in parallel, and workflow recording (POST /api/bots/:botId/workflows/recording) and replay (POST /api/bots/:botId/workflows/:workflowId/run) return HTTP 409 (browser_in_use) while a background task holds the lease.
Group team charter (team.md) & DAG dispatch pipelines Each group's shared charter lives outside every teammate's workspace, container and command sandbox at <data>/groups/<safe-key>/team.md (with traversal-safe, Windows-safe naming and a SHA-256 suffix) and is editable only by you via GET/PUT /api/threads/:threadId/team (max 16,384 characters); bots have no tool to write it. Only Chief in an operator-started act group turn can call create_dispatch_plan, which validates an acyclic DAG (up to 12 steps, restricted to members of that group) and posts a draft pipeline card that never executes until you explicitly click Start pipeline (POST /api/dispatch-plans/:id/start). Every pipeline step runs with origin: 'relay', priority: 'background', trigger: 'pipeline' and isPipelineStep: true — withholding all standing Always allow… rules (recording ruleHeld: 'relay'), omitting operator-only setup tools, and forbidding recursive create_dispatch_plan or delegate_background_task calls. outside-data taint propagates across DAG edges (plan.sourceTainted or any upstream outputTainted starts downstream steps tainted) and is preserved across approval/question pauses and resumptions.
对话反馈受控学习(Conversational Dreaming) 后台低优(P3 low)复盘任务仅扫描私聊线程(dm:<botId>)中由 routine / watch / prepare / webhook / quiet_digest 触发的主动消息及后续操作者回复,采用两级受控晋升机制(隐式打扰反馈先记入 SQLite proactive_clues,同类同倾向累计 seen_count >= 2 或操作者发出显式长期指令时晋升为可内联编辑的 RuleProposalChip,source: 'dreaming'),绝不静默直接修改 MEMORY.md,必须经操作者点击「存入 MEMORY.md」(POST /api/rule-proposals/:id/resolve)确认才写入。对话窗口全程采用只读围栏(<<<exchange … >>>)隔离提示词指令注入,全字段(area_label、evidence、rule、reason)经 scrubWikiSecrets 脱敏,若窗口含外部数据(webhook、quiet_digest、带污点 bot_ref、wiki_sync_state.pending_taint 或外部读取工具调用)则单调传递 outside-data 外部污点标记(source_tainted → sourceTainted: true 警示徽章),且时段类抱怨强制限制在对应时间窗(time_window)内降级归一化为延后跟进(follow_up_later),防止误伤全天正常提醒。
三维主动投递节奏控制(Proactive Pacing) (1)60 秒多事件 Webhook 合并防重放洪泛:通过签名/密钥、重放去重与体积校验后,同一 routine.id 在 60 秒窗口内到达(含运行中到达)的事件按序合并入聚合桶(最多 10 条载荷、总长 ≤ 256 KB)触发单次 runRoutine;(2)3 分钟活跃对话静默暂缓(proactive_deferred):非手动定时巡检的非紧急文本/汇报在目标线程忙于交互或操作者 3 分钟内刚发言时写入 SQLite proactive_deferred 暂存,待对话静默满 3 分钟后自动补发(重启不丢失,免打扰时段内平滑转入 quiet_digest_items 并保留 source_tainted);(3)每日非紧急提醒上限分流:每位同事单本地自然日直接投递入线程的非紧急主动提醒默认上限 5 条,超额自动分流至今日动态流(Today Feed)与晨报缓冲(quiet_digest_items)。urgent: true 紧急告警、审批卡片(approval_request)、提问卡片(question)、登录接管请求(login_request)与手动运行(force: true)永不阻塞。
联想式历史召回(Associative Flashback) 仅在操作者发起的交互式 act 回合前运行(排除 routine / watch / prepare / webhook / 后台副车道与流水线步骤),零额外模型调用。(1)严格限定未污染可信源(Untainted-Only Recall):团队 Wiki 仅在 SQL 层检索 archived_at IS NULL AND source_tainted = 0 的干净页面;窗口外历史消息仅限 kind IN ('text', 'report', 'memory_updated'),并硬排除落入外部工具动作(web_*、browser_*、连接器读取、mcp__*、wiki_read、wiki_search、space_read、search_history)、前序 40 条含 webhook / quiet_digest / 带污点 bot_ref、proactive_deferred.source_tainted = 1、proactive_thread_taint、thread_checkpoints.had_webhook = 1 或受污染后台任务/调度计划窗口内的助手输出,因此绝不将外部不可信载荷混入干净对话,亦绝不无感触发 outside-data 污点而废除操作者的常驻审批规则(ruleBlock 保持 null);(2)严格遵守跨同事会话隔离:历史检索严格限制在 accessibleThreadIds(db, botId)(仅该同事私聊 dm:<botId> 与其所属群聊 thread_members),并排除当前上下文窗口内消息防重复复读;(3)随机 Nonce 只读围栏、密钥脱敏与零前缀污染:每条召回标题与摘要均经 scrubWikiSecrets 脱敏并转义任何伪造 < /? historical_context 闭合标签,包裹在每回合随机 12 位十六进制 nonce 的 <historical_context_${nonce} source="flashback" trust="internal-untainted" mode="read-only-reference"> 只读围栏内(上限 1,200 字符),仅作为不落库的内存尾部消息追加以 100% 保护 Prompt KV 热缓存前缀,并受双层防唠叨冷却(SQLite flashback_state:同线程 15 分钟或至少新增 4 条用户消息、单条目 24 小时去重)约束。
高危 Shell / 浏览器确定性护栏(Deterministic Action Guardrail) 在 shell、browser_click、browser_type(submit: true) 与 browser_press(Enter / Return 及 Meta+Enter / Control+Enter 提交快捷键)触达底层容器/本机沙箱或浏览器前,网关以纯代码毫秒级同步执行确定性规则拦截(零模型调用):(1)6 类高危 Shell 命令拦截:保留原始命令供冻结直执的同时,展开换行、;、&&、`
统一脱敏一键诊断包(Redacted Diagnostics Bundle) GET /api/diagnostics 挂载于网关鉴权中间件之后(未登录返回 401),供「设置 → 关于」一键复制纯文本摘要或下载 .json 诊断包。接口仅汇总网关与 Schema 版本、运行环境元数据、计算机与浏览器子系统状态、本地 LLM 队列快照、MCP / 连接器状态摘要(不含命令参数、环境变量、请求头、带参 URL 或外部账号邮箱)、核心表行数统计、近 24 小时脱敏错误动作摘要,以及磁盘日志文件末尾最多 128 KB / 200 行尾部日志,绝不采集任何聊天消息正文(messages.content)、团队知识库正文(wiki_pages.body)、MEMORY.md 或 <data> 下的密钥文件(llm-key、stt-key、mcp-secrets.json、vault-secrets.json、auth-token)。网关诊断与桌面端日志(desktop/src/diagnostics.ts)共用全谱系 redactSecrets 脱敏器,自动隐去主流模型与云厂商密钥(sk-ant-、sk-proj-、sk-svcacct-、sk-、AIza、gsk_、xai-、cmp_、ak_、ghp_/gho_/ghs_/ghr_/github_pat_、glpat-、xox*-、AKIA/ASIA、hf_、r8_、pplx-、Stripe `sk_/rk_live
操作者个人工作画像(<data>/profile.md) 操作者全局工作背景与协作偏好独享托管于网关数据根目录 <data>/profile.md(位于所有同事的工作区、Docker 容器及本机命令沙箱之外),同事无任何工具可创建、修改或删除 profile.md,仅已登录操作者可通过受网关鉴权保护的 GET / PUT /api/profile 读写(超 4,000 字符或非字符串输入直接返回 400)。文件读写均经 lstat 与 O_NOFOLLOW 拒绝符号链接与非普通文件并校验 64 KB 字节上限;非空写入通过同目录随机临时文件 + rename 以 0600 权限原子落盘,空内容安全删除且遇到软链直接拒写,彻底阻断软链逃逸与半写损坏;注入系统提示词时置于共享技能之后、MEMORY.md 之前(经 boundInstruction(..., 4,000, 'profile.md') 限长并保护 KV 前缀缓存),不削弱常驻审批边界或各同事 MEMORY.md 规矩。POST /api/profile/suggest(受鉴权、单实例互斥锁与 stopAll() / 客户端断开中止信号保护,走 P3 low 低优队列)严格只读且绝不自动写盘:仅采样最近 30 天内未受外部污染的操作者纯文本发言(通过 isTaintedUserText 过滤全部服务端合成的 sender = 'user' 包装提示——含 Feed/Idea/Goal/Space 触发包装——并排除 webhook、寒暄与系统唤醒词,上限 60 条 / 6,000 字符)及 source_tainted = 0 的未污染团队 Wiki 摘要(上限 15 条 / 2,000 字符);全部输入与输出草稿在折叠空白前先行执行全谱系 redactSecrets + scrubWikiSecrets 密钥脱敏,并实施不依赖单次 Nonce 的 XML 围栏标签中和转义,再以随机 12 位十六进制 nonce 只读围栏隔离指令注入,限长 4,000 字符,必须经操作者在「设置 → 个人工作画像」审阅后点击「应用到编辑框」并「保存画像」才会写入磁盘。
群聊防漏回钩子(room-reply-guard) 群聊回合收尾前由网关代码同步执行回复守卫(gateway/src/room-reply-guard.ts + agent.ts + server.ts):(1)点名、收尾与工具调用后有界追回:被直接 @点名、Chief 收尾总结(mode: 'required')或本回合已执行过工具调用(ranToolCall)且尚未发布可见消息/卡片的同事,若模型返回空回复或误发静默标记,网关仅在不落库的内存上下文中发起最多 1 次有界纠偏追问(MAX_ROOM_REPLY_NUDGES = 1),且在最后一次借步兜底追回时主动禁用全部工具调用、强制模型仅输出可见文本以防继续触发工具死循环;若追回后仍无法产出可见文本,则由网关立即输出清晰兜底说明并收尾,既杜绝漏答也避免死循环烧光步数或 token;若同事已发出审批卡、提问卡、汇报卡或流水线卡等可见卡片则不再重复追问;(2)非点名精确 [NO_REPLY] 礼让与防全员静默保障:未点名全员发问轮次中,非 Chief 成员以 mode: 'optional' 运行,仅在未发可见消息、未执行工具且回复剥离外层 Markdown 强调、引用前缀与代码围栏后仍全串精确匹配 `/^[?(?:NO_REPLY
本机硬件探测与本地模型推荐(Model Autopilot) GET /api/hardware/autopilot 挂载于网关操作者鉴权之后(未登录返回 401),严格遵循只读、零隐私泄露与防 SSRF 边界:(1)只读跨平台硬件探测:仅调用标准 node:os 与白名单只读命令(sysctl、nvidia-smi、rocm-smi),全部采用异步 execFile、静态常量参数数组、shell: false、2000ms 硬超时、64 KiB 输出上限(Linux/macOS 使用静态安全 PATH,Windows 仅透传 SystemRoot 与 PATH),不写入磁盘,探测失败静默降级;(2)零敏感宿主标识:响应仅包含 CPU/GPU 型号、核心数与内存/显存容量估算,绝不暴露主机名(os.hostname())、操作系统用户名、设备序列号、MAC 地址、本地文件路径或任何 API Key / Token;(3)严格回环防 SSRF 探活:本机 Ollama 探活仅允许回环白名单(localhost、127.0.0.0/8、[::1]、[::ffff:127.x.x.x]、0.0.0.0/[::] 归一化及容器宿主机别名 host.docker.internal/host.containers.internal),显式阻断云元数据地址(169.254.169.254、fe80::/10)、局域网私有 IP 与公网域名(合法远端地址不发任何网络请求直接返回 remote_skipped;超长、含控制字符或内嵌账号密码的 baseURL 拒收并返回 400),仅访问固定只读路径 /api/version 与 /api/tags,强制 redirect: 'manual'、1500ms 超时、256 KiB 响应体流式截断且不发送任何认证头,并严格抽取结构化字段、零原文透传以防泄露本机其他端口响应;(4)认证与环境变量锁定尊重:网关不代执行后台拉取下载,前端一键套用推荐模型、视觉开关与并发上限时严格跳过被环境变量(OPENSUPERBOT_MODEL、OPENSUPERBOT_VISION、OPENSUPERBOT_LOCAL_LLM_CONCURRENCY)锁定的字段。
轻量会议录音转写闭环(Meeting Notes) 会议录音、转写与沉淀路由(GET /api/meetings/capabilities、PUT /api/meetings/config、POST /api/meetings/transcribe、POST /api/meetings/summarize、POST /api/meetings/commit)全部挂载于网关鉴权中间件之后并严格守住以下边界:(1)application/json 防跨站表单与音频校验:所有写操作(含音频上传)统一走 application/json,不放开 multipart/form-data 入口;请求体限制在 28 MiB 内对应原始音频硬上限 20 MiB(超限返回 413 audio_too_large),并对解码后的二进制头部执行 6 类白名单魔数校验(WebM、WAV、MP3、M4A/MP4、OGG、FLAC),拒绝伪造扩展名或脚本/页面载荷;(2)桌面端纯音频最小权限与音轨即时释放:Electron 仅对主窗口顶层网关本机回环主帧放行纯音频麦克风(media 明确限定 audio,拒绝沙箱 iframe/子帧、不透明源与子窗口,macOS 先触发系统麦克风授权),摄像头(video)、定位与读剪贴板继续 100% 拒绝;前端仅在用户显式点击开始录音时采集(并隔离并发与过期 getUserMedia 请求),在停止录音、切换模式/步骤、关闭弹窗、按 Escape 或组件卸载时立即调用每个 MediaStreamTrack.stop()、清理定时器、撤销 URL.createObjectURL 并中止在飞请求;(3)独立转写密钥隔离与防 SSRF:独立 STT 密钥存放在 <data>/stt-key(0600 权限 / Windows 仅所有者 ACL,位于 SQLite 与所有容器/沙箱之外),读写经 lstat 与 O_NOFOLLOW 拒绝符号链接;更换 baseURL 且未提供新密钥时自动清空旧密钥,绝不把一家服务的密钥发往另一家,并尊重 OPENSUPERBOT_STT_* 环境变量锁定;调用远端 /audio/transcriptions 时仅允许 http:/https:、禁止内嵌账号密码、阻断云元数据与链路本地地址(169.254.0.0/16、fe80::/10、0.0.0.0)、强制 redirect: 'manual' 禁用 3xx 重定向,并对响应体限长与错误日志去密钥;(4)本机离线 Whisper CLI 隔离:仅在静态安全目录探测 whisper-cli/whisper/ffmpeg,OPENSUPERBOT_WHISPER_MODEL 经 lstat 常规文件校验或白名单模型名校验,language 严格校验 /^[a-z]{2,3}$/,采用单飞互斥(409)、异步 execFile(shell: false、洁净环境变量不含网关令牌与模型/STT 密钥)、0o700 临时目录与固定 0o600 文件名 input.<ext>,并在 finally 彻底清理;(5)密钥脱敏、随机 Nonce 围栏与人工审阅落库:转写稿在送入幕僚长 LLM(零工具、background 优先级、单飞互斥)前先执行 redactSecrets(scrubWikiSecrets(...)) 脱敏,并包裹于随机 16 位十六进制 nonce 的 <meeting_transcript_<nonce>> 只读 XML 围栏(中和伪造闭合标签)防范提示词注入;生成的纪要草案与去重标记待办必须经操作者在弹窗内审阅确认后,才在单个 SQLite 事务中原子写入 Wiki session 页面与 Today todos 待办表。
原生桌面无障碍控制与切窗礼让(Native Desktop Accessibility) 仅在本机电脑模式(computerKind === 'local')下提供,Docker 容器模式始终禁用(available: false, whyCode: 'container_mode'),全流程由网关代码强制守住五道边界:(1)默认关闭、按同事显式 Opt-in、白名单授权与回合门控:每位同事在 bots 表独立记录 desktop_ax_enabled(默认 0)与 desktop_ax_apps_json(最多 20 项、单名 ≤ 80 字符、去控制字符与大小写归一化去重),只有操作者在电脑面板显式开启、系统权限就绪且应用位于白名单内时,才向该同事注入 desktop_* 工具;webhook 回合禁用全部桌面无障碍工具,且写工具仅限前台操作者发起的 act 回合开放(watch / prepare、后台任务与定时巡检/接力回合一律排除并在运行时拒绝);(2)不可绕过硬拦截黑名单:按归一化应用名与 Bundle ID 双重匹配,同时在白名单保存(返回 400 desktop_ax_app_blocked)、每次工具调用及冻结审批执行瞬间强制拦阻四类高敏应用——全部主流日常个人浏览器(personal_browser,持续守住独立浏览器 profile 隔离)、密码管理器与系统钥匙串(password_manager)、终端与系统设置/管理工具(terminal_or_system)以及 OpenSuperBot / Electron 自身(self_app,严防失控同事操控自身窗口点击「批准」按钮);(3)跨平台零编译静态脚本、stdin JSON 防注入与密码框保护:macOS 权限探测走本地 AXIsProcessTrusted()(不触发 System Events Automation 弹窗),通过 /usr/bin/osascript -l JavaScript 静态 JXA 提供无障碍读写;Windows 通过 %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe 静态 .NET UIAutomationClient 仅提供只读查看与焦点检测(writeSupported: false);Linux 诚实降级禁用;全部子进程均使用异步 spawn(shell: false、固定系统路径、10s 超时、512 KiB 输出上限、洁净最小环境变量),脚本主体 100% 静态常量,所有参数一律经 stdin JSON 传递(严禁拼入脚本源码或暴露在命令行参数中);读取无障碍树限深 6、限 150 个控件、单字段截断 200 字符,硬跳过密码输入框(macOS AXSecureTextField / Windows IsPassword,写操作亦禁止触碰密码框),返回文本先经 redactSecrets 脱敏,desktop_inspect_app 读操作触发本回合 outside-data 单调污点并跨子系统传播至 Flashback、Wiki 自动沉淀与 Dreaming,desktop_type 与 desktop_inspect_app 同步列入 CONTENT_BEARING_TOOLS 防写入脱敏诊断包;(4)全局单同事焦点租约与切窗自动礼让:DesktopFocusManager 全局维护单进程互斥租约(空闲 TTL 30s),每次写操作前实时复核系统前台窗口 frontmostApp(),若操作者已切去其他窗口则立刻释放租约礼让停手(operator_focus_yield),绝不强抢焦点且绝不向模型泄露处于黑名单中的当前前台敏感应用名;desktop_focus_app 仅在空桌面、已是目标白名单应用或前台为 OpenSuperBot 时才允许温和切焦;在电脑面板关闭开关或移除白名单应用立即释放租约急停;(5)高危写动作冻结单次审批与批准瞬间温和回焦复核:含修饰键的组合快捷键、Return/Enter/Delete/Backspace/Space 按键、命中中英文支付/删除/发送/发布/授权词的高危点击,以及 submit: true、含换行符文本(\r/\n)或敏感控件的提交输入,强制写入 approvals.execution_json(kind: 'desktop_ax_guardrail'、canRemember = false 永不可记为常驻规则、approval-edit.ts 显式禁止内联改写);批准瞬间网关复核仍为本机模式且开关仍开启、appName 仍不在黑名单且仍在白名单内、平台支持写操作,以及实时前台窗口状态——操作者在 OpenSuperBot 主窗口点击批准(或当前为空桌面)后,网关先温和切回目标白名单应用并复核焦点落地再执行,若操作者已在其他外部应用工作则立即礼让取消,绝不强抢焦点或误点其他软件。
There is a record Every tool call, approval decision and webhook call lands in the action log in SQLite, with what started the turn. Text typed into a page is not logged. Entries older than 90 days are dropped.
Spend has a ceiling if you want one OPENSUPERBOT_DAILY_TOKENS stops a bot for the rest of the day once it has used that many tokens.
You can always stop it The stop button (or POST /api/threads/:id/stop) aborts the running turn — including a shell command in flight, which is killed in the container. No single command runs longer than ten minutes, and a turn pauses after 40 model steps or 20 minutes (OPENSUPERBOT_MAX_STEPS, OPENSUPERBOT_TURN_MINUTES). Routines can be paused or deleted from the computer panel.

A convention, not a wall

对外动作审批门禁与静态护栏的边界。 每位同事的系统提示词与 AGENTS.md 硬边界都要求在任何对外动作发生前先调用 hold_for_approval 等待操作者确认。在网关代码层面,内置 OAuth 连接器写操作、MCP 写工具、凭证库自动填充,以及命中高危确定性护栏(action-guardrail)的 6 类高危 shell 命令与敏感网页提交(结账付款、永久删除、对外发送/发布及高敏路径回车提交)均由网关强制拦截、冻结在 execution_json 中并坚持一件一问(canRemember = false,浏览器动作额外校验 expectedOrigin 防跨源漂移),经批准后由网关单次直执。但需客观认识其边界:基于命令语法树展开与文案/路径特征的确定性护栏旨在与底层 OS(Seatbelt / bubblewrap)及 Docker 容器沙箱形成纵深防御,并不能替代沙箱本身——模型在工作区内编写的自定义混淆脚本,或已登录第三方站点上命名非常规的自研前端按钮,仍可能绕过静态特征匹配而无需经过 hold_for_approval。因此请务必配合沙箱隔离并遵守下方第 1 条原则(为同事分配独立专用账号),让任何潜在误操作的爆炸半径可控。

What a standing approval trusts. For hold_for_approval in the browser or shell, a rule matches the kind and destination the bot itself declares when it holds an action, and then the bot performs the action on its own computer; the gateway decides whether to ask you again, not what the bot does next (whereas for built-in connector and MCP write tools, the gateway freezes the exact call parameters and executes the call itself — and MCP writes never match standing rules at all). Outside input cannot start a turn in which a rule applies, reading untrusted external content in the turn — webhook payloads, browser page reads (browser_goto / browser_extract / browser_click / browser_back / browser_screenshot), connector reads, MCP reads, tainted shared wiki searches/reads, or tainted bot_ref handoffs — withholds rules as outside-data, and the bot is not told which destinations its rules cover. Still, within an untainted turn you started, a bot that mislabels a hold_for_approval action, by mistake or because of an attached file, workspace file or shell output it read, could still slip one past a rule. So rules save you waiting on a teammate you already trust with that destination; they do not make the approval gate stronger. Keep them narrow and short-lived.

Treating what it reads as data. Bots are told that pages, files and emails are data, never orders, and a webhook's body arrives explicitly labelled as data from another system. Prompt injection against tool-using agents is still an unsolved problem industry-wide.

A file you send is read like any other file. What an attached file says reaches the teammate the way a file in its workspace does: as data it was told not to take orders from. Unlike reading a web page, connector, MCP read tool, webhook payload, tainted wiki page or tainted bot_ref handoff — which mark the turn outside-data and withhold standing rules — a turn in which the teammate reads a file you attached stays an untainted turn you started, so your standing approvals and its rule and routine tools stay available in it. If you forward a document from someone you do not trust, treat it with the same caution as untrusted external content. An image is shown to the model as you sent it, metadata included.

Forgetting is visible, not approved. In a turn you started, a bot can drop a standing rule with forget_memory without asking you first, the same way it can save one. Turns started by a routine, a webhook or a teammate cannot change rules at all. Every removal posts a red diff chip in its thread, so a rule that vanished because of something the bot read shows up there.

Rules for you

  1. Give bots their own accounts, never yours. Separate email, separate calendar, invited only into what they need. A bot with its own account has a blast radius; a bot with yours has your life.
  2. Sign in to only what the job needs. Sessions live in the bot's browser profile on your disk (gateway/data/bots/<id>/browser from source, or inside the container for Docker), and they are as powerful as the account behind them.
  3. Keep the gateway on loopback. For remote access, tunnel — see always-on.md. If you must bind 0.0.0.0, the token still guards it, but put TLS in front.
  4. Cap spend twice: a limit on the API key at your provider, and OPENSUPERBOT_DAILY_TOKENS here.
  5. Rotate the token if it leaked: delete <data>/auth-token and restart. Every browser signs in again.
  6. Treat a webhook address like a password. Anyone holding it can wake that routine with any body. If one leaked, delete the routine and ask for a new one.

Where secrets live

Secret Where
Model API keys OPENSUPERBOT_API_KEY stays in memory and is never written to disk. Keys saved in the setup wizard or AI models live in <data>/llm-key and <data>/llm-keys/<id>, outside SQLite and outside every container mount and command sandbox, readable only by your account (0600 in a 0700 folder on macOS and Linux; a reset user-only ACL on Windows). The API only ever returns a saved key masked.
Gateway token <data>/auth-token, readable by your account only (0600; on Windows the gateway resets the file's access list, removes inherited access and grants only you, and warns if it cannot), or OPENSUPERBOT_TOKEN if you pin one. Set OPENSUPERBOT_QUIET_TOKEN=1 to keep it out of service logs (the desktop app sets this automatically and scrubs tokens and API keys from diagnostics).
Bot logins Each bot's browser profile: inside its container (Docker), or under <data>/bots/<id>/browser (local). The gateway never sees a password.
Shim token, VNC password Generated per container at creation, kept in that container's environment.
Webhook keys One per webhook routine, in the gateway's SQLite database. Shown only in the computer panel — inside the address, and on its own as the Secret for GitHub — and in the token-guarded routine listing the panel reads.
Composio key & app OAuth tokens Optional. OPENSUPERBOT_COMPOSIO_API_KEY stays in memory and is never written to disk; a key saved in Connectors lives in <data>/composio-key (0600 on macOS and Linux; a reset user-only ACL on Windows), outside SQLite and outside every container mount and command sandbox, and is returned by the API only masked. Upstream OAuth tokens for connected apps are vaulted by Composio (backend.composio.dev), not stored on disk.
MCP server secrets Optional. Per-server stdio env values and HTTP headers saved in Connectors → MCP live in <data>/mcp-secrets.json (0600 on macOS and Linux; a reset user-only ACL on Windows), outside SQLite and outside every container mount and command sandbox. SQLite stores only key names (env_keys_json, header_keys_json), the API returns saved values only masked, and HTTP MCP servers connect directly from the gateway to your configured URL with zero third-party relay.
Vault credentials Optional. Website logins, TOTP seeds, API secrets and personal info values saved in Vault live in <data>/vault-secrets.json (0600 on macOS and Linux; a reset user-only ACL on Windows), outside SQLite and outside every container mount and command sandbox. SQLite stores only item metadata, domain allowlists and field names (vault_items, bot_vault_items). Values are injected directly by the gateway via browser_fill_secret, workflow { kind: 'vault' } bindings, or MCP ${vault:<slug>.<field>} references without entering the model prompt. Keep allowedDomains narrow: once filled into a page on an allowed origin, JavaScript on that origin can read the DOM input value.
Meeting STT API key Optional. OPENSUPERBOT_STT_API_KEY stays in memory and is never written to disk; a dedicated transcription key saved in Meeting notes lives in <data>/stt-key (0600 on macOS and Linux; a reset user-only ACL on Windows; lstat/O_NOFOLLOW guarded), outside SQLite and outside every container mount and command sandbox. Changing the STT baseURL without supplying a new key automatically clears <data>/stt-key, and the API only ever returns the saved key masked.

Composio custody boundary

Unlike local model keys, gateway tokens and browser profiles — which never leave your disk and need zero third-party middlemen — Connectors → Apps (Gmail, Outlook, Google Calendar, Outlook Calendar, Notion, Slack) is opt-in. When you configure the Composio connector driver and authorize an app, <data>/composio-key stays 0600 on your disk (owner-only ACL on Windows), while the OAuth refresh and access tokens for those connected apps are vaulted by Composio's service (backend.composio.dev, or OPENSUPERBOT_COMPOSIO_BASE) and connector API requests transit Composio to reach the upstream provider. Leave Apps unconfigured if you want every credential and session to stay strictly on your own machine.

MCP servers (stdio and Streamable HTTP) host boundary

Standard MCP servers configured in Connectors → MCP keep every credential on your own machine: <data>/mcp-secrets.json is written atomically at 0600 (owner-only ACL on Windows) outside SQLite and outside every teammate's workspace, container and command sandbox, and remote Streamable HTTP servers (including 2024-11-05 HTTP+SSE fallback, which enforces a strict same-origin check on endpoint redirects before sending headers) connect directly from the gateway to the URL you configured with zero third-party relay.

Know the host boundary for local stdio servers before adding one: a stdio MCP subprocess (npx, uvx, or a local binary) runs as your user on the gateway host, outside any teammate's Seatbelt/bubblewrap command sandbox or Docker container. That is why only you — signed in to the gateway — can add, edit, import or delete MCP servers, why models have no tool to configure them, and why the gateway spawns stdio children with shell: false and strips OPENSUPERBOT_*, model API keys, Composio keys and gateway tokens from their environment (passing only a short OS baseline allowlist plus the explicit env keys you set for that server). Only connect stdio servers whose code you trust to run on the host. Regardless of transport, every MCP tool defaults to write (kind: 'other', never auto-remembered into a standing rule, executed once by the gateway after Approve with uncertain non-replay on mid-flight failure), and every read MCP tool marks the turn outside-data so external output cannot trigger standing rules.

The desktop app

The Electron shell (desktop.md) wraps the same gateway without giving web content desktop privileges:

  • Sandboxed renderer, no Node. Every window runs with contextIsolation: true, sandbox: true, nodeIntegration: false, nodeIntegrationInSubFrames: false and webviewTag: false.
  • Cookie sign-in, no token in URLs or logs. Main reads OPENSUPERBOT_TOKEN or <data>/auth-token directly and sets the HttpOnly, SameSite=Strict session cookie for http://127.0.0.1:<port> before loading the UI. Logs (logs/gateway.log) and copied diagnostics scrub gateway tokens, ?key= query strings, Bearer headers and sk- / xai- / AIza / gsk_ keys.
  • Narrow, origin-checked preload. Only the main window receives window.opensuperbot, frozen to info() and loginItem.get() / loginItem.set(on). Every ipcMain handler checks senderFrame and rejects calls from anything other than the top-level gateway loopback page (data: error pages, iframes and other origins are refused and logged).
  • Locked navigation and permissions. Windows and subframes may navigate or redirect only to the gateway's loopback origin (http: / https: links elsewhere open in your system browser; file:, javascript: and custom schemes are blocked). Only notifications, clipboard-sanitized-write, and audio-only microphone access (media restricted to audio only, granted solely to the top-level gateway loopback main frame in the primary window for explicit user-initiated Meeting Notes recording with immediate track teardown; sandboxed iframes, opaque origins, and child windows are denied) are allowed; camera (video), geolocation and clipboard reading remain denied.
  • One opt-out release check, no auto-updater. The macOS build is ad-hoc signed (not notarized) and Linux packages are not signed by a repository key, so the app never downloads or installs code updates automatically. When Check for a newer version on startup is enabled in Settings, startup sends one GET to https://api.github.com/repos/wolfqing/OpenSuperBot/releases/latest with no account or machine id, accepts only X.Y.Z release tags whose page is under https://github.com/wolfqing/OpenSuperBot/releases/, and shows a download link. Turning the setting off stops the request completely.
  • No --no-sandbox fallback on Linux. On Ubuntu 24.04+, the .deb installs narrow AppArmor userns profiles for /opt/OpenSuperBot/opensuperbot, its downloaded Chrome for Testing, and /usr/bin/bwrap. Under an AppImage where AppArmor blocks unprivileged user namespaces, the commands switch stays locked and explains why rather than running commands or browsers without a sandbox.

Local computers

A local computer is weaker than a container in ways you should know before you give one an account that matters:

  • It runs as you. The browser and any command run as your user on your machine. The sandbox confines the file system, not the network: a command can reach anything your machine can, including services on localhost. It cannot read the gateway token, so it cannot drive the gateway — but a service of yours that trusts localhost without a password is reachable.
  • System services stay partly reachable. The sandbox confines files, not the whole operating system: a command can read system libraries, /opt and /etc (though /Volumes and host /tmp are hidden), and on macOS Seatbelt blocks pasteboard, LaunchServices and AppleEvents Mach services and cross-sandbox signals, while other system IPC remains reachable.
  • No resource limits. Nothing caps a local teammate's memory or CPU; a runaway command is killed only by its timeout (ten minutes at most) or the stop button.
  • The profile is a file. The teammate's cookies live under <data>/bots/<id>/browser, readable by any program running as your user — the same standing as your own browser profile, no better.
  • Chromium's own sandbox stays on, which it cannot inside a container. Pages the teammate visits get the protection your own browser gives you.
  • A file placed on a local computer goes through a check, not a wall. The gateway checks that the uploads/ path stays inside the teammate's folder and refuses to follow a link at the file name, as write_file does. A teammate with commands on could in principle swap a folder for a link between the check and the write; a container computer has no such gap, because there the path is resolved inside the container.
  • On Windows, a local computer has no commands. It gets the browser and the folder; Windows has no sandbox as mature as the two above, so the switch for commands stays off. File access is the gateway's own check, which on Windows also refuses other drives, network shares, device names such as CON, and alternate data streams.

If a job needs a Linux of its own, software installed, or stronger isolation, give that teammate a Docker computer.

What self-hosting buys you

Risk Hosted (Grok Bot) Self-hosted (this repo)
Where your sessions live the vendor's cloud VM your disk (browser profiles and <data>/mcp-secrets.json); Composio only for apps you opt in to via Connectors
Who can subpoena, breach or train on them the vendor you (plus whichever remote MCP endpoints or Composio apps you opt in to)
Kill switch a support ticket the stop button, docker stop, or the power cable
Audit trail what the vendor shows you every message and every action in SQLite on your disk

The threat you still own

If a workflow would make a bot both read strangers' input and act outward, keep a human decision in the loop — or redesign the workflow. The approval chip is where that decision happens; keep it meaningful by giving bots accounts whose worst case you can live with.