OpenAI Codex — Real-World Software Engineering

Lesson 2: Repository Setup, Instructions, and Safe Environments

Lesson Objectives

By the end of this lesson, students should be able to:

  • Connect or open the correct repository and branch
  • Write repository-level agent instructions
  • Configure dependencies, tests, and environment variables safely
  • Use branches, worktrees, sandboxes, and backups to isolate change

Lesson Content

Codex quality depends on environment quality. The repository should contain a clear README, setup steps, test commands, style rules, architecture notes, and contribution expectations. Agent-specific instruction files can define directories to avoid, required validation, versioning conventions, and when to ask before changing dependencies or schemas.

Never place secrets in prompts, source files, or logs. Use approved environment-variable or secret-management mechanisms. Give test credentials rather than production credentials. Work on a branch or isolated worktree, keep a known-good baseline, and ensure the change can be discarded.

Before delegating, verify: correct repository, correct branch, clean working tree, dependency install path, build command, test command, lint command, and scope boundaries. If the environment cannot run the project, the agent may guess at fixes without feedback.

Enroll to continue this lesson.

The preview above shows the lesson objectives and opening lesson content. Enroll to view the full lesson, complete the practice work, and take the lesson quiz.

Log In / Create Account
Back to Course