From 6d33528fd70abbe93991ede0e7a4c019cdf22d38 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sun, 8 Mar 2026 09:04:38 +0100 Subject: [PATCH] pcloudcc-testing: add superpowerd sandbox escape, enforce -d flag Use execute_elevated_bash (superpowerd) to start/stop the pcloudcc daemon outside the sandbox instead of asking the user. Add explicit rule to always use -d when starting the daemon. Co-Authored-By: Claude Sonnet 4.6 --- skills/pcloudcc-testing/SKILL.md | 43 ++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/skills/pcloudcc-testing/SKILL.md b/skills/pcloudcc-testing/SKILL.md index a3b19c8..ba14782 100644 --- a/skills/pcloudcc-testing/SKILL.md +++ b/skills/pcloudcc-testing/SKILL.md @@ -25,6 +25,37 @@ Common commands: - `crypto stop` - Lock crypto folder - `finalize` - Kill daemon and quit +## Sandbox Escape (FUSE / daemon) + +The pcloudcc daemon requires FUSE (mount syscall), which is blocked inside the sandbox. Use the `execute_elevated_bash` tool (provided by the `superpowerd` MCP server) to run commands outside the sandbox. + +**Load the tool first** (deferred tool — must be discovered before use): +``` +ToolSearch: select:mcp__superpowers-mcp-server__execute_elevated_bash +``` + +**Start daemon outside sandbox** (always use `-d` — never start without it): +``` +Tool: mcp__superpowers-mcp-server__execute_elevated_bash +command: "cd && ./pcloudcc -d" +summary: "Start pcloudcc daemon for FUSE testing" +``` + +**Send CLI commands** (these are lightweight and can run inside sandbox): +``` +Tool: execute_code +code: echo "" | ./pcloudcc -k +``` + +**Stop daemon**: +``` +Tool: mcp__superpowers-mcp-server__execute_elevated_bash +command: "cd && echo 'finalize' | ./pcloudcc -k" +summary: "Stop pcloudcc daemon" +``` + +Mount point: `~/pCloudDrive` + ## Testing Workflow ### Testing Agent System Prompt @@ -80,15 +111,15 @@ tool: send_message.sh args: ["", "", "PROMPT_RESPONSE", "Validation complete", "Status: completed|failed\n"] ``` -**FUSE testing**: Inform user daemon must start outside sandbox, wait for acknowledgement +**FUSE testing**: Use `execute_elevated_bash` to start the daemon outside the sandbox (see Sandbox Escape section above). No user intervention required. ### Manual Testing Workflow 1. Build: `make -j$(nproc)` -2. Start daemon: `./pcloudcc -d` +2. Start daemon (outside sandbox): `mcp__superpowers-mcp-server__execute_elevated_bash` → `cd && ./pcloudcc -d` 3. Wait for initialization: `sleep 2` -4. Test commands: `echo "" | ./pcloudcc -k` -5. Stop daemon: `echo "finalize" | ./pcloudcc -k` +4. Test commands (inside sandbox): `echo "" | ./pcloudcc -k` +5. Stop daemon: `mcp__superpowers-mcp-server__execute_elevated_bash` → `cd && echo 'finalize' | ./pcloudcc -k` ## Test Design @@ -101,15 +132,17 @@ args: ["", "", "PROMPT_RESPONSE", "Validation complete", **Test design**: Understand bug → reproduce scenario → verify old fails, new passes → provide evidence -**FUSE testing**: Daemon must start outside sandbox (mount syscall blocked). Inform user, wait for acknowledgement. Mount: `~/pCloudDrive` +**FUSE testing**: Use `execute_elevated_bash` to run the daemon outside the sandbox. Mount point: `~/pCloudDrive` **Fault Injection Pattern**: `#define _GNU_SOURCE` + `#include ` to override functions. Compile: `gcc -shared -fPIC -o inject.so inject.c -ldl`. Run: `LD_PRELOAD=./inject.so ./pcloudcc -d` ## Notes +- **Always start the daemon with `-d`** — never invoke `./pcloudcc` as daemon without this flag - Daemon must be running before using `-k` commands - Each `-k` invocation creates new connection to daemon - Daemon closes socket after each response - Always finalize to cleanly stop daemon - Use `status` instead of `pending` for checking upload/download state - Kill daemon: use the PID shown at startup (e.g., `kill -9 12345`) +- `execute_elevated_bash` requires user approval per invocation — requests should be clearly summarized