Skip to content

feat: add disableExec config option (fixes #15)#91

Merged
frankekn merged 2 commits intoopenclaw:mainfrom
gandli:feat/disable-exec-config
Mar 10, 2026
Merged

feat: add disableExec config option (fixes #15)#91
frankekn merged 2 commits intoopenclaw:mainfrom
gandli:feat/disable-exec-config

Conversation

@gandli
Copy link
Copy Markdown
Contributor

@gandli gandli commented Mar 10, 2026

Summary

添加安全配置选项 disableExec 来禁用 exec 子命令。

Changes

  • 在配置文件中支持 disableExec: true 选项
  • 支持全局配置 (~/.acpx/config.json) 和项目配置 (.acpxrc.json)
  • 当启用时,exec 子命令将被阻止,显示清晰的错误信息
  • JSON 格式下返回 JSON-RPC 错误,包含 EXEC_DISABLED 错误码
  • 添加完整的测试覆盖

Use Case

适用于安全敏感的部署环境,需要禁用一次性 exec 命令,同时允许基于会话的 prompt 交互。

Configuration Example

{
  "disableExec": true
}

Testing

  • 配置解析测试
  • CLI exec 子命令禁用测试
  • JSON 格式错误响应测试
  • 向后兼容(默认 false)

Add security configuration option to disable the exec subcommand:

- Add disableExec boolean option to config file schema
- Support both global and project-level configuration
- Block exec subcommand with clear error message when enabled
- Return JSON-RPC error with EXEC_DISABLED code in JSON format
- Add comprehensive tests for config parsing and CLI behavior

This is useful for security-sensitive deployments where one-shot
exec commands should be prohibited while allowing session-based
prompt interactions.
@gandli
Copy link
Copy Markdown
Contributor Author

gandli commented Mar 10, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@frankekn frankekn merged commit 1b0fd46 into openclaw:main Mar 10, 2026
7 checks passed
@frankekn frankekn mentioned this pull request Mar 10, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants