Blog / developer integrations

Hermes Agent with Codex: CLI, App Server, and Config

Use Codex as a focused local coding interface and Hermes as the persistent agent around it. Hermes documents support for importing Codex setup and offers an optional Codex app-server runtime; neither feature makes a ChatGPT or Codex sign-in interchangeable with a Hermes API credential.

Updated Nov 13, 202610 min read
Deployment route
  1. 01

    Choose the integration depth

    Decide between importing Codex configuration, calling the Codex CLI for bounded tasks, or enabling the documented Codex app-server runtime.

  2. 02

    Review Codex configuration and trust

    Inspect `~/.codex/config.toml`, project `.codex/config.toml`, AGENTS.md, MCP servers, profiles, approval policy, and sandbox settings.

  3. 03

    Import reusable setup

    Use the Hermes import flow for supported instructions, rules, MCP servers, skills, memories, and routines, then remove paths or credentials that do not belong in the new runtime.

  4. 04

    Configure model authentication explicitly

    Keep Codex sign-in and Hermes model provider credentials separate. Use only the authentication path supported by the exact client and account.

  5. 05

    Test a bounded repository task

    Run one task in an isolated repository or worktree, inspect the diff, execute tests, and confirm which runtime performed the edit.

  6. 06

    Enable automation only after proof

    Add schedules, messaging, or broader MCP tools only after the basic Codex–Hermes handoff is repeatable and auditable.

Technical blueprint connecting a Codex terminal, imported configuration, an optional app-server runtime, and a persistent Hermes gateway.
Hermes can import compatible setup or run a Codex app-server worker while keeping profiles and credentials isolated.

Four-step path

How do you connect Hermes Agent with Codex?

Choose whether Codex is an external CLI, imported configuration source, or optional app-server runtime, then verify the model and permission boundary.

  1. Step 01

    Choose the integration depth

    Decide between importing Codex configuration, calling the Codex CLI for bounded tasks, or enabling the documented Codex app-server runtime.

  2. Step 02

    Review Codex configuration and trust

    Inspect `~/.codex/config.toml`, project `.codex/config.toml`, AGENTS.md, MCP servers, profiles, approval policy, and sandbox settings.

  3. Step 03

    Import reusable setup

    Use the Hermes import flow for supported instructions, rules, MCP servers, skills, memories, and routines, then remove paths or credentials that do not belong in the new runtime.

  4. Step 04

    Configure model authentication explicitly

    Keep Codex sign-in and Hermes model provider credentials separate. Use only the authentication path supported by the exact client and account.

  5. Step 05

    Test a bounded repository task

    Run one task in an isolated repository or worktree, inspect the diff, execute tests, and confirm which runtime performed the edit.

  6. Step 06

    Enable automation only after proof

    Add schedules, messaging, or broader MCP tools only after the basic Codex–Hermes handoff is repeatable and auditable.

Can Hermes Agent and Codex work together?

Yes. They can share project context and be composed in several ways: Hermes imports supported Codex configuration, invokes the Codex CLI as an external tool, or runs the optional Codex app-server runtime.

  • Codex remains a focused local coding interface.
  • Hermes can add persistent tools, memory, schedules, and channel delivery.
  • The integration depth determines how much configuration and runtime state is shared.
  • Each pattern requires explicit security and model-auth review.

What Codex configuration can Hermes import?

Hermes documents import support for supported Codex instructions, rules, allowlists, MCP servers, skills, memories, and routines. Treat imported configuration as untrusted until you verify each file and tool.

Codex reads personal configuration from `~/.codex/config.toml` and can load trusted project layers from `.codex/config.toml`. It also supports MCP servers, profiles, sandbox settings, and approval policies. Hermes may import compatible setup, but the destination runtime can impose different tool and credential boundaries.

  • Review AGENTS.md and project instructions for stale assumptions.
  • Confirm each imported MCP server is allowed by the Hermes runtime.
  • Remove untrusted project-local hooks, rules, and plugins.
  • Do not migrate secrets that are not needed by the new workflow.
  • Revalidate model names and provider endpoints after import.

What is the Hermes Codex app-server runtime?

The optional Hermes Codex app-server runtime runs a Codex-runtime worker with Codex tools while Hermes exposes additional tools through an MCP callback. It is different from simply importing settings or shelling out to the Codex CLI.

