Skip to main content

Module computer_use

Module computer_use 

Source
Expand description

ComputerUseGuard - coarse gate for Computer Use Agent (CUA) actions.

Roadmap phase 5.1. Ported from ClawdStrike’s guards/computer_use.rs and adapted to Chio’s synchronous chio_kernel::Guard trait.

The guard is a coarse-grained allowlist for CUA action types. It recognises three surfaces that arrive on the kernel:

  1. Remote-session and side-channel actions - tool names or action_type/custom_type arguments that start with remote. or input. (e.g., remote.clipboard, input.inject). The action-type string is matched against a configurable allowlist.
  2. ToolAction::BrowserAction - browser navigation verbs. The guard denies navigation to configured blocked domains.
  3. Screenshot actions (subset of ToolAction::BrowserAction with a screenshot-family verb) - rate-limited via a token bucket so a runaway agent cannot drain the capture channel.

Enforcement modes:

ModeBehavior
EnforcementMode::ObserveAlways allow; logs every decision
EnforcementMode::GuardrailAllow if in allowlist, warn otherwise (default)
EnforcementMode::FailClosedAllow if in allowlist, deny otherwise

Fail-closed semantics:

  • ToolAction::Unknown / non-CUA actions → Verdict::Allow;
  • invalid configuration → best-effort fallback to defaults at build time (never panics);
  • token-bucket mutex poisoning → treated as no-tokens (deny).

Structs§

ComputerUseConfig
Configuration for ComputerUseGuard.
ComputerUseGuard
Coarse gate for CUA actions.

Enums§

EnforcementMode
Enforcement modes for ComputerUseGuard.

Functions§

default_allowed_action_types
Default allowlist of CUA action-type strings.