CI 줄이 눈여겨볼 만합니다. 사람이 없는 환경에서는 물어볼 상대가 없으니 never가 자연스럽습니다. 대신 울타리를 read-only로 가장 좁게 잡습니다. 묻지 않을 거라면 울타리를 줄인다는 원칙입니다.
넓힐 때는 좁게
작업하다 보면 울타리를 넓혀야 할 때가 옵니다. 문서의 권고는 일관됩니다.
승인할 때는 작업이 이어질 수 있는 가장 좁은 범위를 고릅니다.
쓰기 경로가 더 필요하면 샌드박스를 풀지 말고 sandbox_workspace_write.writable_roots로 쓸 수 있는 디렉터리만 늘립니다.
서로 상관없는 저장소까지 접근을 넓히는 대신 별도 프로젝트나 워크트리를 씁니다.
특정 예외는 접근을 통째로 넓히기보다 규칙으로 처리합니다.
네트워크도 같습니다. 도메인을 하나씩 allow·deny로 적을 수 있고, *.example.com은 하위 도메인만, **.example.com은 최상위와 하위 모두를 뜻합니다. 전체를 뜻하는 * 허용은 넓은 접근으로 취급하라고 적혀 있습니다.
클라우드에서는 단계를 나눈다
클라우드 작업은 구조가 조금 다릅니다. 문서의 이전 버전 Codex Cloud 설명에 따르면 작업은 OpenAI가 관리하는 격리된 컨테이너에서 두 단계로 돕니다.
Codex 문서의 클라우드 작업 설명을 그림으로 옮김.
설정 단계에서는 의존성을 설치하려고 네트워크에 접근할 수 있습니다. 그다음 에이전트 단계는 인터넷 접근을 켜지 않는 한 오프라인으로 돕니다. 그리고 클라우드 환경에 설정한 비밀값은 설정 단계에서만 쓸 수 있고, 에이전트 단계가 시작되기 전에 제거된다고 적혀 있습니다.
이 설계가 노리는 것은 분명합니다. 모델이 코드를 읽고 명령을 실행하는 시간에는 훔쳐 갈 비밀값도, 보낼 곳도 없게 만드는 것입니다.
왜 이렇게까지 하나
문서는 인터넷 접근을 켤 때의 위험을 직접 적습니다. 프롬프트 인젝션이 에이전트로 하여금 신뢰할 수 없는 지시를 가져와 따르게 만들 수 있다고요. 그래서 웹 결과는 신뢰하지 않는 입력으로 다루라고 합니다. 웹 검색은 기본으로 캐시된 색인을 써서 실시간 콘텐츠 노출을 줄인다는 설명도 붙어 있습니다.
전체 접근의 위험도 구체적입니다. 악의적인 프로젝트를 전체 접근으로 열면 개발 컨테이너 안에 있는 모든 것, Codex 자격 증명까지 밖으로 빼낼 수 있다고 경고합니다.
바이브 코딩을 하다 보면 승인 창이 귀찮아지는 순간이 반드시 옵니다. 그때 --yolo를 누르기 전에 떠올릴 질문은 하나입니다. 지금 이 에이전트가 읽고 있는 것 중에 내가 쓰지 않은 텍스트가 있는가. 있다면 그 텍스트도 에이전트에게 지시를 내릴 수 있습니다.
The moment you hand over the terminal to an agent, the question changes. From "Can it code well?" to "What will you allow it to do?"
The reason vibe coding feels convenient is that work progresses without a person having to check every detail. That convenience becomes the risk. While you are not checking, you need to decide what the agent can delete, where it can connect, and what it can send out.
OpenAI's Codex documentation breaks this problem down into two handles.
Two Handles
The first is the sandbox. It defines what the agent can technically do—i.e., which files it can modify and whether commands can use the network.
The second is the approval policy. It defines when the agent should ask a person before crossing that boundary.
One sentence in the documentation summarizes the relationship between the two. The sandbox sets the technical limits, and the approval policy sets when the agent should ask before crossing those limits.
A diagram overlaying the three sandbox levels and the approval policy from the Codex documentation. You set the size of the fence and the nature of the gatekeeper separately.
Three Levels of the Fence
There are three sandbox modes.
read-only: You can view files, but you cannot modify them or run commands without approval.
workspace-write: You can modify within the workspace and run everyday local commands. This is the default for local work.
danger-full-access: Runs without sandbox restrictions. The boundaries of the file system and network disappear.
The fence is built using OS features. macOS uses the built-in Seatbelt, Linux and WSL2 use bubblewrap, and Windows uses PowerShell's native sandbox.
The defaults at startup are also set. Version-controlled folders start as Auto (workspace-write + ask when needed), and non-version-controlled folders start as read-only. And by default, the agent's network access is turned off.
The reason for splitting defaults by version control status is easy to guess. If git is present, you can revert bad changes, but if it is not, there is no way to revert.
Combination Table
The documentation provides a table of recommended combinations by intent. Translated as-is:
No sandbox and no approval; the documentation does not recommend it
The CI fence is worth paying attention to. In a headless environment, there is no one to ask, so never feels natural. Instead, you set the fence as narrowly as possible with read-only. The principle is: if you are not going to ask, tighten the fence.
When expanding, start narrow
As you work, there will come a time when you need to widen the fence. The documentation's guidance is consistent.
When approving, choose the narrowest scope that allows the work to continue.
If you need more write paths, do not unlock the sandbox; instead, expand only the writable directories via sandbox_workspace_write.writable_roots.
Instead of broadening access to unrelated repositories, use separate projects or worktrees.
Handle specific exceptions with rules rather than widening access wholesale.
The same applies to networking. You can list domains one by one with allow and deny. *.example.com means subdomains only, while **.example.com means both the top-level and subdomains. Allowing * for everything is treated as broad access.
In the cloud, split the stages
Cloud workflows have a slightly different structure. According to the previous version of the Codex Cloud documentation, work runs in two stages inside an isolated container managed by OpenAI.
Adapted from the Codex documentation's description of cloud work.
In the setup stage, you can access the network to install dependencies. After that, the agent stage runs offline unless internet access is turned on. The documentation states that secrets configured in the cloud environment are only available during the setup stage and are removed before the agent stage begins.
The intent of this design is clear: during the time the model reads code and executes commands, there are no secrets to steal and nowhere to send them.
Why go this far
The documentation directly states the risk of enabling internet access: prompt injection can cause the agent to fetch and follow untrusted instructions. Therefore, web results should be treated as untrusted input. It also notes that web search uses a cached index by default to reduce exposure to real-time content.
The risks of broad access are also concrete. Opening a malicious project with full access could allow extraction of everything inside the development container, including Codex credentials.
When vibe coding, there will inevitably come a moment when the approval prompt feels annoying. Before pressing --yolo at that moment, the one question to ask is: is there any text I did not write that this agent is reading right now? If there is, that text can also give instructions to the agent.