Security

May 13, 2026 ยท View on GitHub

pi-cua-integration gives an LLM agent the ability to drive a real GUI: type, click, scroll, run shell commands, and execute end-to-end tasks. This document covers the threat model and mitigations.

Threat model

What we defend againstHow
Untrusted code escaping into your dev machineDefault local mode uses a sandbox (Docker or VM).
Accidental destructive actions on the hostlocalhost mode prompts before destructive shell.
Cloud data leaks via Cua telemetryCUA_TELEMETRY_ENABLED=false forced by default.
Unintended host controlDefault mode is sandboxed local; localhost must be set explicitly in config.
Wrong sandbox name escalating to unintended targetThe manager rejects unknown sandbox names.
Stale sandboxes leaking across sessionsephemeral: true (default) destroys sandboxes on session shutdown.
What we do not defend againstMitigation
Container/VM escape (kernel exploits in Docker/QEMU)Keep Docker / QEMU up to date. Use a hardened host.
Prompt injection in screenshot contentAnthropic / OpenAI computer-use classifiers; review actions.
Malicious Python packages in pip install cuaPin Cua version, audit dependencies.
Compromised LiteLLM provider keysRotate keys; scope to least privilege.
Host-side automation while running localhostRun only when explicitly opted in.

Per-mode risk

local

Lowest risk. Actions happen inside a Docker container or VM. The container's network usually has internet access unless you configure otherwise inside the image.

cloud

Actions run in cua.ai's infrastructure. Data passing through the cloud sandbox is subject to Cua's privacy policy. Do not paste production secrets into a cloud sandbox.

localhost

Highest risk. The agent can read clipboard, take screenshots of any window, type into any focused app, and run shell commands as your user. Use only for trusted automations.

  1. Pin Cua: pip install cua==<version>; do not use latest in production.
  2. Scope LLM keys: Use separate provider keys for the pi agent driving cua, and rotate often.
  3. Block destructive shell by default (confirmDestructive: true).
  4. Set ephemeral: true so sandboxes are destroyed at session shutdown.
  5. Review skills: the bundled skills are read-only inside the extension package; users can not modify them at runtime.
  6. Audit screenshot content: never auto-OCR screenshots back into the agent context if they may contain secrets.

Environment isolation matrix

Resourcelocal (container)local (VM)localhostcloud
Filesystemcontainer fsguest fshost fsguest fs
Networkcontainer networkguest networkhost networkguest network
Process treecontainer PID nsguest kernelhostguest kernel
Clipboardvirtualvirtualshared hostvirtual
DisplayXFCE inside containerguest GUIshared hostguest GUI

Reporting vulnerabilities

Open a private security advisory at the GitHub repository. Do not file public issues for security topics.