# Extension points — openai/codex

> Canonical page: https://codevetter.com/unpack/codex/extension-points

# Extension points — openai/codex

Scanned commit a1f40f3f1326eff7c81b860a4f4e27c1be186e10 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Codex is extended by adding a tool spec and handler, an MCP server entry, a feature flag, a slash command, a CLI subcommand, or an app-server v2 method. Model providers plug in through `WireApi` and config `model_providers`. Skills, execpolicy rules, and sandbox policies are user-level extension points that do not require a fork. New crates are preferred over new modules in `codex-core`. Protocol extensions must update serde and ts-rs annotations together and regenerate schema fixtures.
- TUI slash commands are the `SlashCommand` enum and its parse table in `tui/src/slash_command.rs`. Adding a command means a variant, a description, a dispatch arm in the composer/chat widget path, and an insta snapshot. — [codex-rs/tui/src/slash_command.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/tui/src/slash_command.rs) [codex-rs/tui/src/bottom_pane/chat_composer.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/tui/src/bottom_pane/chat_composer.rs) [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md)
- CLI subcommands are the `Subcommand` enum in `cli/src/main.rs` (clap). New top-level commands belong there only if they are user-facing binaries; library behavior belongs in a crate the CLI calls. — [codex-rs/cli/src/main.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/cli/src/main.rs) [codex-rs/Cargo.toml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/Cargo.toml)
- Model providers extend via config `[model_providers.<id>]` (base_url, wire_api `responses` or `chat`, env_key). `ModelClient` switches on `WireApi`. A new HTTP shape requires a client arm, not a TUI change. — [codex-rs/core/src/client.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/src/client.rs) [docs/config.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/docs/config.md) [codex-rs/core/src/config/mod.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/src/config/mod.rs)
- Execpolicy is a user-authored policy language (`prefix_rule`, pattern rules) interpreted by the `codex-execpolicy` crate. New rule kinds are crate changes; new rules of existing kinds are config-only. — [codex-rs/execpolicy/src/lib.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/execpolicy/src/lib.rs) [docs/execpolicy.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/docs/execpolicy.md)
- Context injection extends through `ContextualUserFragment` implementors under `core/src/context`. New fragments must be bounded structs. This is the only supported way to add text the model sees every turn. — [codex-rs/core/src/context/mod.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/src/context/mod.rs) [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md)
- Sandbox policies extend by adding a `SandboxPolicy` variant or a platform executor. macOS profiles are strings in `seatbelt.rs`; Linux uses the `linux-sandbox` crate; Windows uses the Windows sandbox crate. All three must stay behaviorally aligned. — [codex-rs/sandboxing/src/seatbelt.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/sandboxing/src/seatbelt.rs) [codex-rs/linux-sandbox/src/lib.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/linux-sandbox/src/lib.rs) [codex-rs/core/src/sandboxing/mod.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/src/sandboxing/mod.rs)
- Internal agent roles and graphs (`codex-agent-roles`, `codex-agent-identity`, `codex-agent-graph-store`) are separate workspace crates for multi-agent structure, not part of the CLI multitool match. They are the intended home for new agent-graph concepts instead of `codex-core`. — [codex-rs/agent-roles/Cargo.toml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/agent-roles/Cargo.toml) [codex-rs/agent-identity/Cargo.toml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/agent-identity/Cargo.toml) [codex-rs/agent-graph-store/Cargo.toml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/agent-graph-store/Cargo.toml)
- Config schema is generated. After any `ConfigToml` or nested config type change, `just write-config-schema` rewrites `codex-rs/core/config.schema.json`. Docs that mirror keys live in `docs/config.md` and `docs/example-config.md`. — [codex-rs/core/config.schema.json](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/config.schema.json) [docs/config.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/docs/config.md) [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