The Hermes documentation describes an integration where Codex remains the model runtime for the turn, Hermes supplies the broader tool layer through MCP, and Hermes memory and skill nudges continue to fire around the worker. That is a deeper coupling than importing configuration and requires profile, approval, and credential review.

  • Use the exact configuration and profile intended for the worker.
  • Verify which tools come from Codex, Hermes, and MCP.
  • Review approval prompts and permission profiles.
  • Keep execution isolated when the worker can edit code or access secrets.
  • Test disablement and restart behavior before production use.

Can Hermes call Codex CLI as an external tool?

Hermes can invoke an installed `codex` command through terminal tools when the command is allowed. Use this for bounded, non-interactive repository tasks and verify the result independently.

  • Run from the intended repository or isolated worktree.
  • Capture the command output and exit status.
  • Use a constrained sandbox and approval policy.
  • Do not expose the user's broad home directory unnecessarily.
  • Review the diff and run repository tests afterward.

Can Hermes reuse a ChatGPT or Codex subscription?

Do not assume a ChatGPT or Codex sign-in can be reused as a general Hermes model credential. Codex authentication belongs to the Codex client and its supported account paths; configure Hermes model access separately with an authorized provider.

  • Keep Codex sign-in inside Codex.
  • Use an approved API key or endpoint when Hermes itself calls a model.
  • Do not copy OAuth tokens or credential files into prompts.
  • Review the official terms for the exact account and surface.
  • Test the selected provider independently before enabling the full workflow.

How should the two agents share repository context?

Share stable repository facts through AGENTS.md and project instructions, then give each runtime only the context and tools required for its part of the task.

  • Keep build and test commands in the repository.
  • Separate user preferences from team rules.
  • Use Git worktrees for parallel isolated work.
  • Avoid letting both agents edit one checkout at the same time.
  • Make one runtime responsible for final tests and diff review.

How should you secure a Codex–Hermes workflow?

Use isolated worktrees, narrow repository credentials, explicit sandbox and approval settings, and separate profiles for personal and team work.

  • Do not give either agent production deployment credentials by default.
  • Review imported config, MCP servers, hooks, and plugins.
  • Use dedicated service identities for automation.
  • Keep `/opt/data`, Codex home, and repository state under separate access boundaries.
  • Rotate credentials that appear in logs, prompts, or screenshots.

Which Codex integration pattern should you choose?

Choose config import for shared setup, CLI invocation for bounded delegation, and app-server runtime only when you need deeper runtime integration and can operate its profile and permission model safely.

The safest default is the least integration that solves the job. Import only what is needed, use a temporary Git worktree for delegated coding, and make Hermes or the human operator verify the final diff and test results.

  • Simple context migration: import supported configuration.
  • Occasional delegated coding: invoke the CLI for a focused task.
  • Persistent Codex-runtime worker: enable app-server runtime after isolation testing.
  • No shared provider access: keep each product's model authentication separate.

Which primary sources support this page?

Product behavior is checked against the current deployment flow. These external links provide the upstream project or channel documentation used for setup details.

Direct answers

Frequently asked questions

Can Hermes import Codex configuration?

Hermes documents import support for supported Codex configuration. Review instructions, MCP servers, skills, memories, routines, and credential references before enabling them.

What is the Codex app-server runtime in Hermes?

It is an optional deeper integration where Hermes runs a Codex-runtime worker and exposes Hermes tools through an MCP callback. It is separate from simple configuration import.

Can Hermes use my ChatGPT subscription token?

Do not infer that a ChatGPT or Codex sign-in can be reused as a general Hermes API credential. Configure model access through a supported provider path.

Can Hermes execute the codex command?

Yes, when Codex is installed and the Hermes terminal tool and permissions allow it. Use bounded commands, capture exit status, and verify the resulting diff.

Should Codex and Hermes share one config file?

Reuse stable repository instructions where supported, but keep runtime-specific profiles, credentials, and personal memory separate.

Which pattern is safest for production work?

Start with imported configuration and explicit CLI delegation. Enable deeper runtime integration only with an isolated worktree, narrow credentials, approval gates, and independent verification.

Key takeaways

  • Use Codex as a focused local coding interface and Hermes as the persistent agent around it. Hermes documents support for importing Codex setup and offers an optional Codex app-server runtime; neither feature makes a ChatGPT or Codex sign-in interchangeable with a Hermes API credential.
  • Start with one model, one channel, and one controlled test conversation.
  • Use managed hosting when deployment speed matters more than operating the server yourself.

Put Hermes Agent in the channel where the work already happens.