惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
Latest news
Latest news
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
CXSECURITY Database RSS Feed - CXSecurity.com
IT之家
IT之家
V
V2EX
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
Cisco Talos Blog
Cisco Talos Blog
K
Kaspersky official blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
SegmentFault 最新的问题
小众软件
小众软件
A
Arctic Wolf
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
G
GRAHAM CLULEY
罗磊的独立博客
T
Tor Project blog
C
Cisco Blogs
美团技术团队
博客园 - Franky
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
Cyberwarzone
Cyberwarzone
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
有赞技术团队
有赞技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Security Latest
Security Latest
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
Spread Privacy
Spread Privacy
J
Java Code Geeks
C
CERT Recently Published Vulnerability Notes
大猫的无限游戏
大猫的无限游戏
S
Securelist
The Cloudflare Blog
博客园 - 叶小钗
D
Darknet – Hacking Tools, Hacker News & Cyber Security
阮一峰的网络日志
阮一峰的网络日志
雷峰网
雷峰网
Project Zero
Project Zero

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
OpenClaw Sandbox vs Approvals vs Tool Policy: Three Different Safety Layers
Hex · 2026-05-02 · via DEV Community

OpenClaw Sandbox vs Approvals vs Tool Policy: Three Different Safety Layers

When an OpenClaw command gets blocked, the tempting reaction is to look for one magic switch. Turn off the sandbox. Enable elevated mode. Change approvals. Add the tool to an allowlist. I get why that happens, but it is usually the wrong debugging model.

OpenClaw has three separate safety layers that can all affect the same moment: sandboxing, tool policy, and exec approvals. They sound related because they are all safety controls. They are not interchangeable.

The shortest version is this: sandboxing decides where tools run, tool policy decides which tools exist, and approvals decide whether a host exec command is allowed to proceed. If you understand that split, most “why did OpenClaw block this?” incidents become much less mysterious.

This post is docs-grounded and deliberately practical. If you want the deeper single-topic guide for approvals afterward, read OpenClaw Exec Approvals. This one is the operator map that keeps the three layers from blurring together.

The three-layer mental model

The OpenClaw docs define the split cleanly:

  • Sandbox configuration under agents.defaults.sandbox.* or agents.list[].sandbox.* decides where tool execution happens: host or sandbox backend.
  • Tool policy under keys like tools.*, tools.sandbox.tools.*, and agents.list[].tools.* decides which tools are available or blocked.
  • Elevated / exec approvals apply to exec. Elevated is the escape hatch for running outside the sandbox, and exec approvals are the host-side guardrail that can still require policy, allowlist, and approval to agree.

That means the fix depends on the layer that said no. A denied browser tool is not fixed by approving an exec command. A sandboxed shell that cannot see a host path is not fixed by adding read to a tool allowlist. An approval prompt that falls back to deny is not fixed by changing the sandbox mode.

So before changing config, inspect the actual effective state:

openclaw sandbox explain
openclaw sandbox explain --session agent:main:main
openclaw sandbox explain --agent work
openclaw sandbox explain --json

Enter fullscreen mode Exit fullscreen mode

The docs say this inspector reports the effective sandbox mode, scope, workspace access, whether the session is currently sandboxed, effective sandbox tool allow/deny, elevated gates, and fix-it key paths. Start there. It is much cheaper than guessing.

Layer 1: sandboxing decides where tools run

OpenClaw sandboxing is optional. When it is enabled, tool execution can happen inside a sandbox backend instead of directly on the host. The Gateway process itself stays on the host; the tools are what move into the isolated environment.

The core mode key is agents.defaults.sandbox.mode, with three documented values:

  • off: no sandboxing; tools run on the host.
  • non-main: non-main sessions are sandboxed. The docs call out a common surprise here: group or channel sessions are not the main session key, so they can count as non-main.
  • all: every session runs in a sandbox.

The docs also describe sandbox scope values: agent, session, and shared. Scope is about how many sandbox runtimes are created and shared. That matters when you are debugging state that appears in one session but not another.

Backends are a separate choice. The docs cover Docker, SSH, and OpenShell backends. Docker is local container-backed. SSH can run the sandbox workspace on an SSH-accessible machine. OpenShell is an OpenShell-managed remote environment with mirror and remote workspace modes. You do not need all of that on day one, but you should know that “sandboxed” does not always mean “a local Docker container with my current files mounted exactly how I imagine.”

Workspace access is its own setting

The sandbox docs define workspaceAccess separately from sandbox mode:

  • none: tools see a sandbox workspace.
  • ro: the agent workspace is mounted read-only.
  • rw: the agent workspace is mounted read-write.

This is where a lot of operator confusion comes from. “The tool exists” does not imply “the tool can write the host workspace.” You can allow edit as a tool and still be in a read-only workspace posture. The place where the tool runs and the files it can touch are different questions.

Bind mounts pierce the filesystem boundary

The Docker sandbox docs are blunt about bind mounts: docker.binds pierce the sandbox filesystem. Whatever you bind is visible inside the container with the mode you set, :ro or :rw. If you omit the mode, the documented default is read-write, so prefer :ro for source or secrets unless you intentionally need writes.

There is also an important scope note: with scope: "shared", per-agent binds are ignored and only global binds apply. If you are wondering why one agent-specific bind is not showing up, check scope before inventing a more exotic explanation.

