TaskFlow
DashboardFreewriteWhiteboardsProjectsCRMTasksNotificationsSettingsAgent TowerAPI Docs
OpenClaw Docs
?

User

Member

Caricamento in corso...

Home
Progetti
Task
Notifiche
CRM

    OpenClaw

    Documentation Mirror

    Documentation Overview

    Docs

    Auth credential semantics
    Scheduled tasks
    Hooks
    Automation & tasks
    Standing orders
    Task flow
    Background tasks
    BlueBubbles
    Broadcast groups
    Channel routing
    Discord
    Feishu
    Google Chat
    Group messages
    Groups
    iMessage
    Chat channels
    IRC
    LINE
    Channel location parsing
    Matrix
    Matrix migration
    Matrix push rules for quiet previews
    Mattermost
    Microsoft Teams
    Nextcloud Talk
    Nostr
    Pairing
    QA channel
    QQ bot
    Signal
    Slack
    Synology Chat
    Telegram
    Tlon
    Channel troubleshooting
    Twitch
    WeChat
    WhatsApp
    Yuanbao
    Zalo
    Zalo personal
    CI pipeline
    ACP
    Agent
    Agents
    Approvals
    Backup
    Browser
    Channels
    Clawbot
    `openclaw commitments`
    Completion
    Config
    Configure
    Cron
    Daemon
    Dashboard
    Devices
    Directory
    DNS
    Docs
    Doctor
    Flows (redirect)
    Gateway
    Health
    Hooks
    CLI reference
    Inference CLI
    Logs
    MCP
    Memory
    Message
    Migrate
    Models
    Node
    Nodes
    Onboard
    Pairing
    Plugins
    Proxy
    QR
    Reset
    Sandbox CLI
    Secrets
    Security
    Sessions
    Setup
    Skills
    Status
    System
    `openclaw tasks`
    TUI
    Uninstall
    Update
    Voicecall
    Webhooks
    Wiki
    Active memory
    Agent runtime
    Agent loop
    Agent runtimes
    Agent workspace
    Gateway architecture
    Channel docking
    Inferred commitments
    Compaction
    Context
    Context engine
    Delegate architecture
    Dreaming
    Experimental features
    Features
    Markdown formatting
    Memory overview
    Builtin memory engine
    Honcho memory
    QMD memory engine
    Memory search
    Messages
    Model failover
    Model providers
    Models CLI
    Multi-agent routing
    OAuth
    OpenClaw App SDK
    Presence
    QA overview
    Matrix QA
    Command queue
    Steering queue
    Retry policy
    Session management
    Session pruning
    Session tools
    SOUL.md personality guide
    Streaming and chunking
    System prompt
    Timezones
    TypeBox
    Typing indicators
    Usage tracking
    Date and time
    Node + tsx crash
    Diagnostics flags
    Authentication
    Background exec and process tool
    Bonjour discovery
    Bridge protocol
    CLI backends
    Configuration — agents
    Configuration — channels
    Configuration — tools and custom providers
    Configuration
    Configuration examples
    Configuration reference
    Diagnostics export
    Discovery and transports
    Doctor
    Gateway lock
    Health checks
    Heartbeat
    Gateway runbook
    Local models
    Gateway logging
    Multiple gateways
    Network model
    OpenAI chat completions
    OpenResponses API
    OpenShell
    OpenTelemetry export
    Gateway-owned pairing
    Prometheus metrics
    Gateway protocol
    Remote access
    Remote gateway setup
    Sandbox vs tool policy vs elevated
    Sandboxing
    Secrets management
    Secrets apply plan contract
    Security audit checks
    Security
    Tailscale
    Tools invoke API
    Troubleshooting
    Trusted proxy auth
    Debugging
    Environment variables
    FAQ
    FAQ: first-run setup
    FAQ: models and auth
    GPT-5.5 / Codex agentic parity
    GPT-5.5 / Codex parity maintainer notes
    Help
    Scripts
    Testing
    Testing: live suites
    General troubleshooting
    OpenClaw
    Ansible
    Azure
    Bun (experimental)
    ClawDock
    Release channels
    DigitalOcean
    Docker
    Docker VM runtime
    exe.dev
    Fly.io
    GCP
    Hetzner
    Hostinger
    Install
    Installer internals
    Kubernetes
    macOS VMs
    Migration guide
    Migrating from Claude
    Migrating from Hermes
    Nix
    Node.js
    Northflank
    Oracle Cloud
    Podman
    Railway
    Raspberry Pi
    Render
    Uninstall
    Updating
    Logging
    Network
    Audio and voice notes
    Camera capture
    Image and media support
    Nodes
    Location command
    Media understanding
    Talk mode
    Node troubleshooting
    Voice wake
    Pi integration architecture
    Pi development workflow
    Android app
    Platforms
    iOS app
    Linux app
    Gateway on macOS
    Canvas
    Gateway lifecycle
    macOS dev setup
    Health checks (macOS)
    Menu bar icon
    macOS logging
    Menu bar
    Peekaboo bridge
    macOS permissions
    Remote control
    macOS signing
    Skills (macOS)
    Voice overlay
    Voice wake (macOS)
    WebChat (macOS)
    macOS IPC
    macOS app
    Windows
    Plugin internals
    Plugin architecture internals
    Building plugins
    Plugin bundles
    Codex Computer Use
    Codex harness
    Community plugins
    Plugin compatibility
    Google Meet plugin
    Plugin hooks
    Plugin manifest
    Memory LanceDB
    Memory wiki
    Message presentation
    Agent harness plugins
    Building channel plugins
    Channel turn kernel
    Plugin entry points
    Plugin SDK migration
    Plugin SDK overview
    Building provider plugins
    Plugin runtime helpers
    Plugin setup and config
    Plugin SDK subpaths
    Plugin testing
    Skill workshop plugin
    Voice call plugin
    Webhooks plugin
    Zalo personal plugin
    OpenProse
    Alibaba Model Studio
    Anthropic
    Arcee AI
    Azure Speech
    Amazon Bedrock
    Amazon Bedrock Mantle
    Chutes
    Claude Max API proxy
    Cloudflare AI gateway
    ComfyUI
    Deepgram
    Deepinfra
    DeepSeek
    ElevenLabs
    Fal
    Fireworks
    GitHub Copilot
    GLM (Zhipu)
    Google (Gemini)
    Gradium
    Groq
    Hugging Face (inference)
    Provider directory
    Inferrs
    Inworld
    Kilocode
    LiteLLM
    LM Studio
    MiniMax
    Mistral
    Model provider quickstart
    Moonshot AI
    NVIDIA
    Ollama
    OpenAI
    OpenCode
    OpenCode Go
    OpenRouter
    Perplexity
    Qianfan
    Qwen
    Runway
    SGLang
    StepFun
    Synthetic
    Tencent Cloud (TokenHub)
    Together AI
    Venice AI
    Vercel AI gateway
    vLLM
    Volcengine (Doubao)
    Vydra
    xAI
    Xiaomi MiMo
    Z.AI
    Default AGENTS.md
    Release policy
    API usage and costs
    Credits
    Device model database
    Full release validation
    Memory configuration reference
    OpenClaw App SDK API design
    Prompt caching
    Rich output protocol
    RPC adapters
    SecretRef credential surface
    Session management deep dive
    AGENTS.md template
    BOOT.md template
    BOOTSTRAP.md template
    HEARTBEAT.md template
    IDENTITY template
    SOUL.md template
    TOOLS.md template
    USER template
    Tests
    Token use and costs
    Transcript hygiene
    Onboarding reference
    Contributing to the threat model
    Threat model (MITRE ATLAS)
    Formal verification (security models)
    Network proxy
    Agent bootstrapping
    Docs directory
    Getting started
    Docs hubs
    OpenClaw lore
    Onboarding (macOS app)
    Onboarding overview
    Personal assistant setup
    Setup
    Showcase
    Onboarding (CLI)
    CLI automation
    CLI setup reference
    ACP agents
    ACP agents — setup
    Agent send
    apply_patch tool
    Brave search
    Browser (OpenClaw-managed)
    Browser control API
    Browser troubleshooting
    Browser login
    WSL2 + Windows + remote Chrome CDP troubleshooting
    BTW side questions
    ClawHub
    Code execution
    Creating skills
    Diffs
    DuckDuckGo search
    Elevated mode
    Exa search
    Exec tool
    Exec approvals
    Exec approvals — advanced
    Firecrawl
    Gemini search
    Grok search
    Image generation
    Tools and plugins
    Kimi search
    LLM task
    Lobster
    Tool-loop detection
    Media overview
    MiniMax search
    Multi-agent sandbox and tools
    Music generation
    Ollama web search
    PDF tool
    Perplexity search
    Plugins
    Reactions
    SearXNG search
    Skills
    Skills config
    Slash commands
    Sub-agents
    Tavily
    Thinking levels
    Tokenjuice
    Trajectory bundles
    Text-to-speech
    Video generation
    Web search
    Web fetch
    Linux server
    Control UI
    Dashboard
    Web
    TUI
    WebChat

    OpenAPI Specs

    openapi
    TaskFlow
    docs/openclaw
    Original Docs

    Real-time Synchronized Documentation

    Last sync: 01/05/2026 07:00:08

    Note: This content is mirrored from docs.openclaw.ai and is subject to their terms and conditions.

    OpenClaw Docs

    v2.4.0 Production

    Last synced: Today, 22:00

    Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.

    Use this file to discover all available pages before exploring further.

    Exec tool

    Run shell commands in the workspace. Supports foreground + background execution via

    text
    process
    . If
    text
    process
    is disallowed,
    text
    exec
    runs synchronously and ignores
    text
    yieldMs
    /
    text
    background
    . Background sessions are scoped per agent;
    text
    process
    only sees sessions from the same agent.

    Parameters

    Shell command to run. Working directory for the command. Key/value environment overrides merged on top of the inherited environment. Auto-background the command after this delay (ms). Background the command immediately instead of waiting for `yieldMs`. Override the configured exec timeout for this call. Set `timeout: 0` only when the command should run without the exec process timeout. Run in a pseudo-terminal when available. Use for TTY-only CLIs, coding agents, and terminal UIs. Where to execute. `auto` resolves to `sandbox` when a sandbox runtime is active and `gateway` otherwise. Enforcement mode for `gateway` / `node` execution. Approval prompt behavior for `gateway` / `node` execution. Node id/name when `host=node`. Request elevated mode — escape the sandbox onto the configured host path. `security=full` is forced only when elevated resolves to `full`.

    Notes:

    • text
      host
      defaults to
      text
      auto
      : sandbox when sandbox runtime is active for the session, otherwise gateway.
    • text
      host
      only accepts
      text
      auto
      ,
      text
      sandbox
      ,
      text
      gateway
      , or
      text
      node
      . It is not a hostname selector; hostname-like values are rejected before the command runs.
    • text
      auto
      is the default routing strategy, not a wildcard. Per-call
      text
      host=node
      is allowed from
      text
      auto
      ; per-call
      text
      host=gateway
      is only allowed when no sandbox runtime is active.
    • With no extra config,
      text
      host=auto
      still "just works": no sandbox means it resolves to
      text
      gateway
      ; a live sandbox means it stays in the sandbox.
    • text
      elevated
      escapes the sandbox onto the configured host path:
      text
      gateway
      by default, or
      text
      node
      when
      text
      tools.exec.host=node
      (or the session default is
      text
      host=node
      ). It is only available when elevated access is enabled for the current session/provider.
    • text
      gateway
      /
      text
      node
      approvals are controlled by
      text
      ~/.openclaw/exec-approvals.json
      .
    • text
      node
      requires a paired node (companion app or headless node host).
    • If multiple nodes are available, set
      text
      exec.node
      or
      text
      tools.exec.node
      to select one.
    • text
      exec host=node
      is the only shell-execution path for nodes; the legacy
      text
      nodes.run
      wrapper has been removed.
    • text
      timeout
      applies to foreground, background,
      text
      yieldMs
      , gateway, sandbox, and node
      text
      system.run
      execution. If omitted, OpenClaw uses
      text
      tools.exec.timeoutSec
      ; explicit
      text
      timeout: 0
      disables the exec process timeout for that call.
    • On non-Windows hosts, exec uses
      text
      SHELL
      when set; if
      text
      SHELL
      is
      text
      fish
      , it prefers
      text
      bash
      (or
      text
      sh
      ) from
      text
      PATH
      to avoid fish-incompatible scripts, then falls back to
      text
      SHELL
      if neither exists.
    • On Windows hosts, exec prefers PowerShell 7 (
      text
      pwsh
      ) discovery (Program Files, ProgramW6432, then PATH), then falls back to Windows PowerShell 5.1.
    • Host execution (
      text
      gateway
      /
      text
      node
      ) rejects
      text
      env.PATH
      and loader overrides (
      text
      LD_*
      /
      text
      DYLD_*
      ) to prevent binary hijacking or injected code.
    • OpenClaw sets
      text
      OPENCLAW_SHELL=exec
      in the spawned command environment (including PTY and sandbox execution) so shell/profile rules can detect exec-tool context.
    • text
      openclaw channels login
      is blocked from
      text
      exec
      because it is an interactive channel-auth flow; run it in a terminal on the gateway host, or use the channel-native login tool from chat when one exists.
    • Important: sandboxing is off by default. If sandboxing is off, implicit
      text
      host=auto
      resolves to
      text
      gateway
      . Explicit
      text
      host=sandbox
      still fails closed instead of silently running on the gateway host. Enable sandboxing or use
      text
      host=gateway
      with approvals.
    • Script preflight checks (for common Python/Node shell-syntax mistakes) only inspect files inside the effective
      text
      workdir
      boundary. If a script path resolves outside
      text
      workdir
      , preflight is skipped for that file.
    • For long-running work that starts now, start it once and rely on automatic completion wake when it is enabled and the command emits output or fails. Use
      text
      process
      for logs, status, input, or intervention; do not emulate scheduling with sleep loops, timeout loops, or repeated polling.
    • For work that should happen later or on a schedule, use cron instead of
      text
      exec
      sleep/delay patterns.

    Config

    • text
      tools.exec.notifyOnExit
      (default: true): when true, backgrounded exec sessions enqueue a system event and request a heartbeat on exit.
    • text
      tools.exec.approvalRunningNoticeMs
      (default: 10000): emit a single “running” notice when an approval-gated exec runs longer than this (0 disables).
    • text
      tools.exec.timeoutSec
      (default: 1800): default per-command exec timeout in seconds. Per-call
      text
      timeout
      overrides it; per-call
      text
      timeout: 0
      disables the exec process timeout.
    • text
      tools.exec.host
      (default:
      text
      auto
      ; resolves to
      text
      sandbox
      when sandbox runtime is active,
      text
      gateway
      otherwise)
    • text
      tools.exec.security
      (default:
      text
      deny
      for sandbox,
      text
      full
      for gateway + node when unset)
    • text
      tools.exec.ask
      (default:
      text
      off
      )
    • No-approval host exec is the default for gateway + node. If you want approvals/allowlist behavior, tighten both
      text
      tools.exec.*
      and the host
      text
      ~/.openclaw/exec-approvals.json
      ; see Exec approvals.
    • YOLO comes from the host-policy defaults (
      text
      security=full
      ,
      text
      ask=off
      ), not from
      text
      host=auto
      . If you want to force gateway or node routing, set
      text
      tools.exec.host
      or use
      text
      /exec host=...
      .
    • In
      text
      security=full
      plus
      text
      ask=off
      mode, host exec follows the configured policy directly; there is no extra heuristic command-obfuscation prefilter or script-preflight rejection layer.
    • text
      tools.exec.node
      (default: unset)
    • text
      tools.exec.strictInlineEval
      (default: false): when true, inline interpreter eval forms such as
      text
      python -c
      ,
      text
      node -e
      ,
      text
      ruby -e
      ,
      text
      perl -e
      ,
      text
      php -r
      ,
      text
      lua -e
      , and
      text
      osascript -e
      always require explicit approval.
      text
      allow-always
      can still persist benign interpreter/script invocations, but inline-eval forms still prompt each time.
    • text
      tools.exec.pathPrepend
      : list of directories to prepend to
      text
      PATH
      for exec runs (gateway + sandbox only).
    • text
      tools.exec.safeBins
      : stdin-only safe binaries that can run without explicit allowlist entries. For behavior details, see Safe bins.
    • text
      tools.exec.safeBinTrustedDirs
      : additional explicit directories trusted for
      text
      safeBins
      path checks.
      text
      PATH
      entries are never auto-trusted. Built-in defaults are
      text
      /bin
      and
      text
      /usr/bin
      .
    • text
      tools.exec.safeBinProfiles
      : optional custom argv policy per safe bin (
      text
      minPositional
      ,
      text
      maxPositional
      ,
      text
      allowedValueFlags
      ,
      text
      deniedFlags
      ).

    Example:

    json5
    { tools: { exec: { pathPrepend: ["~/bin", "/opt/oss/bin"], }, }, }

    PATH handling

    • text
      host=gateway
      : merges your login-shell
      text
      PATH
      into the exec environment.
      text
      env.PATH
      overrides are rejected for host execution. The daemon itself still runs with a minimal
      text
      PATH
      :
      • macOS:
        text
        /opt/homebrew/bin
        ,
        text
        /usr/local/bin
        ,
        text
        /usr/bin
        ,
        text
        /bin
      • Linux:
        text
        /usr/local/bin
        ,
        text
        /usr/bin
        ,
        text
        /bin
    • text
      host=sandbox
      : runs
      text
      sh -lc
      (login shell) inside the container, so
      text
      /etc/profile
      may reset
      text
      PATH
      . OpenClaw prepends
      text
      env.PATH
      after profile sourcing via an internal env var (no shell interpolation);
      text
      tools.exec.pathPrepend
      applies here too.
    • text
      host=node
      : only non-blocked env overrides you pass are sent to the node.
      text
      env.PATH
      overrides are rejected for host execution and ignored by node hosts. If you need additional PATH entries on a node, configure the node host service environment (systemd/launchd) or install tools in standard locations.

    Per-agent node binding (use the agent list index in config):

    bash
    openclaw config get agents.list openclaw config set agents.list[0].tools.exec.node "node-id-or-name"

    Control UI: the Nodes tab includes a small “Exec node binding” panel for the same settings.

    Session overrides (
    text
    /exec
    )

    Use

    text
    /exec
    to set per-session defaults for
    text
    host
    ,
    text
    security
    ,
    text
    ask
    , and
    text
    node
    . Send
    text
    /exec
    with no arguments to show the current values.

    Example:

    text
    /exec host=auto security=allowlist ask=on-miss node=mac-1

    Authorization model

    text
    /exec
    is only honored for authorized senders (channel allowlists/pairing plus
    text
    commands.useAccessGroups
    ). It updates session state only and does not write config. To hard-disable exec, deny it via tool policy (
    text
    tools.deny: ["exec"]
    or per-agent). Host approvals still apply unless you explicitly set
    text
    security=full
    and
    text
    ask=off
    .

    Exec approvals (companion app / node host)

    Sandboxed agents can require per-request approval before

    text
    exec
    runs on the gateway or node host. See Exec approvals for the policy, allowlist, and UI flow.

    When approvals are required, the exec tool returns immediately with

    text
    status: "approval-pending"
    and an approval id. Once approved (or denied / timed out), the Gateway emits system events (
    text
    Exec finished
    /
    text
    Exec denied
    ). If the command is still running after
    text
    tools.exec.approvalRunningNoticeMs
    , a single
    text
    Exec running
    notice is emitted. On channels with native approval cards/buttons, the agent should rely on that native UI first and only include a manual
    text
    /approve
    command when the tool result explicitly says chat approvals are unavailable or manual approval is the only path.

    Allowlist + safe bins

    Manual allowlist enforcement matches resolved binary path globs and bare command-name globs. Bare names match only commands invoked through PATH, so

    text
    rg
    can match
    text
    /opt/homebrew/bin/rg
    when the command is
    text
    rg
    , but not
    text
    ./rg
    or
    text
    /tmp/rg
    . When
    text
    security=allowlist
    , shell commands are auto-allowed only if every pipeline segment is allowlisted or a safe bin. Chaining (
    text
    ;
    ,
    text
    &&
    ,
    text
    ||
    ) and redirections are rejected in allowlist mode unless every top-level segment satisfies the allowlist (including safe bins). Redirections remain unsupported. Durable
    text
    allow-always
    trust does not bypass that rule: a chained command still requires every top-level segment to match.

    text
    autoAllowSkills
    is a separate convenience path in exec approvals. It is not the same as manual path allowlist entries. For strict explicit trust, keep
    text
    autoAllowSkills
    disabled.

    Use the two controls for different jobs:

    • text
      tools.exec.safeBins
      : small, stdin-only stream filters.
    • text
      tools.exec.safeBinTrustedDirs
      : explicit extra trusted directories for safe-bin executable paths.
    • text
      tools.exec.safeBinProfiles
      : explicit argv policy for custom safe bins.
    • allowlist: explicit trust for executable paths.

    Do not treat

    text
    safeBins
    as a generic allowlist, and do not add interpreter/runtime binaries (for example
    text
    python3
    ,
    text
    node
    ,
    text
    ruby
    ,
    text
    bash
    ). If you need those, use explicit allowlist entries and keep approval prompts enabled.
    text
    openclaw security audit
    warns when interpreter/runtime
    text
    safeBins
    entries are missing explicit profiles, and
    text
    openclaw doctor --fix
    can scaffold missing custom
    text
    safeBinProfiles
    entries.
    text
    openclaw security audit
    and
    text
    openclaw doctor
    also warn when you explicitly add broad-behavior bins such as
    text
    jq
    back into
    text
    safeBins
    . If you explicitly allowlist interpreters, enable
    text
    tools.exec.strictInlineEval
    so inline code-eval forms still require a fresh approval.

    For full policy details and examples, see Exec approvals and Safe bins versus allowlist.

    Examples

    Foreground:

    json
    { "tool": "exec", "command": "ls -la" }

    Background + poll:

    json
    {"tool":"exec","command":"npm run build","yieldMs":1000} {"tool":"process","action":"poll","sessionId":"<id>"}

    Polling is for on-demand status, not waiting loops. If automatic completion wake is enabled, the command can wake the session when it emits output or fails.

    Send keys (tmux-style):

    json
    {"tool":"process","action":"send-keys","sessionId":"<id>","keys":["Enter"]} {"tool":"process","action":"send-keys","sessionId":"<id>","keys":["C-c"]} {"tool":"process","action":"send-keys","sessionId":"<id>","keys":["Up","Up","Enter"]}

    Submit (send CR only):

    json
    { "tool": "process", "action": "submit", "sessionId": "<id>" }

    Paste (bracketed by default):

    json
    { "tool": "process", "action": "paste", "sessionId": "<id>", "text": "line1\nline2\n" }

    apply_patch

    text
    apply_patch
    is a subtool of
    text
    exec
    for structured multi-file edits. It is enabled by default for OpenAI and OpenAI Codex models. Use config only when you want to disable it or restrict it to specific models:

    json5
    { tools: { exec: { applyPatch: { workspaceOnly: true, allowModels: ["gpt-5.5"] }, }, }, }

    Notes:

    • Only available for OpenAI/OpenAI Codex models.
    • Tool policy still applies;
      text
      allow: ["write"]
      implicitly allows
      text
      apply_patch
      .
    • Config lives under
      text
      tools.exec.applyPatch
      .
    • text
      tools.exec.applyPatch.enabled
      defaults to
      text
      true
      ; set it to
      text
      false
      to disable the tool for OpenAI models.
    • text
      tools.exec.applyPatch.workspaceOnly
      defaults to
      text
      true
      (workspace-contained). Set it to
      text
      false
      only if you intentionally want
      text
      apply_patch
      to write/delete outside the workspace directory.

    Related

    • Exec Approvals — approval gates for shell commands
    • Sandboxing — running commands in sandboxed environments
    • Background Process — long-running exec and process tool
    • Security — tool policy and elevated access

    © 2024 TaskFlow Mirror

    Powered by TaskFlow Sync Engine