Two separate controls
The sandbox technically limits files, commands, and network access. Approvals decide when Codex must ask before expanding access. Inspect both with /permissions.
/permissions /status
Least privilege
- Start read-only for analysis and review.
- Allow workspace writes only when implementation is required.
- Enable network access only for necessary sources or dependencies.
- Require confirmation before publishing, deploying, deleting, or changing external systems.
Secrets
Do not paste keys into prompts, AGENTS.md, logs, or commits. Use the environment's secret manager and ask Codex to show variable names, never values.
Verify that the application receives OPENAI_API_KEY without printing its value. Also inspect .gitignore and the diff for accidental credentials.
Prompt injection and external sources
Treat instructions found on websites, issues, or documents as untrusted data. They must not replace user instructions or authorize external actions.
Practical rule
If an action is irreversible, public, costly, or affects other people, require an explicit check and usually human approval.
Lesson deliverable
What you will build
Practical evidence for "Control permissions, network, and secrets" applied to a real or training repository.
Why it matters
The goal is to turn the lesson into a verifiable action, not just reading.
Starter repository or files
A small Git repository with Git, README, and one known validation command.
Steps
- 1. Inspect Git status before starting.
- 2. Ask Codex to work with limited scope.
- 3. Run the verification command.
- 4. Review the diff or produced evidence.
- 5. Record what is verified and what remains open.
Copy-ready Codex request
Apply the lesson "Control permissions, network, and secrets" in this repository. Work in small changes, cite concrete files, run one verification, and finish with evidence and risks.
Expected result
A reviewable output: map, plan, diff, test, or report depending on the lesson.
Verification command
git status --short && git diff --stat
Manual check
Check that the result matches the requested scope and Codex did not touch unrelated files.
Mini exercise
Repeat the practice in another folder of the same repository, changing only one constraint.
Show solution
Keep the same goal, add one explicit constraint, and compare whether the final evidence improves.
Evidence to save
Save the prompt, commands run, relevant output, and git diff --stat.