Kuyuchi Clawdbot Threat Model (Pre-Implementation)
Date: 2026-02-18
Status: Draft, design gate for implementation
Applies to: planned kuyuchi-clawdbot minimal runtime profile
Code mapping: src/cuti/services/devcontainer.py (RUNTIME_SECURITY_CHECKLIST, runtime profile validation, seccomp enforcement)
1. Purpose
Define a strict security model for the minimal Clawdbot/OpenClaw container so blast radius is limited to:
- the assigned workspace
- explicitly mounted bot state
- allowed network communication paths
This document is a security gate before code changes.
2. Security Objectives
2.1 Primary objectives
Workspace confinement
Bot runtime can access only the mounted workspace plus explicit state path.
Host protection
Bot runtime cannot control host Docker, host kernel, or host filesystem beyond allowed mounts.
Network-enabled operation
Bot runtime can reach required messaging/broker/provider endpoints.
Operational control and visibility
Operators can monitor runtime policy state, active mounts, and runtime health in dashboard.
2.2 Non-objectives
- Preventing all outbound data exfiltration from compromised bot logic (this requires endpoint-specific egress policy and DLP, not just container isolation).
- Protecting against full host root compromise outside container runtime guarantees.
3. System Under Review
Current behavior (from repository):
- Unified container path for cloud util and Clawdbot (
src/cuti/services/devcontainer.py).
cuti clawdbot disables Docker socket mount (src/cuti/cli/commands/clawdbot.py:428), but still reuses broad runtime path.
- Runtime still uses host network (
src/cuti/services/devcontainer.py:750) and mounts host ~/.cuti wholesale (src/cuti/services/devcontainer.py:736).
- Bootstrap script includes privileged setup steps (
sudo, socket permission mutation, ownership rewrites) in src/cuti/services/devcontainer.py:808 and src/cuti/services/devcontainer.py:1056.
Security implication:
- Current clawdbot path has reduced host-Docker exposure compared with full cloud mode, but is not minimal-isolation.
4. Assets and Classification
| Asset |
Examples |
Classification |
Security need |
| Host system control plane |
Docker daemon/socket, kernel interfaces |
Critical |
Must be unreachable |
| Host filesystem outside workspace |
home dir, SSH keys, credentials |
Critical |
Must be unreachable |
| Bot credentials/secrets |
channel tokens, OAuth artifacts |
High |
Confidentiality + integrity |
| Workspace files |
project code/data |
High |
Integrity + scoped confidentiality |
| Runtime policy metadata |
mounts, flags, active profile |
Medium |
Integrity + operator visibility |
| Runtime logs |
gateway logs, security/audit events |
Medium |
Integrity + retention |
5. Trust Boundaries
Host OS / Docker runtime boundary
Untrusted bot execution must not cross into host control plane.
Container filesystem boundary
Only explicit bind mounts are trusted exposure points.
Network boundary
Outbound traffic required; ingress should be explicit and minimal.
Control plane boundary
Dashboard/CLI actions that start/stop/configure runtime must be authenticated and auditable.
6. Threat Actors and Capabilities
Malicious prompt input / remote message sender
Can induce arbitrary tool and shell actions through agent behavior.
Compromised plugin or tool dependency
Executes arbitrary code inside bot runtime.
Curious insider with project access
Tries to pivot from workspace to host/system controls.
External network attacker
Targets exposed ports/services or browser automation endpoints.
7. Entry Points and Attack Surface
- Clawdbot command execution path (
cuti clawdbot ...).
- Container runtime flags and mounts (
docker run arguments).
- Plugin/tool install and execution chain.
- Browser automation subsystem (local browser or remote browser endpoint).
- Gateway/network listeners and control UI ports.
- State/config directories and symlink/link logic.
8. Abuse Cases (What Must Be Prevented)
Host Docker takeover
Attacker reaches /var/run/docker.sock and starts privileged host containers.
Filesystem breakout via broad mounts
Attacker reads secrets outside assigned workspace.
Container escape amplification
Excess Linux capabilities or permissive seccomp enables kernel attack primitives.
Network pivot through host mode
Host network exposure increases lateral movement and service discovery.
Plugin supply-chain execution with high privileges
Dependency script executes with unnecessary privileges, modifies runtime policy.
Browser tool abuse
Automated browser channel used to exfiltrate secrets from internal resources.
Silent policy drift
Runtime starts without expected hardening flags and operators cannot detect it.
9. Threat Analysis (STRIDE-Oriented)
| Threat |
Category |
Current exposure |
Required control |
Detection |
| Start sibling containers via host daemon |
EoP |
Reduced for clawdbot path; still mixed runtime |
Never mount Docker socket in sandbox profile |
Startup policy check + runtime probe |
| Read host files outside workspace |
Info disclosure |
Broad .cuti mount today |
Workspace + explicit state-only mounts |
Mount inventory endpoint |
| Modify runtime policy without trace |
Tampering/Repudiation |
Limited audit trail |
Immutable profile + signed config + audit log |
Dashboard + append-only audit feed |
| Kernel attack via extra caps/syscalls |
EoP |
Not fully minimized |
cap_drop=ALL, seccomp, no-new-privileges, rootless |
Runtime introspection endpoint |
| Lateral scan/pivot using host network |
Info disclosure/Tampering |
--network host currently |
Bridge network + explicit port mappings |
Connection metrics + denied-flow logs |
| Plugin/postinstall compromise |
Tampering |
Toolchain broad and dynamic |
Allowlisted plugins, checksum lock, separate build stage |
Plugin provenance records |
| Browser endpoint misuse |
Info disclosure |
Depends on implementation |
Browser in separate sandbox or remote service with auth |
Browser session/audit logs |
10. Mandatory Security Invariants
The minimal clawdbot profile must satisfy all invariants:
/var/run/docker.sock is not mounted.
- Only approved mounts exist:
/workspace (rw)
/state (rw, optional but explicit)
- no host home root mount
- Container runs as non-root user.
- Capabilities: none beyond baseline (
cap_drop=ALL).
no-new-privileges is enabled.
- Root filesystem is read-only; writable temp via tmpfs.
- Network mode is not host; ingress only via explicit mapped ports.
- Policy/mount/runtime settings are observable from dashboard/CLI.
If any invariant fails, runtime start must fail closed.
11. Required Control Set
11.1 Runtime isolation
--cap-drop=ALL
--security-opt=no-new-privileges:true
--read-only
--tmpfs /tmp:rw,noexec,nosuid,nodev
--tmpfs /run:rw,nosuid,nodev
--pids-limit and memory/cpu limits
- non-root
--user
- optional hardening tier:
- custom seccomp profile
- AppArmor/SELinux profile
- gVisor/Kata runtime class
11.2 Mount policy
- Allowed mounts only:
- workspace path
- dedicated clawdbot state path
- Disallowed:
- host home directory root mounts
- Docker socket
- broad host config mounts unrelated to bot runtime
11.3 Network policy
- bridge mode by default (no host network)
- explicit
-p for UI/gateway if needed
- optional egress allowlist for messaging providers and bot backends
- optional DNS restrictions for high-security mode
11.4 Plugin/tool policy
- allowlisted plugin set
- pinned versions/checksums
- plugin install/build in isolated build stage, not at runtime bootstrap
- disable arbitrary runtime package install in production mode
11.5 Secrets policy
- no secrets in image layers
- mount secrets as files/env only when needed
- rotateable bot state path and credential revocation path
- redact secrets from logs/events
11.6 Observability and control plane
- dashboard endpoints for:
- active profile
- effective mounts
- effective security flags/capabilities
- process/resource/network summary
- append-only audit records for:
- profile changes
- runtime start/stop/restart
- config changes
- policy violations
12. Verification Plan (Pass/Fail Security Tests)
Run these against clawdbot profile on every release:
No Docker socket test
Inside container: /var/run/docker.sock absent -> pass.
Mount confinement test
Inside container cannot read host paths outside mounts -> pass.
Capability drop test
capsh --print (or equivalent) confirms no elevated caps -> pass.
No-new-privileges test
Runtime inspect confirms NoNewPrivileges=true -> pass.
Read-only rootfs test
Write to /usr fails; write to /tmp succeeds -> pass.
Network mode test
Inspect confirms non-host network mode -> pass.
Ingress exposure test
Only explicitly mapped ports reachable from host -> pass.
Policy introspection test
Dashboard/CLI shows effective runtime policy and mounts -> pass.
Audit trail test
Start/stop/config events appear with timestamps and actor/source -> pass.
13. Residual Risks
Application-level exfiltration
Even with strong container isolation, bot logic can exfiltrate workspace data over allowed network.
Zero-day container/runtime escape
Mitigated but not eliminated; stronger runtime isolation reduces impact.
Operator misconfiguration
Wrong profile or custom run args can weaken controls unless fail-closed validation exists.
14. Incident Response Requirements
Minimum response workflow:
- Stop affected clawdbot runtime(s).
- Snapshot logs + policy + config metadata (secrets redacted).
- Revoke/rotate channel/provider credentials.
- Recreate runtime from known-good profile.
- Review audit timeline and tighten policy gaps.
15. Mapping to Planned Implementation
From docs/kuyuchi-container-audit.md, implementation phases should satisfy this model:
- Phase 1: profile split and mount/network separation.
- Phase 2: hardening flags + seccomp + tests.
- Phase 3: dashboard policy visibility + auditability.
No phase can be considered complete unless section 10 invariants and section 12 tests pass.
1---2name: 418-kuyuchi-threat-model-eef4d7433description: Kuyuchi Clawdbot Threat Model (Pre-Implementation)4---5# Kuyuchi Clawdbot Threat Model (Pre-Implementation)67Date: 2026-02-18 8Status: Draft, design gate for implementation 9Applies to: planned `kuyuchi-clawdbot` minimal runtime profile1011Code mapping: `src/cuti/services/devcontainer.py` (`RUNTIME_SECURITY_CHECKLIST`, runtime profile validation, seccomp enforcement)1213## 1. Purpose1415Define a strict security model for the minimal Clawdbot/OpenClaw container so blast radius is limited to:1617- the assigned workspace18- explicitly mounted bot state19- allowed network communication paths2021This document is a security gate before code changes.2223## 2. Security Objectives2425### 2.1 Primary objectives26271. **Workspace confinement** 28Bot runtime can access only the mounted workspace plus explicit state path.29302. **Host protection** 31Bot runtime cannot control host Docker, host kernel, or host filesystem beyond allowed mounts.32333. **Network-enabled operation** 34Bot runtime can reach required messaging/broker/provider endpoints.35364. **Operational control and visibility** 37Operators can monitor runtime policy state, active mounts, and runtime health in dashboard.3839### 2.2 Non-objectives4041- Preventing all outbound data exfiltration from compromised bot logic (this requires endpoint-specific egress policy and DLP, not just container isolation).42- Protecting against full host root compromise outside container runtime guarantees.4344## 3. System Under Review4546Current behavior (from repository):4748- Unified container path for cloud util and Clawdbot (`src/cuti/services/devcontainer.py`).49- `cuti clawdbot` disables Docker socket mount (`src/cuti/cli/commands/clawdbot.py:428`), but still reuses broad runtime path.50- Runtime still uses host network (`src/cuti/services/devcontainer.py:750`) and mounts host `~/.cuti` wholesale (`src/cuti/services/devcontainer.py:736`).51- Bootstrap script includes privileged setup steps (`sudo`, socket permission mutation, ownership rewrites) in `src/cuti/services/devcontainer.py:808` and `src/cuti/services/devcontainer.py:1056`.5253Security implication:5455- Current clawdbot path has reduced host-Docker exposure compared with full cloud mode, but is not minimal-isolation.5657## 4. Assets and Classification5859| Asset | Examples | Classification | Security need |60|---|---|---|---|61| Host system control plane | Docker daemon/socket, kernel interfaces | Critical | Must be unreachable |62| Host filesystem outside workspace | home dir, SSH keys, credentials | Critical | Must be unreachable |63| Bot credentials/secrets | channel tokens, OAuth artifacts | High | Confidentiality + integrity |64| Workspace files | project code/data | High | Integrity + scoped confidentiality |65| Runtime policy metadata | mounts, flags, active profile | Medium | Integrity + operator visibility |66| Runtime logs | gateway logs, security/audit events | Medium | Integrity + retention |6768## 5. Trust Boundaries69701. **Host OS / Docker runtime boundary** 71Untrusted bot execution must not cross into host control plane.72732. **Container filesystem boundary** 74Only explicit bind mounts are trusted exposure points.75763. **Network boundary** 77Outbound traffic required; ingress should be explicit and minimal.78794. **Control plane boundary** 80Dashboard/CLI actions that start/stop/configure runtime must be authenticated and auditable.8182## 6. Threat Actors and Capabilities83841. **Malicious prompt input / remote message sender** 85Can induce arbitrary tool and shell actions through agent behavior.86872. **Compromised plugin or tool dependency** 88Executes arbitrary code inside bot runtime.89903. **Curious insider with project access** 91Tries to pivot from workspace to host/system controls.92934. **External network attacker** 94Targets exposed ports/services or browser automation endpoints.9596## 7. Entry Points and Attack Surface97981. Clawdbot command execution path (`cuti clawdbot ...`).992. Container runtime flags and mounts (`docker run` arguments).1003. Plugin/tool install and execution chain.1014. Browser automation subsystem (local browser or remote browser endpoint).1025. Gateway/network listeners and control UI ports.1036. State/config directories and symlink/link logic.104105## 8. Abuse Cases (What Must Be Prevented)1061071. **Host Docker takeover** 108Attacker reaches `/var/run/docker.sock` and starts privileged host containers.1091102. **Filesystem breakout via broad mounts** 111Attacker reads secrets outside assigned workspace.1121133. **Container escape amplification** 114Excess Linux capabilities or permissive seccomp enables kernel attack primitives.1151164. **Network pivot through host mode** 117Host network exposure increases lateral movement and service discovery.1181195. **Plugin supply-chain execution with high privileges** 120Dependency script executes with unnecessary privileges, modifies runtime policy.1211226. **Browser tool abuse** 123Automated browser channel used to exfiltrate secrets from internal resources.1241257. **Silent policy drift** 126Runtime starts without expected hardening flags and operators cannot detect it.127128## 9. Threat Analysis (STRIDE-Oriented)129130| Threat | Category | Current exposure | Required control | Detection |131|---|---|---|---|---|132| Start sibling containers via host daemon | EoP | Reduced for clawdbot path; still mixed runtime | Never mount Docker socket in sandbox profile | Startup policy check + runtime probe |133| Read host files outside workspace | Info disclosure | Broad `.cuti` mount today | Workspace + explicit state-only mounts | Mount inventory endpoint |134| Modify runtime policy without trace | Tampering/Repudiation | Limited audit trail | Immutable profile + signed config + audit log | Dashboard + append-only audit feed |135| Kernel attack via extra caps/syscalls | EoP | Not fully minimized | `cap_drop=ALL`, seccomp, no-new-privileges, rootless | Runtime introspection endpoint |136| Lateral scan/pivot using host network | Info disclosure/Tampering | `--network host` currently | Bridge network + explicit port mappings | Connection metrics + denied-flow logs |137| Plugin/postinstall compromise | Tampering | Toolchain broad and dynamic | Allowlisted plugins, checksum lock, separate build stage | Plugin provenance records |138| Browser endpoint misuse | Info disclosure | Depends on implementation | Browser in separate sandbox or remote service with auth | Browser session/audit logs |139140## 10. Mandatory Security Invariants141142The minimal clawdbot profile must satisfy all invariants:1431441. `/var/run/docker.sock` is not mounted.1452. Only approved mounts exist:146 - `/workspace` (rw)147 - `/state` (rw, optional but explicit)148 - no host home root mount1493. Container runs as non-root user.1504. Capabilities: none beyond baseline (`cap_drop=ALL`).1515. `no-new-privileges` is enabled.1526. Root filesystem is read-only; writable temp via tmpfs.1537. Network mode is not host; ingress only via explicit mapped ports.1548. Policy/mount/runtime settings are observable from dashboard/CLI.155156If any invariant fails, runtime start must fail closed.157158## 11. Required Control Set159160### 11.1 Runtime isolation161162- `--cap-drop=ALL`163- `--security-opt=no-new-privileges:true`164- `--read-only`165- `--tmpfs /tmp:rw,noexec,nosuid,nodev`166- `--tmpfs /run:rw,nosuid,nodev`167- `--pids-limit` and memory/cpu limits168- non-root `--user`169- optional hardening tier:170 - custom seccomp profile171 - AppArmor/SELinux profile172 - gVisor/Kata runtime class173174### 11.2 Mount policy175176- Allowed mounts only:177 - workspace path178 - dedicated clawdbot state path179- Disallowed:180 - host home directory root mounts181 - Docker socket182 - broad host config mounts unrelated to bot runtime183184### 11.3 Network policy185186- bridge mode by default (no host network)187- explicit `-p` for UI/gateway if needed188- optional egress allowlist for messaging providers and bot backends189- optional DNS restrictions for high-security mode190191### 11.4 Plugin/tool policy192193- allowlisted plugin set194- pinned versions/checksums195- plugin install/build in isolated build stage, not at runtime bootstrap196- disable arbitrary runtime package install in production mode197198### 11.5 Secrets policy199200- no secrets in image layers201- mount secrets as files/env only when needed202- rotateable bot state path and credential revocation path203- redact secrets from logs/events204205### 11.6 Observability and control plane206207- dashboard endpoints for:208 - active profile209 - effective mounts210 - effective security flags/capabilities211 - process/resource/network summary212- append-only audit records for:213 - profile changes214 - runtime start/stop/restart215 - config changes216 - policy violations217218## 12. Verification Plan (Pass/Fail Security Tests)219220Run these against clawdbot profile on every release:2212221. **No Docker socket test** 223Inside container: `/var/run/docker.sock` absent -> pass.2242252. **Mount confinement test** 226Inside container cannot read host paths outside mounts -> pass.2272283. **Capability drop test** 229`capsh --print` (or equivalent) confirms no elevated caps -> pass.2302314. **No-new-privileges test** 232Runtime inspect confirms `NoNewPrivileges=true` -> pass.2332345. **Read-only rootfs test** 235Write to `/usr` fails; write to `/tmp` succeeds -> pass.2362376. **Network mode test** 238Inspect confirms non-host network mode -> pass.2392407. **Ingress exposure test** 241Only explicitly mapped ports reachable from host -> pass.2422438. **Policy introspection test** 244Dashboard/CLI shows effective runtime policy and mounts -> pass.2452469. **Audit trail test** 247Start/stop/config events appear with timestamps and actor/source -> pass.248249## 13. Residual Risks2502511. **Application-level exfiltration** 252Even with strong container isolation, bot logic can exfiltrate workspace data over allowed network.2532542. **Zero-day container/runtime escape** 255Mitigated but not eliminated; stronger runtime isolation reduces impact.2562573. **Operator misconfiguration** 258Wrong profile or custom run args can weaken controls unless fail-closed validation exists.259260## 14. Incident Response Requirements261262Minimum response workflow:2632641. Stop affected clawdbot runtime(s).2652. Snapshot logs + policy + config metadata (secrets redacted).2663. Revoke/rotate channel/provider credentials.2674. Recreate runtime from known-good profile.2685. Review audit timeline and tighten policy gaps.269270## 15. Mapping to Planned Implementation271272From `docs/kuyuchi-container-audit.md`, implementation phases should satisfy this model:273274- Phase 1: profile split and mount/network separation.275- Phase 2: hardening flags + seccomp + tests.276- Phase 3: dashboard policy visibility + auditability.277278No phase can be considered complete unless section 10 invariants and section 12 tests pass.