feat: add sandbox demo tooling and EXIF extraction example - #80
Conversation
Add justfile targets for running prompts in the Docker sandbox with optional trace and learn flags. Document a second Kaizen Lite example showing how the agent learns to avoid dead ends (exiftool, Pillow) and go straight to Python stdlib for EXIF parsing in sandboxed environments.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis pull request adds sandbox automation tooling via a new justfile with build, setup, and execution targets for a Claude code environment, expands KAIZEN_LITE.md documentation with a detailed failure-recovery example, and introduces sandbox configuration environment variables for debug and sandboxed execution modes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
justfile (1)
26-27: Addsandbox-setupdependency to runtime targets.These targets require
{{env_file}}to exist. Currently,sandbox-run,sandbox-prompt, andsandbox-testhave no dependencies and will fail on first run if the env file hasn't been created. Adding thesandbox-setupdependency ensures the file exists and improves reliability.♻️ Proposed fix
-sandbox-run: +sandbox-run: sandbox-setup docker run --rm -it --env-file {{env_file}} -v "$(cd {{workspace}} && pwd)":/workspace -v "$(pwd)/plugins":/plugins {{image}} -sandbox-prompt prompt: +sandbox-prompt prompt: sandbox-setup #!/usr/bin/env sh TRACE_CMD="" LEARN_CMD="" if [ "{{trace}}" = "true" ]; then TRACE_CMD=" echo; echo; echo Summarizing the session...; echo claude --plugin-dir /plugins/kaizen/ --dangerously-skip-permissions --no-session-persistence -p 'tell me what happened in the newest json file in /home/sandbox/.claude/projects/-workspace/' " fi if [ "{{learn}}" = "true" ]; then LEARN_CMD=" echo; echo; echo Learning...; echo claude --plugin-dir /plugins/kaizen/ --dangerously-skip-permissions --continue -p '/kaizen:learn' " fi docker run --rm -it --env-file {{env_file}} -v "$(cd {{workspace}} && pwd)":/workspace -v "$(pwd)/plugins":/plugins {{image}} sh -c " claude --plugin-dir /plugins/kaizen/ --dangerously-skip-permissions -p '{{prompt}}' $TRACE_CMD $LEARN_CMD " -sandbox-test: +sandbox-test: sandbox-setup docker run --rm --env-file {{env_file}} {{image}} claude -p "who are you"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@justfile` around lines 26 - 27, Add the missing dependency so runtime targets will create the env file before running: update the justfile targets sandbox-run, sandbox-prompt, and sandbox-test to depend on the sandbox-setup target (i.e., add sandbox-setup as a prerequisite for each target) so that the {{env_file}} is guaranteed to exist prior to execution; keep existing command bodies unchanged and only modify the target headers to include the dependency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@justfile`:
- Around line 46-49: The snippet injects raw {{prompt}} into the sh -c command
(shell injection risk); fix by passing the prompt via an environment variable
instead of interpolating it into the shell command and reference that env var
inside the container command, so the shell does not parse user content.
Concretely: stop embedding {{prompt}} inside the double-quoted sh -c string, add
the prompt as a Docker env (e.g. via --env or --env-file entry using the
existing {{env_file}} mechanism) and update the container command invoked by sh
-c (the one that runs claude with -p) to read the prompt from that environment
variable (use the variable name you choose consistently), leaving TRACE_CMD and
LEARN_CMD unchanged.
In `@KAIZEN_LITE.md`:
- Line 116: Fix the typo in the sentence that currently reads "When you the
above, you will see..." in KAIZEN_LITE.md; replace "When you the above" with
"When you run the above" so the line reads "When you run the above, you will
see..." to correct the run instructions.
---
Nitpick comments:
In `@justfile`:
- Around line 26-27: Add the missing dependency so runtime targets will create
the env file before running: update the justfile targets sandbox-run,
sandbox-prompt, and sandbox-test to depend on the sandbox-setup target (i.e.,
add sandbox-setup as a prerequisite for each target) so that the {{env_file}} is
guaranteed to exist prior to execution; keep existing command bodies unchanged
and only modify the target headers to include the dependency.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
demo/workspace/sample.jpgis excluded by!**/*.jpg
📒 Files selected for processing (3)
KAIZEN_LITE.mdjustfilesandbox/sample.env
Pass the prompt through a SANDBOX_PROMPT env variable instead of interpolating it directly into the sh -c string, so quotes and metacharacters in the prompt cannot escape into the shell.
jayaramkr
left a comment
There was a problem hiding this comment.
Wait for the coderabbit
|
@vinodmut unit test failed, can you check? |
Checking. Nothing in this PR is touches the tests, so it's unrelated. |
Add justfile targets for running prompts in the Docker sandbox with optional trace and learn flags. Document a second Kaizen Lite example showing how the agent learns to avoid dead ends (exiftool, Pillow) and go straight to Python stdlib for EXIF parsing in sandboxed environments.
For #76
Summary by CodeRabbit
Documentation
New Features