-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
[Feature]: Path-scoped RWX permissions for exec and file tools #39979
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestNew feature or requestimpact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Replace the binary-level exec allowlist with a path-keyed RWX permission map so agents
inherit read/write/execute rights from the target path, not from which binary is running —
identical in spirit to Unix DAC.
Problem to solve
Today, allowing
/bin/lson~/workspacealso allows/bin/lson~/.openclawand~/.ssh. There is no way to scope execution by path. The only guardrail is SOUL.md promptinstructions — which are not enforcement. As documented in #12202, model compliance varies
across providers and A2A requests can silently bypass user-facing refusals.
This is especially acute in single-OS-user setups (gateway + agent sharing the same
account) where the tool execution layer is the only practical enforcement boundary.
Proposed solution
Replace the binary-level allowlist with a path-keyed RWX permission map. The binary is
irrelevant; what matters is what operations are permitted on a given path:
Permission bits:
r— agent may read the path (file tools: read; exec: cat, grep, ls, find, etc.)w— agent may write/modify the path (file tools: write, edit; exec: cp, mv, rm, etc.)x— agent may execute files at this path (exec tool only)-— deny that operationEvaluation logic:
-, or the path matches adenyentry → block before executiondenyalways wins overruleson conflictdefault(recommended:---)This applies uniformly across file tools and exec — no special-casing per binary.
Alternatives considered
A binary-scoped model (e.g. "allow
/bin/caton these paths") is incomplete:Path-keyed RWX is simpler to reason about, simpler to configure, and matches the mental
model operators already have from Unix.
Impact
Affected: All single-OS-user gateway+agent deployments (the recommended/default setup)
Severity: Blocks meaningful security hardening — there is currently no reliable way to
restrict which paths an agent can touch via exec
Frequency: Constant — every exec invocation operates under an all-or-nothing binary allowlist
Consequence: Agents with exec access to any binary can reach sensitive paths
(~/.openclaw, ~/.ssh, credentials/) — the only mitigation today is prompt instructions,
which are demonstrably unreliable across model providers and invisible to A2A callers
Evidence/examples
Example 1 — Allow most system binaries but restrict specific ones:
/usr/bin/ls→r-x(inherits wildcard)/usr/bin/grep→r--(readable, not executable — more specific rule wins)/usr/bin/curl→---(explicitly locked out)~/.ssh/id_rsa→ blocked (deny wins over everything)Example 2 — Read-only agent:
Example 3 — Locked-down agent with single writable scratch dir:
Precedence:
denylist — always blocks, no overriderulesmatch — longest glob winsrulesmatch — fallback within rulesdefault— catch-all (recommend---)Related: #12202, #513, #9348, #7284
Additional information
The path extraction approach prototyped in #12202 for file tools could be reused here for
the exec surface. The key extension is evaluating the extracted paths against the RWX
permission map rather than a simple allowlist/denylist.
Must remain backward-compatible with existing exec allowlist config keys.