picoclaw/pkg
Huang Rui d5370c9605
fix(tools): allow /dev/null redirection and add read/write sandbox split (#967)
* fix(tools): allow /dev/null redirection and add read/write sandbox split

- Remove deny pattern that incorrectly blocked redirects to /dev/null
- Expand block device write pattern to cover nvme, mmcblk, vd, xvd,
  hd, loop, dm-, md, sr and nbd in addition to sd
- Add safe path whitelist for kernel pseudo-devices so workspace path
  check does not reject /dev/null, /dev/zero, /dev/random, /dev/urandom,
  /dev/stdin, /dev/stdout and /dev/stderr
- Add allow_read_outside_workspace config option (default true) so file
  read and list tools are unrestricted while write tools stay sandboxed

Closes https://github.com/sipeed/picoclaw/issues/964
Closes https://github.com/sipeed/picoclaw/issues/965

Signed-off-by: Huang Rui <vowstar@gmail.com>

* feat(tools): add configurable allow patterns and path whitelists

- Add custom_allow_patterns to exec config so users can exempt specific
  commands from deny pattern checks
- Add allow_read_paths and allow_write_paths regex lists to tools config
  for whitelisting specific paths outside the workspace
- Introduce whitelistFs that wraps sandboxFs and falls through to hostFs
  for paths matching whitelist patterns
- Use variadic constructor signatures to keep backward compatibility

Suggested-by: lxowalle
Signed-off-by: Huang Rui <vowstar@gmail.com>

---------

Signed-off-by: Huang Rui <vowstar@gmail.com>
2026-03-02 12:22:02 +08:00
..
agent fix(tools): allow /dev/null redirection and add read/write sandbox split (#967) 2026-03-02 12:22:02 +08:00
auth feat: add picoclaw-launcher with web UI for configuration and gateway management (#904) 2026-02-28 18:38:38 +08:00
bus chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
channels Merge pull request #916 from alexhoshina/fix/channel-config-cleanup 2026-03-01 22:28:55 +08:00
config fix(tools): allow /dev/null redirection and add read/write sandbox split (#967) 2026-03-02 12:22:02 +08:00
constants refactor: replace bool map with set-style map for internal channels (#472) 2026-02-19 11:48:17 +01:00
cron style: fix gci import grouping in config, cron, and skills installer 2026-02-26 20:38:11 +08:00
devices refactor: cleanup dead code and turn on dead code detection in CI (#515) 2026-02-24 21:52:25 +08:00
fileutil refactor(pkg): move atomic file write to dedicated fileutil package 2026-02-24 23:57:13 +08:00
health chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
heartbeat Merge branch 'sipeed:main' into reasoning-chnl 2026-02-27 14:50:14 +05:30
identity feat(identity): add unified user identity with canonical platform:id format 2026-02-23 06:56:48 +08:00
logger enable prealloc 2026-02-25 21:31:07 +11:00
media chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
migrate Feat/update migrate (#910) 2026-02-28 19:59:17 +08:00
providers fix(pkg):do regex precompile insteadd on the fly (#911) 2026-03-01 23:06:31 +11:00
routing chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
session feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
skills Merge pull request #861 from p3ddd/refactor/modernize 2026-03-01 15:38:59 +08:00
state fix: error check on state (#864) 2026-03-02 11:59:26 +11:00
tools fix(tools): allow /dev/null redirection and add read/write sandbox split (#967) 2026-03-02 12:22:02 +08:00
utils fix(tools): close resp.Body on retry cancel and cache http.Client instances (#940) 2026-03-01 16:55:46 +11:00
voice feat(linter): Fix govet linter 2026-02-20 22:35:16 +02:00