A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
DS Bot security model
The threat model that security reviews and scans of this repository start from. Infrastructure is docker/ and docker-compose.yml in this repository.
System overview and trust boundaries
DS Bot is a team of long-lived LLM Bots built as a plugin on DeepSeek Harness (DSH). It runs in three ways:
- DSH Desktop / DSH Web with the
ds-botplugin, on the user's own computer. - Desktop app (
app/, Electron) that runs a pinned DSH with the plugin in its ownDSH_HOME, and imports a team from~/.dsh(read only). - Docker (
docker/,docker-compose.yml):dsh webon0.0.0.0:3080(published as0.0.0.0:13080),DSH_PERMISSION_MODE=danger-full-access, approvalnever. The container is the sandbox boundary.
Trust boundaries:
- Untrusted content -> model -> Bot tools. Web pages, files, search results, connector/MCP results and messages from other Bots reach the model; the model's tool calls run with the Bot's permission preset.
- Ordinary Bot -> Main Bot rights (create/change/stop Bots, groups, folders), enforced in
ds-bot/src/host/tools.jsviart.isMain. - Model/tool output -> outbound model requests (secret redaction in
ds-bot/src/host/secrets.js). - Browser renderer -> host:
POST /api/botchannel (ds-bot/src/host/channel.js,ROUTEinconstants.js) and Electron IPC (app/src/main.mjs,preload.cjs). - Bot-produced HTML widgets -> app page (
ds-bot/src/client/widget-html.js,sandbox="allow-scripts"iframe without same-origin). - Bot browser pages -> app (
app/src/bot-browser.mjs,bot-views.mjs: sandboxed, contextIsolation, own partition).
Components
- host — plugin server side:
ds-bot/index.js,ds-bot/src/host/(roster, tools, turns/delivery, groups, goals, parts, memory, schedules, permissions, privacy, folders, connectors, providers). - secrets —
ds-bot/src/host/secrets.js(secrets.json mode 600,$DSH_SECRET_<NAME>, redactor) and API keys/providers (providers.js,models.js). - client — browser UI:
ds-bot/src/client/(incl. widget-html, read-page, connectors UI) and generatedds-bot/client.js. - browser — Bot browser bridge and browser plugins:
ds-bot/src/host/browser.js,browser-plugins.js,src/host/browser/,browser-plugins/. - desktop-app — Electron app:
app/src/(main, start-window, preload, IPC, cookie import, updates, import from~/.dsh, move-data),app/engine/. - web-search —
ds-bot/web-search.js. - docker —
docker/Dockerfile,entrypoint.sh,docker.patch.yml,docker-compose.yml.
Entry points and who reaches them
- Chat input from the user (trusted).
- Content the Bot reads: web pages (Bot browser,
read_browser, web search), files in the work folder, connector/MCP tool results, messages from other Bots and group chats, scheduled-task prompts. Attacker-controlled. /api/botHTTP endpoints and DSH Web UI: the local user; in Docker, anyone who can reach port 13080 (DSH trusted-host list + launch token).- Electron IPC from the app window.
Assets (maintainer-ranked)
- Critical: API keys and Bot secrets — provider keys,
secrets.json,$DSH_SECRET_*, connector tokens. Must not leak to the model, logs, tool results, other Bots outside the secret's scope, or outbound requests. - Critical: files on the user's computer — outside the Bot's work folder;
~/.dshmust never be written by the app. - Other: imported cookies / browser login state, conversations and memory.
Attacker profiles
- Primary (maintainer-confirmed): prompt injection in web pages, files or messages that makes a Bot exceed its rights — exfiltrate keys/secrets, read or write user files outside its scope, gain Main Bot rights, change other Bots, bypass the permission preset or redaction.
- Lower concern (not chosen by the maintainer): LAN users reaching the Docker web UI, malicious browser plugins or connectors, a rogue ordinary Bot acting by itself.
Existing controls
- Main-Bot checks in
tools.js(rt.isMain,rt.isAdminOf). - Working folders, the team workspace and Bot photos stay out of DSH's data and the team's data (
folders.jsguarded/inData). - Private Bots (
privacy.js): user-only switch; other Bots cannot read a private Bot's working folder, memory or Sessions, and a private Bot's outbound sharing (message_bot, shared capabilities, writes outside its folder) requires user approval; protection stays after deletion until the user releases it in Settings. - Per-Bot permission presets (
permissions.js), set on every Session. - Secrets: scoped per Bot (
canUse), redacted from tool results and outbound model requests (redactor, JSON/URL-encoded forms). - Connectors refuse non-HTTPS addresses (
connectors.js). - HTML widgets in
sandbox="allow-scripts"iframes; Electron webviews sandboxed with contextIsolation and own partitions; IPC handlers callassertWindow(event). - Cookie values stay in the Electron main process (
cookie-import.mjs). - Launch token redacted from host logs (
host-process.mjs).
Out of scope / accepted risk (maintainer)
- Docker edition: Bots have full access inside the container by design (
danger-full-access, approvalnever). A Bot changing or reading files inside the container is not a finding; escaping the container or leaking keys/secrets still is. - DSH itself is upstream; not explicitly ruled out, but fixes belong upstream (hard rule: never patch DSH).
Open questions
- Is the Docker web UI expected to be reachable only on a trusted LAN?
- Should a secret scoped to one Bot be treated as hidden from Main Bots too?