openclaw - 💡(How to fix) Fix [Feature]: Add shellArgs to tools.exec config [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77789Fetched 2026-05-06 06:21:25
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
closed ×1commented ×1labeled ×1

Feature Request: Add shellArgs to tools.exec config

Root Cause

Feature Request: Add shellArgs to tools.exec config

Fix Action

Fix / Workaround

Current Workaround

RAW_BUFFERClick to expand / collapse

Summary

Feature Request: Add shellArgs to tools.exec config

Problem to solve

On Windows, OpenClaw's exec tool spawns PowerShell with -NoProfile, which means no PowerShell profile is loaded. This makes it impossible to implement safety guards (like function overrides for Remove-Item) at the shell level.

The current tools.exec config only supports backgroundMs, timeoutSec, and cleanupMs — there's no way to customize shell arguments.

Use Case I want to override Remove-Item in my PowerShell profile to force confirmation before any destructive file operation. This would serve as a hard safety net for the AI agent — even if it "forgets" rules written in AGENTS.md/MEMORY.md, the shell itself would intercept dangerous commands.

Without this, all safety measures are "soft" — the agent can always bypass them by directly calling Remove-Item -Recurse -Force.

Proposed solution

Add a shellArgs field to tools.exec:

{ tools: { exec: { shellArgs: ["-NoLogo"], // replaces default args, omitting -NoProfile }, }, } Or alternatively, a simpler boolean:

{ tools: { exec: { loadProfile: true, // omit -NoProfile from shell args }, }, }

Alternatives considered

No response

Impact

Safety: Enables hard safety guards at the shell level for destructive operations

Backward compatible: Default behavior unchanged (current -NoProfile stays)

Cross-platform: Same concept applies to bash (--rcfile) on Linux/macOS

Evidence/examples

No response

Additional information

Current Workaround

I've written safety rules in AGENTS.md and MEMORY.md, plus a safe-delete.ps1 wrapper script. But these are all "soft" — the agent can bypass them. A true hard guard requires shell-level intervention.

Environment

OpenClaw: 2026.5.2 (8b2a6e5)

OS: Windows 10 x64

Shell: PowerShell 5.1

extent analysis

TL;DR

Add a shellArgs field to the tools.exec config to allow customization of shell arguments, enabling the loading of PowerShell profiles with safety guards.

Guidance

  • Consider adding a loadProfile boolean field to the tools.exec config to omit the -NoProfile argument, allowing PowerShell profiles to be loaded.
  • Evaluate the proposed solution of adding a shellArgs field to replace default arguments, taking into account the potential impact on existing configurations.
  • Review the current workaround using AGENTS.md and MEMORY.md safety rules and the safe-delete.ps1 wrapper script to understand the limitations of the current implementation.
  • Assess the backward compatibility and cross-platform implications of the proposed solution.

Example

{
  "tools": {
    "exec": {
      "shellArgs": ["-NoLogo"],
      // or
      "loadProfile": true
    }
  }
}

Notes

The proposed solution requires careful consideration of the potential impact on existing configurations and the trade-offs between security and flexibility.

Recommendation

Apply the workaround by adding a loadProfile boolean field to the tools.exec config, as it provides a simpler and more targeted solution to enable the loading of PowerShell profiles with safety guards.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature]: Add shellArgs to tools.exec config [1 comments, 2 participants]