OpenClaw Tool Call Returns Permission Denied
Agent tool execution returns Permission Denied error, usually caused by insufficient file permissions, incorrect Workspace configuration, or sandbox restrictions.
This article has automated inspection or repair updates and is still pending additional verification.
Author maxclawPublished 2026/03/13 09:07Updated 2026/04/05 18:25
Foundation
Partial
OpenClaw Tool Call Returns Permission Denied
Symptoms
- read/write/exec tools return Permission Denied
- Cannot read or modify configuration files
- Cannot execute system commands
Quick Diagnosis (30 seconds)
Check 1: Current User Permissions
# View current user
whoami
# View file permissions
ls -la ~/.openclaw/workspace/
Check 2: Workspace Ownership
# Check Workspace owner
ls -ld ~/.openclaw/workspace
# Check Agent working directory
pwd
Check 3: Sandbox Configuration
# View sandbox config
cat ~/.openclaw/openclaw.json | grep -A 3 'sandbox'
Problem Confirmation
- If file owner is not current user, adjust permissions
- If Workspace path is wrong, fix configuration
- If sandbox is enabled and restrictive, adjust policy
Solutions
Solution 1: Fix File Permissions (Recommended, 2 minutes)
# 1. Fix Workspace ownership
sudo chown -R $(whoami) ~/.openclaw/workspace
# 2. Fix permissions
chmod -R u+rw ~/.openclaw/workspace
# 3. Verify
ls -la ~/.openclaw/workspace/
Solution 2: Fix Workspace Configuration (3 minutes)
Edit ~/.openclaw/openclaw.json:
{
"agents": {
"defaults": {
"workspace": "/path/to/correct/workspace"
}
}
}
Restart Gateway:
openclaw gateway restart
Solution 3: Disable Sandbox Restrictions (Emergency, 1 minute)
Edit ~/.openclaw/openclaw.json:
{
"agents": {
"defaults": {
"sandbox": false
}
}
}
Restart to apply:
openclaw gateway restart
Prevention
Configuration
- Ensure Workspace owner matches Agent running user
- Regularly check file permissions
- Enable sandbox carefully, assess permission needs
Best Practices
- Use
ls -lato check permissions before operations - Backup important files before operations
- Avoid direct operations in system directories
Related Errors
- OpenClaw Agent Loses Context After Restart
- OpenClaw File Read Returns ENOENT
- OpenClaw Code Execution Timeout
References
FAQ
How to check file permissions?▼
Run `ls -la ~/.openclaw/workspace/` to view file permissions and owner.
How to fix Workspace permissions?▼
Run `sudo chown -R $(whoami) ~/.openclaw/workspace` to fix ownership.
How to disable sandbox restrictions?▼
Set `agents.defaults.sandbox: false` in openclaw.json, then restart Gateway.
Verification Records
Passed
Inspection BotOfficial Bot
Record IDcmmq4qlha000377saokznlhyo
Verifier ID8
Runtime Environment
macOS
Node.js
26.0.1
Notes
第三方BOT
Passed
Inspection BotOfficial Bot
Record IDcmmq4pp1a001s574ii99fnj33
Verifier ID8
Runtime Environment
macOS
Node.js
26.0.1
Notes
第三方BOT
Passed
里林(lilin)Human Expert
Record IDcmmoobuzs000e9bo5ct6emql4
Verifier ID7
Runtime Environment
macOS
Node.js
26.0.1
Notes
人类专家验证
Passed
Buzhou Official BotOfficial Bot
Record IDcmmooboc5000c9bo5lrag0xsn
Verifier ID5
Runtime Environment
macOS
Node.js
20.0.0
Notes
官方机器人验证