Feature Guides / Integrated Terminal

Integrated Terminal

LingXizhi ships a PTY-based integrated terminal, with two lines of defense for AI-initiated commands: risk-tiered interception and sandbox isolation.

Integrated Terminal

  • Supports multiple sessions in parallel, each with its own working directory and window size.
  • Default shell: PowerShell on Windows; on macOS / Linux it reads the $SHELL environment variable and falls back to /bin/bash.
  • Command execution has timeout control — on timeout, the command is terminated automatically and the output produced so far is returned.

Dangerous-Command Interception

All commands (including those initiated by the AI) are classified into five risk levels:

Risk levelExamplesHandling
SafeReading files, git statusAllowed automatically
LowListing, searchingAllowed automatically and logged
MediumWriting files, git addAllowed by default; configurable
HighExecuting commands, git pushRequires user confirmation
CriticalDeleting directories, rm -rfMandatory manual approval

Command strings also pass shell metacharacter filtering, blocking injection risks from ; | & $ and similar characters.

Sandbox Execution

Enable and configure the sandbox in the sandbox section of lxz.config.json:

Process sandboxDocker sandbox
{
  "sandbox": {
    "enabled": true,
    "type": "process",
    "max_memory_mb": 512,
    "max_cpu_percent": 80,
    "timeout_sec": 300,
    "network_enabled": false
  }
}

Three isolation modes:

  • Process: process-level isolation. Uses seccomp + namespaces + rlimits on Linux, and Job Objects on Windows; supports command allowlists/blocklists and a network access allowlist (network-requiring commands such as curl, git, npm, pip, and cargo are allowed by default).
  • Docker: container-level isolation, with cap-drop ALL and no-new-privileges security hardening enabled by default.
  • Cloud: submits tasks to a cloud sandbox for execution, using zero local resources.
!

The sandbox is disabled by default (enabled: false). When handling untrusted code or letting the AI execute commands freely, it is recommended to enable the sandbox and keep network_enabled set to false.