C.W.K.
Stream
Lesson 04 of 11 · published

Sandbox 정책 — read-only / workspace-write / danger-full-access

~16 min · codex, sandbox, filesystem, network

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

filesystem 과 네트워크 경계, declared

Sandbox 가 에이전트가 할 수 있는지 제어; approval mode 가 언제 먼저 ask 할지 제어. 세 모드: read-only (read 만, write/명령어 X), workspace-write (모두 read + workspace 안에 write, 기본 네트워크 X), danger-full-access (경계 X — sandbox VM 만).

workspace-write 가 로컬 작업 기본. Codex 가 어디든 read 가능, workspace 안에 write 가능, workspace 안 머무는 셸 명령어 run 가능. 명시적 승인 없이 밖에 write, 네트워크 hit, 보호 경로 (~/.ssh, ~/.aws, /etc) 만지기 X. --add-dir 가 sandbox 모델 버리지 않고 특정 추가 디렉토리에 write access 부여.

OS 레벨 강화: macOS Seatbelt 와 Linux Landlock 이 Codex 정책에 더해 커널-강제 격리. config 가 misconfigured 라도 커널 레벨 레이어가 escape 차단. codex seatbelt -- npm test 또는 codex landlock -- python -m pytest 로 OS-강제 셸 wrapper.

Code

Pick the right sandbox per task·bash
# Read-only — analysis without risk
codex --sandbox read-only "explain what this codebase does"

# Workspace-write (default) — normal coding
codex --sandbox workspace-write
# config.toml:
sandbox_mode = "workspace-write"
[sandbox_workspace_write]
network_access = false

# Need an extra writable dir without abandoning sandbox
codex --add-dir /data/shared "regenerate the design tokens"

# Full access — Docker / sandbox VM only
codex --sandbox danger-full-access --ask-for-approval never \
      "fix all eslint errors"
Network allowlist (safer than blanket)·toml
# ~/.codex/config.toml
sandbox_mode = "workspace-write"

[sandbox_workspace_write]
network_access  = true
network_allowlist = [
  "registry.npmjs.org",
  "api.github.com",
  "pypi.org"
]

External links

Exercise

config.toml 에 workspace-write sandbox + 진짜 필요한 host 3개 네트워크 allowlist 설정. allowed host 1개 필요한 작업 run + 작동 확인. non-allowed host 필요한 작업 시도; 예상대로 실패 확인.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.