Restore explicit approval requirements for high-risk CEA tools
MI
3mo ago+27+27+01234567890123456789-0-0-0123456789
Motivation
- A recent change removed the approval gate from high-risk tools that can run shell commands or mutate files, enabling auto-execution and creating a prompt-injection/command-execution vulnerability.
Description
- Reintroduced
needsApproval: trueon the CEA tool definitions forshell_execute,shell_interact,write_file,edit_file, anddelete_file(files underpackages/cea/src/tools/). - Added a focused regression test
packages/cea/src/tools/tool-approval.test.tsthat asserts these tools exposeneedsApproval === trueto prevent accidental removal in the future. - No other behavioral changes were made; tool implementations and safety checks remain unchanged.
Testing
- Ran the targeted test invocation
pnpm --filter plugsuits exec vitest run src/tools/tool-approval.test.ts src/tools/execute/shell-execute.test.ts src/tools/execute/shell-interact.test.ts src/tools/modify/write-file.test.ts src/tools/modify/edit-file.test.ts src/tools/modify/delete-file.test.tsand all specified suites passed (6 files, 152 tests passed). - Ran type-checking with
pnpm --filter plugsuits typecheckwhich completed successfully. - Note: running the package-level
pnpm --filter plugsuits test -- src/tools/execute/shell-interact.test.tsin this environment invoked the fullsrcsuite and failed due to unrelated workspace import resolution for@ai-sdk-tool/harness, which is not caused by this change.
Summary by cubic
Restores the approval gate for high‑risk CEA tools to prevent auto‑execution of shell and file‑mutation actions. No behavior changes.
- Bug Fixes
- Set
needsApproval: trueonshell_execute,shell_interact,write_file,edit_file, anddelete_file. - Added
tool-approval.test.tsto assert these tools require approval. - Added changeset to publish a patch for
plugsuits.
- Set