{"id":"claude-code-sandbox","kind":"workflow","testedWith":[],"durationMin":15,"url":"https://opencurrent.ai/w/claude-code-sandbox","title":"샌드박스로 안전하게 맡기기","summary":"샌드박스를 켜면 Claude Code의 셸 명령이 작업 폴더와 허용한 주소 밖으로 나가지 못해, 승인 창을 줄이고 오래 맡겨도 사고 범위가 좁아집니다.","category":"개발","categoryId":"dev","domain":"dev","domainLabel":"개발","capabilities":[{"id":"code","label":"코드 작성"}],"topics":[{"id":"dev","label":"개발"}],"tools":["Claude Code"],"whenToUse":"/sandbox로 샌드박스를 켜고 자동 허용 모드를 고른 뒤, 필요한 쓰기 경로와 네트워크 주소만 설정에 엽니다. 시험 명령으로 막히는지 확인하고, 자동 모드(auto)와 함께 쓸 때의 한계도 알아 둡니다. 명령과 설정 이름은 2026년 11월 21일에 Claude Code 공식 문서로 확인했습니다.","prerequisites":["Claude Code 설치와 로그인"],"inputs":[],"howToFollow":"1. 준비물이 갖춰졌는지 먼저 확인할 것.\n2. 단계를 순서대로 진행할 것. kind가 \"ai\"면 프롬프트를 실행하고, \"command\"면 사용자의 허락을 받고 명령을 실행하고, \"human\"이면 사용자에게 할 일을 안내하고 끝났는지 물을 것. tool이 있으면 그 도구·모델로 할 것.\n3. 단계에 output(결과 이름)이 있으면 그 단계 결과를 뒤 단계 프롬프트의 {{output}} 자리에 넣을 것.\n4. 단계마다 expected(기대 결과)와 check(확인 방법)로 제대로 됐는지 확인하고, 다르면 다음 단계로 넘어가지 말고 사용자에게 알릴 것. 끝나면 example.output(있으면)과 비교할 것.\n5. 검증 상태가 verified가 아니면 그 사실을 사용자에게 먼저 알릴 것. 답에 url을 출처로 밝힐 것.","steps":[{"n":1,"kind":"command","title":"샌드박스 켜기","body":"세션에서 /sandbox를 열어 켭니다. macOS·Linux·WSL2에서 동작하고, Linux와 WSL2는 bubblewrap과 socat이 필요합니다.","prompt":"/sandbox","expected":"켜진 샌드박스","check":"/sandbox 화면에 켜짐이 보이는지 확인","tool":"Claude Code"},{"n":2,"kind":"human","title":"모드 고르기","body":"Mode 탭에서 자동 허용을 고르면 샌드박스 안의 셸 명령은 묻지 않고 돕니다. deny 규칙과 git push 같은 ask 규칙은 그대로 묻습니다.","expected":".claude/settings.local.json에 저장된 모드","check":"평범한 셸 명령이 승인 창 없이 도는지 확인","tool":"Claude Code"},{"n":3,"kind":"human","title":"쓰기 경로와 주소 열기","body":"기본으로는 작업 폴더와 임시 폴더만 쓸 수 있고, 네트워크는 allowedDomains에 적은 주소만 나갑니다(처음엔 비어 있음). 필요한 것만 엽니다.","prompt":"{\n  \"sandbox\": {\n    \"enabled\": true,\n    \"filesystem\": { \"allowWrite\": [\"/tmp/build\"] },\n    \"network\": { \"allowedDomains\": [\"registry.npmjs.org\"] }\n  }\n}","expected":"필요한 것만 연 설정","check":"npm install이 되는지 확인","tool":"Claude Code"},{"n":4,"kind":"ai","title":"막히는지 시험","body":"작업 폴더 밖 쓰기와 허용하지 않은 주소가 막히는지 직접 봅니다.","prompt":"touch ~/sandbox-probe 와 curl --noproxy '*' https://example.com 을 실행하고 결과를 알려 줘.","expected":"두 명령 모두 실패","check":"홈 폴더에 sandbox-probe 파일이 없는지 확인","tool":"Claude Code"},{"n":5,"kind":"human","title":"샌드박스 없이는 못 돌게 (선택)","body":"샌드박스를 쓸 수 없을 때 그냥 돌지 않고 멈추게 하려면 failIfUnavailable을 켭니다. 샌드박스 밖 재시도를 막으려면 allowUnsandboxedCommands를 false로 둡니다.","prompt":"\"sandbox\": { \"enabled\": true, \"failIfUnavailable\": true, \"allowUnsandboxedCommands\": false }","expected":"엄격 설정","check":"샌드박스를 못 쓰는 환경에서 시작이 멈추는지 확인","tool":"Claude Code"}],"pitfalls":["Read·Edit·WebFetch 같은 내장 도구와 훅, 로컬 MCP 서버는 샌드박스 밖에서 돎. 이것들은 권한 규칙으로 막기","기본 설정은 ~/.ssh 같은 자격 증명 파일도 읽을 수 있음. sandbox.filesystem.denyRead로 막기","github.com처럼 넓은 주소를 열면 데이터가 나갈 길이 생김","자동 모드(auto)는 분류 모델이 위험한 동작을 걸러 주지만 안전을 보장하지 않음"],"sources":[{"title":"Claude Code 문서: 샌드박스","url":"https://code.claude.com/docs/en/sandboxing"},{"title":"Claude Code 문서: 권한 모드(자동 모드)","url":"https://code.claude.com/docs/en/permission-modes"}],"verification":{"status":"pending","label":"검수 대기","detail":"사람 확인 전","verifiedBy":0,"lastVerifiedAt":null},"quality":{"score":32,"components":{"result":0.5,"trust":0,"freshness":0.4},"explanation":"확인 없음 · 검수 대기"},"workedFor":0,"trials":{"summary":"","lastAt":null,"total":0,"worked":0,"partial":0,"failed":0,"recent":[]},"asOf":{"date":"2026-11-21T10:00:00+00:00","basis":"updated"},"updatedAt":"2026-11-21T10:00:00+00:00","goals":[{"id":"dev","title":"개발"}],"uses":4,"likes":0}