Skip to content

feat: add sandbox demo tooling and EXIF extraction example - #80

Merged
visahak merged 3 commits into
AgentToolkit:mainfrom
vinodmut:sandbox
Feb 26, 2026
Merged

feat: add sandbox demo tooling and EXIF extraction example#80
visahak merged 3 commits into
AgentToolkit:mainfrom
vinodmut:sandbox

Conversation

@vinodmut

@vinodmut vinodmut commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

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

    • Added comprehensive example walkthrough with detailed multi-session narratives demonstrating sandboxed scenarios
    • Updated stored-entity examples and guidance for sandbox environments
  • New Features

    • Introduced automation tooling for sandbox environment management including build, setup, and execution targets
    • Added sandbox environment configuration support

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.
@coderabbitai

coderabbitai Bot commented Feb 26, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@vinodmut has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between bed75b2 and 4fbb357.

📒 Files selected for processing (2)
  • KAIZEN_LITE.md
  • justfile
📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Documentation & Examples
KAIZEN_LITE.md
Replaced initial example heading with "Example 1 — Learning a user preference," added comprehensive "Example 2 — Learning from failure in a sandboxed environment" with multi-session narratives, and updated entity storage guidance to advocate Python stdlib (struct module) over PIL/Pillow for sandboxed contexts.
Sandbox Automation
justfile
New file introducing build and execution automation for Claude sandbox environment with targets for image building (sandbox-build), environment setup (sandbox-setup), interactive shells (sandbox-run), one-shot prompt execution (sandbox-prompt) with optional trace and learning modes, verification (sandbox-test), and cleanup (sandbox-clean).
Environment Configuration
sandbox/sample.env
Added two environment variables: KAIZEN_DEBUG=1 and IS_SANDBOX=1 to support sandboxed execution modes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Suggested reviewers

  • jayaramkr
  • visahak

Poem

🐰 A sandbox where learning takes flight,
From failure we craft paths of might,
Just targets and env vars align,
With stdlib wisdom that brightly will shine,
Kaizen in containers—pure delight! 🏗️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding sandbox demo tooling (justfile with sandbox targets) and documenting an EXIF extraction example using stdlib instead of third-party libraries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
justfile (1)

26-27: Add sandbox-setup dependency to runtime targets.

These targets require {{env_file}} to exist. Currently, sandbox-run, sandbox-prompt, and sandbox-test have no dependencies and will fail on first run if the env file hasn't been created. Adding the sandbox-setup dependency 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

📥 Commits

Reviewing files that changed from the base of the PR and between aa34fc4 and bed75b2.

⛔ Files ignored due to path filters (1)
  • demo/workspace/sample.jpg is excluded by !**/*.jpg
📒 Files selected for processing (3)
  • KAIZEN_LITE.md
  • justfile
  • sandbox/sample.env

Comment thread justfile Outdated
Comment thread KAIZEN_LITE.md Outdated
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 jayaramkr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait for the coderabbit

@visahak

visahak commented Feb 26, 2026

Copy link
Copy Markdown
Collaborator

@vinodmut unit test failed, can you check?

@vinodmut

Copy link
Copy Markdown
Contributor Author

@vinodmut unit test failed, can you check?

Checking. Nothing in this PR is touches the tests, so it's unrelated.

@visahak
visahak merged commit 0b3a8e8 into AgentToolkit:main Feb 26, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants