Running Codex safely at OpenAI
Key Points
- Sandboxing + approval gating with Auto-review
- Managed network proxy and domain allow/deny lists
- OpenTelemetry agent logs for auditing and triage
Summary
This post describes how OpenAI deploys Codex with engineering-friendly controls to keep coding agents productive while minimizing risk. The approach combines sandboxed execution, approval policies (including an Auto-review mode), managed network policies, enforced identity/credential handling, configurable command rules, centrally managed configurations, and agent-native telemetry (OpenTelemetry) to enable auditing and AI-assisted security triage.
Key Points
- Sandboxing + approvals: define writable/readonly workspace roots and sandbox modes (
read-only,workspace-write); require explicit approvals for actions outside the sandbox. Useauto_reviewto auto-approve routine, low-risk requests. - Network policies: use a managed proxy to allow expected destinations, block known bad domains, require approval for unfamiliar hosts, and restrict web fetches to cached content where appropriate.
- Identity & credentials: store CLI and MCP OAuth credentials in the secure OS keyring, force login via ChatGPT, and pin usage to a specific enterprise ChatGPT workspace so actions are tied to workspace-level controls and compliance logs.
- Command rules: implement
prefix_rule-style policies to allow common, benign commands (e.g., read-only GitHub orkubectlinspection) while blocking or requiring approval for dangerous patterns. - Managed configs: enforce admin-controlled requirements across desktop, CLI, and IDE integrations; combine cloud-managed requirements, macOS managed preferences, and local requirement files for consistent baselines and phased rollouts.
- Agent-native telemetry & audit trails: export user prompts, approval decisions, tool executions, MCP usage, and network allow/deny events via OpenTelemetry. Route logs to SIEM/compliance platforms and feed them into AI security triage for intent analysis and escalation.
Practical checklist for engineers
- Define and enforce sandbox modes and writable roots for development workspaces.
- Configure approval policy and enable
auto_reviewfor low-risk operations to reduce friction. - Deploy a managed network proxy: set
allowed_domains,denied_domains, and restrict web fetches to cached modes where needed. - Pin authentication: store creds in OS keyring and require
forced_chatgpt_workspace_idfor enterprise auditing. - Create rule sets for common CLIs to allow safe inspection commands and require approval for destructive or networked commands.
- Enable OpenTelemetry logs (
log_user_prompt = true) and export to your SIEM for audit, monitoring, and integration with security triage agents.
Outcome
When combined, these controls let teams run Codex inside clear technical boundaries, move quickly on low-risk developer flows, and force explicit review on higher-risk actions—while preserving agent-aware telemetry for audit and incident investigation.