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
$SHELLenvironment 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 level | Examples | Handling |
|---|---|---|
| Safe | Reading files, git status | Allowed automatically |
| Low | Listing, searching | Allowed automatically and logged |
| Medium | Writing files, git add | Allowed by default; configurable |
| High | Executing commands, git push | Requires user confirmation |
| Critical | Deleting directories, rm -rf | Mandatory 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, andcargoare allowed by default). - Docker: container-level isolation, with
cap-drop ALLandno-new-privilegessecurity 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.
Was this page helpful?