Layer 2: tool policy decides what can be called

Tool policy is the hard stop for tool availability. The docs list several layers: tool profiles, provider tool profiles, global and per-agent allow/deny, provider-specific allow/deny, and sandbox-only tool policy. The details matter in larger deployments, but two rules carry most of the day-to-day weight:

  • deny always wins.
  • If an allow list is non-empty, everything else is treated as blocked.

That second rule is the one that bites people. An allowlist is not a friendly suggestion. It flips the default from “available unless denied” to “blocked unless explicitly allowed.”

Tool policy also cannot be bypassed by /exec. The docs say this directly: /exec only changes session defaults for authorized senders; it does not grant tool access. If the exec tool is denied by policy, an /exec directive is not a skeleton key.

A small example of the shape, not a universal recommendation:

{
  tools: {
    sandbox: {
      tools: {
        allow: ["group:runtime", "group:fs", "group:memory"]
      }
    }
  }
}

Enter fullscreen mode Exit fullscreen mode

The docs support group:* shorthands for tool policy. I like them for readability, but I would still inspect the effective policy after changing them. In production, “I think this expands to what I meant” is weaker than openclaw sandbox explain --json.

Want the full operator setup instead of learning each safety layer by breaking it in production? Get ClawKit here.

Layer 3: elevated and exec approvals control host commands

Elevated mode only affects exec. It does not grant extra tools, it does not override a denied tool policy, and it is not skill-scoped. Its job is narrower: when a session is sandboxed, elevated mode lets exec run outside the sandbox through the configured escape path.

The documented directives are:

  • /elevated on or /elevated ask: run on the host and keep exec approvals.
  • /elevated full: run on the host and skip exec approvals for the session.
  • /elevated off: return to sandbox-confined execution.

There are gates before elevated is available: tools.elevated.enabled, sender allowlists under tools.elevated.allowFrom, and optional per-agent restrictions. If those gates fail, elevated is unavailable.

Exec approvals are a related but separate guardrail. The docs describe them as the companion app or node host interlock for letting a sandboxed agent run commands on a real host, either the gateway host or a node host. Approvals stack on top of tool policy and elevated gating unless elevated is set to full.

Approvals live on the execution host at:

~/.openclaw/exec-approvals.json

Enter fullscreen mode Exit fullscreen mode

The key policy knobs are documented as:

  • security: deny, allowlist, or full.
  • ask: off, on-miss, or always.
  • askFallback: what happens when a prompt is required but no UI is reachable: deny, allowlist, or full.

The effective policy is the stricter of OpenClaw's requested tools.exec.* policy and the host-local approvals state. So if a local host file is stricter than your config, the stricter host policy wins. That is a feature, not a bug.

Useful inspection commands from the docs:

openclaw approvals get
openclaw approvals get --gateway
openclaw approvals get --node <id|name|ip>
openclaw exec-policy show

Enter fullscreen mode Exit fullscreen mode

A practical debugging flow

When something is blocked, I would debug in this order:

  1. Ask: is the session sandboxed? Run openclaw sandbox explain. Confirm mode, scope, backend, and workspace access.
  2. Ask: does the tool exist for this session? Check effective tool allow/deny. If the tool is denied, fix tool policy first. Do not touch approvals yet.
  3. Ask: is this specifically host exec? If yes, then elevated and approvals matter. If no, they probably are not the layer you need.
  4. Ask: is a host approval prompt failing? Inspect approvals with openclaw approvals get or openclaw exec-policy show. Remember that prompt fallback can deny when no UI is reachable.
  5. Make the smallest config change. Do not disable sandboxing globally because one tool needs a narrower allowlist adjustment.

This order matters because it prevents over-correcting. The docs make it clear that OpenClaw has multiple safety layers by design. Treating every block as a reason to go permissive throws away the useful separation.

Common wrong fixes

“I enabled elevated but the tool is still blocked.”

Likely explanation: tool policy denied the tool. Elevated only affects exec; it does not grant access to arbitrary tools and does not override tool allow/deny.

“I changed /exec settings but exec is unavailable.”

/exec changes exec defaults for authorized senders. It does not grant a denied tool. If policy removed exec, fix policy.

“My group channel behaves differently than my direct main chat.”

In non-main sandbox mode, the docs say group and channel sessions use their own keys, so they count as non-main. That difference is expected.

“I mounted a folder and now the sandbox can see secrets.”

That is exactly what a bind mount can do. Bind mounts pierce the sandbox filesystem, and omitted modes default to read-write. Use :ro when you only need reads, and be intentional about every mounted path.

The operator takeaway

OpenClaw's safety model is easier to operate when you stop looking for one universal permission switch. Sandboxing answers “where does this run?” Tool policy answers “is this tool callable?” Exec approvals answer “may this host command proceed?” Elevated answers “should sandboxed exec escape to the host, and with which approval posture?”

Keep those questions separate and you will fix the right thing faster. Better, you will avoid the worst production habit: weakening every safety layer because one layer was misunderstood.

Originally published at https://www.openclawplaybook.ai/blog/openclaw-sandbox-approvals-tool-policy/

Get The OpenClaw Playbook → https://www.openclawplaybook.ai?utm_source=devto&utm_medium=article&utm_campaign=parasite-seo