diff --git a/.secrets.baseline b/.secrets.baseline index 25406af5..8cc5307d 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "^.secrets.baseline$", "lines": null }, - "generated_at": "2026-01-27T22:16:04Z", + "generated_at": "2026-02-24T16:20:06Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -100,7 +100,7 @@ "hashed_secret": "ec3810e10fb78db55ce38b9c18d1c3eb1db739e0", "is_secret": false, "is_verified": false, - "line_number": 32, + "line_number": 36, "type": "Secret Keyword", "verified_result": null } @@ -153,6 +153,16 @@ "verified_result": null } ], + "sandbox/sample.env": [ + { + "hashed_secret": "b792a28a35da9b44fa0ee8a53002e9c238afb1bd", + "is_secret": false, + "is_verified": false, + "line_number": 1, + "type": "Secret Keyword", + "verified_result": null + } + ], "tests/data/trajectory.json": [ { "hashed_secret": "88de85ead2ab26f647127036827ee7746fcd7514", diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile new file mode 100644 index 00000000..5c68146a --- /dev/null +++ b/sandbox/Dockerfile @@ -0,0 +1,40 @@ +FROM debian:bookworm-slim + +# Install Linux utilities, Python, and jq +RUN apt-get update && apt-get install -y \ + # Basics & editors + bash coreutils findutils grep sed gawk less nano vim tree file which procps psmisc sudo \ + # Networking + curl wget ca-certificates iputils-ping dnsutils netcat-traditional iproute2 \ + # Git + archives + git unzip zip tar gzip bzip2 xz-utils \ + # Build tools + build-essential make \ + # Python + python3 python3-venv python3-pip \ + # JSON parsing + jq \ + && rm -rf /var/lib/apt/lists/* + +# Create non-root user +RUN groupadd sandbox && useradd -m -g sandbox sandbox \ + && mkdir -p /workspace && chown sandbox:sandbox /workspace + +# Create Python venv and make it accessible to sandbox user +RUN python3 -m venv /opt/claude-venv \ + && /opt/claude-venv/bin/python -m pip install --upgrade pip \ + && chown -R sandbox:sandbox /opt/claude-venv + +# Install Claude Code as sandbox user +USER sandbox +RUN curl -fsSL -o /tmp/install.sh https://claude.ai/install.sh \ + && bash /tmp/install.sh \ + && rm /tmp/install.sh + +# Add venv + Claude to PATH +ENV HOME="/home/sandbox" +ENV PATH="/opt/claude-venv/bin:/home/sandbox/.local/bin:${PATH}" + +WORKDIR /workspace + +CMD ["bash"] diff --git a/sandbox/README.md b/sandbox/README.md new file mode 100644 index 00000000..fed9d8d4 --- /dev/null +++ b/sandbox/README.md @@ -0,0 +1,32 @@ +# Claude Code Sandbox + +A Docker image for running Claude Code in a sandboxed Debian environment with Python and common Linux tools. + +## Build + +From the repository root: + +```bash +docker build -t claude-sandbox sandbox/ +``` + +## Run + +1. Copy the sample env file and add your API key: + +```bash +cp sandbox/sample.env sandbox/myenv # edit sandbox/myenv and set your credentials. +``` + +2. Run the container, mounting your project into `/workspace`: + +```bash +docker run --rm -it --env-file sandbox/myenv -v "$(pwd)":/workspace claude-sandbox +``` + +3. Test that Claude Code is working: + +```bash +docker run --rm --env-file sandbox/myenv claude-sandbox claude -p "who are you" +``` + diff --git a/sandbox/sample.env b/sandbox/sample.env new file mode 100644 index 00000000..640c797c --- /dev/null +++ b/sandbox/sample.env @@ -0,0 +1 @@ +ANTHROPIC_API_KEY=sk-ant-xxxx