Skip to content

Commit 1526513

Browse files
committed
Fix false positves rejection on plan agent
1 parent 2687964 commit 1526513

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Bump plumcp to 0.2.0-beta6.
66
- Fix MCP server start/stop blocking the protocol thread, causing ECA to become unresponsive.
77
- Dispatch request and notification handlers off the protocol thread to prevent blocking.
8+
- Fix false positves rejection on plan agent.
89

910
## 0.122.1
1011

src/eca/config.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
(defn get-property [property] (System/getProperty property))
4343

4444
(def ^:private dangerous-commands-regexes
45-
[".*[12&]?>>?\\s*(?!/dev/null($|\\s))(?!/tmp/\\S*($|\\s))(?!&\\d+($|\\s))(?!>)\\S+.*" ;; output redirection (except /dev/null and /tmp/)
45+
[".*[12&]?>>?\\s*(?!/dev/null\\b)(?!/tmp/\\S*\\b)(?!&\\d+\\b)(?!>)\\S+.*" ;; output redirection (except /dev/null and /tmp/)
4646
".*\\|\\s*(tee|dd|xargs).*", ;; pipe to tee/dd/xargs
4747
".*\\b(sed|awk|perl)\\s+.*-i.*", ;; in-place editing
4848
".*\\b(rm|mv|cp|touch|mkdir)\\b.*", ;; file mutation commands
4949
".*git\\s+(add|commit|push).*", ;; git write ops
5050
".*npm\\s+install.*", ;; npm install
5151
".*-c\\s+[\"'].*open.*[\"']w[\"'].*", ;; python open(...,'w')
52-
".*bash.*-c.*[12&]?>>?\\s*(?!/dev/null($|\\s))(?!/tmp/\\S*($|\\s))(?!&\\d+($|\\s))(?!>)\\S+.*"])
52+
".*bash.*-c.*[12&]?>>?\\s*(?!/dev/null\\b)(?!/tmp/\\S*\\b)(?!&\\d+\\b)(?!>)\\S+.*"])
5353

5454
(def ^:private openai-variants
5555
{"none" {:reasoning {:effort "none"}}

test/eca/features/tools_test.clj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@
322322
"head -10 file.txt"
323323
"pwd"
324324
"date"
325-
"env"))
325+
"env"
326+
"cd /tmp && jar xf /home/user/.m2/repository/lib/lib-1.0.jar src/foo.cljc 2>&1; echo \"---DONE---\""
327+
"some-cmd 2>&1; echo done"
328+
"some-cmd 2>/dev/null; echo done"))
326329

327330
(testing "redirections to /tmp/ are not denied in plan mode"
328331
(are [command] (not= :deny

0 commit comments

Comments
 (0)