Team Workflows and Custom Configurations
Codex is not just a solo developer tool. When an entire team uses it, you need shared configurations, consistent behaviors, and workflows that integrate with your existing development process. This lesson covers how to configure Codex for team use and build workflows that scale.
What You Will Learn
- How AGENTS.md gives Codex your team's instructions
- How config.toml sets defaults like the sandbox and approval policy
- How to run Codex in scripts and CI/CD with
codex exec - Common team workflow patterns with Codex
- How to manage access and permissions for team use
Configuring Codex for Your Team
Codex can be configured at multiple levels, from individual preferences to team-wide defaults.
Project-Level Configuration
The most common approach is to add Codex files to your repository. This ensures every team member gets the same behavior when they run Codex in the project.
Codex uses two kinds of files:
- AGENTS.md: plain-language instructions, such as architecture, coding conventions, testing, and git rules
- config.toml: settings, such as the default sandbox and approval policy, the model, and skills
config.toml
Personal settings live in ~/.codex/config.toml. A project can also have its own .codex/config.toml, which Codex uses once you trust the project. For example, to make the recommended permission setup the default:
sandbox_mode = "workspace-write"
approval_policy = "on-request"
The Custom permission mode you saw earlier uses the permissions defined here.
AGENTS.md Instruction Files
Similar to how many AI tools use instruction files (like CLAUDE.md for Claude Code or .github/copilot-instructions.md for Copilot), Codex reads AGENTS.md files, from your Codex home folder and from the repo root down to your current folder. Run /init to create one.
Here is how Codex finds them:
- Global:
~/.codex/AGENTS.mdholds your personal defaults for every project. - Project: Codex starts at the repository root and walks down to the folder you are working in. It reads one AGENTS.md from each folder on the way.
- Order: Files closer to your current folder come later, so their instructions win.
- Overrides: An
AGENTS.override.mdin the same folder is used instead of AGENTS.md.
By default, Codex stops adding files once the combined text reaches 32 KiB. Keep each file short, or split instructions into AGENTS.md files in subfolders.
Here is an example AGENTS.md for a project:
# Project Instructions for Codex
## Architecture
- This is a Node.js monorepo using Turborepo
- Backend services are in packages/api/
- Frontend app is in packages/web/
- Shared types are in packages/types/
## Coding Conventions
- Use TypeScript strict mode everywhere
- Use named exports, not default exports
- Error handling: use custom AppError class from packages/shared/errors
- All API responses follow the shape: { success: boolean, data?: T, error?: string }
## Testing
- Use Vitest for all tests
- Place tests in __tests__/ directories
- Use factories from test/factories/ for test data
- Integration tests use a test database (see .env.test)
## Git
- Branch names: feature/, fix/, chore/
- Commit messages follow Conventional Commits
- Always create a PR, never push directly to main
When Codex reads this file, it follows these instructions for every task. Commit it to the repository so the whole team shares it.
Team Workflow Patterns
Pattern 1: Task Delegation
A team lead breaks down a feature into discrete tasks and dispatches them to Codex Cloud:
- Lead creates tasks in Codex Cloud based on sprint tickets
- Each task runs in parallel as an isolated agent
- Lead reviews results and requests revisions where needed
- Approved changes are merged as PRs to the repository
This works well for tasks that are well-defined and independent, like adding tests, fixing bugs, or implementing small features.
Pattern 2: Pre-Commit Review
Before committing code, developers run Codex as a review step. Inside a session, the /review command reviews your changes and finds issues. You can also ask directly:
codex "review my staged changes for bugs, security issues, and style violations"
This catches issues before they make it into the codebase and before a human code review.
Pattern 3: PR Enhancement
After a developer opens a pull request, Codex can enhance it:
codex "review this PR, add any missing tests, update affected documentation, and verify the code follows our project conventions"
Pattern 4: Onboarding Automation
New team members use Codex to understand the codebase:
codex "explain the architecture of this project, key design decisions, and the development workflow"
Combined with a good AGENTS.md, this gives new developers a fast path to understanding.
Pattern 5: Maintenance Workflows
Regular maintenance tasks can be delegated to Codex:
- Dependency updates: "Update all npm dependencies, run tests, fix any breaking changes"
- Code cleanup: "Find and remove unused imports, variables, and dead code"
- Security patches: "Check for known vulnerabilities in our dependencies and update affected packages"
- Documentation sync: "Update the API docs to match the current implementation"
CI/CD Integration
Plain codex opens the interactive interface, which is not what you want in a script. For scripts and CI, use codex exec. It runs a task without the interactive UI and prints the result.
A few things to know:
codex execruns in a read-only sandbox by default. Add--sandbox workspace-writewhen the job needs to edit files.- Give each job the least permissions it needs.
--jsonprints JSON Lines output for other tools to read, and-o <path>saves only the final message.- For authentication, set
CODEX_API_KEYonly on the single command that needs it, not as a job-wide environment variable. - For GitHub Actions, OpenAI offers a Codex GitHub Action, so you do not have to install and sign in to the CLI yourself.
Common integration points:
Automated Code Review in CI
Add a CI step that runs Codex to review every pull request:
# Example CI configuration concept
review-step:
name: Codex Code Review
run: codex exec "review the changes in this PR for bugs, security issues, and convention violations"
Automated Test Generation
When new code is pushed without tests, Codex can generate them:
test-generation:
name: Generate Missing Tests
run: codex exec --sandbox workspace-write "identify functions without test coverage and generate tests for them"
Documentation Updates
Keep documentation in sync with code changes:
docs-update:
name: Sync Documentation
run: codex exec --sandbox workspace-write "update API documentation to reflect any changes in route handlers"
Managing Team Access
ChatGPT workspace plans for teams and companies add admin controls on top of the settings above. For example, an organization can turn off a permission mode, and cloud environments can be shared with only you or with everyone in the workspace. What each plan includes changes over time, so check OpenAI's docs for your plan.
Best Practices for Team Adoption
- Start with Ask for approval: Have the team use the recommended mode first to build trust
- Create shared skills: Build skills for your most common tasks and commit them to
.agents/skills - Write a good AGENTS.md: Invest time in clear project instructions
- Review before merging: Always have a human review Codex-generated changes
- Use Cloud for parallelism: Delegate independent tasks to Cloud for faster throughput
- Track what works: Note which types of tasks Codex handles well and which need human attention
Key Takeaways
- Codex reads AGENTS.md files from
~/.codexand from the repo root down to your current folder; run/initto create one - Put settings like the sandbox and approval policy in
config.toml(~/.codex/config.tomlor a trusted project's.codex/config.toml) - Use
codex execfor scripts and CI; it starts in a read-only sandbox - Common team patterns include task delegation, pre-commit review, PR enhancement, and maintenance automation
- Integrate Codex into CI/CD for automated reviews, test generation, and documentation updates
- Workspace plans for teams add admin controls; check OpenAI's docs for what your plan includes
- Start with Ask for approval for team adoption and give more freedom as trust builds
- Invest in shared skills and a clear AGENTS.md for the biggest productivity gains
Quiz
Up next ยท Lesson 10 of 11
Multi-Agent Coordination for Large Projects
5 min read
9 of 11 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

