Configure Native Codex Plugins for Codex-mode OpenClaw Agents

This page explains how to enable native Codex plugins for Codex-mode OpenClaw agents, including requirements and migration rules. It is for developers setting up the Codex harness.

Read this when

  • You want Codex-mode OpenClaw agents to use native Codex plugins
  • You are migrating source-installed openai-curated Codex plugins
  • You are discovering or installing a Codex marketplace plugin
  • You are troubleshooting codexPlugins, app inventory, destructive actions, or plugin app diagnostics

Native Codex plugin support enables a Codex-mode OpenClaw agent to tap into the app and plugin features of Codex app-server directly within the same Codex thread that processes the OpenClaw turn. Plugin calls remain inside the native Codex transcript, and Codex app-server handles all app-backed MCP execution. OpenClaw does not convert Codex plugins into synthetic codex_plugin_* OpenClaw dynamic tools.

Refer to this page once the base Codex harness is operational.

Requirements

  • The agent runtime must be set to the native Codex harness.
  • plugins.entries.codex.enabled is set to true.
  • plugins.entries.codex.config.codexPlugins.enabled is set to true.
  • Codex app-server must report version 0.147.0 or higher. The official plugin delivers @openai/codex 0.148.0; accepted third-party versions still undergo the standard startup and capability checks.
  • The target Codex app-server has visibility into the expected marketplace, plugin, and app inventory.
  • Migration is restricted to openai-curated plugins that were seen as source-installed in the source Codex home. Codex presents the same catalog to API-key and Bedrock accounts under the openai-api-curated wire name; OpenClaw treats both names as a single curated catalog, so configured openai-curated plugins resolve from either account type.
  • Native runtime support also covers other marketplaces already accessible to Codex, including openai-bundled, openai-primary-runtime, workspace-directory, and marketplace manifests located in the current repository. Plugins stay unavailable until an owner or operator.admin explicitly installs or enables their marketplace-qualified identity.

codexPlugins does not affect OpenClaw-provider runs, ACP conversation bindings, or other harnesses, since those paths never create Codex app-server threads with native apps configuration.

OpenAI-side Codex account, app availability, and workspace app/plugin controls are governed by the signed-in Codex account. Consult Using Codex with your ChatGPT plan for details on the OpenAI account and admin model.

Quickstart

Preview the migration from the source Codex home:

openclaw migrate codex --dry-run

Add --verify-plugin-apps to have migration read the source installed app snapshot and app metadata, requiring every owned app to be present, enabled, and accessible before native activation is planned:

openclaw migrate codex --dry-run --verify-plugin-apps

Apply the migration once the plan appears correct:

openclaw migrate apply codex --yes

Migration writes explicit codexPlugins entries for eligible plugins and invokes Codex app-server plugin/install for the selected plugins. A migrated configuration resembles this:

{
  plugins: {
    entries: {
      codex: {
        enabled: true,
        config: {
          codexPlugins: {
            enabled: true,
            allow_destructive_actions: true,
            plugins: {
              "google-calendar": {
                enabled: true,
                marketplaceName: "openai-curated",
                pluginName: "google-calendar",
              },
            },
          },
        },
      },
    },
  },
}

Migration is limited to openai-curated. To locate another plugin that Codex can already see, enumerate the available marketplace catalog and install the exact marketplace-qualified identity:

/codex plugins available
/codex plugins install security-review@company-tools

Codex discovers repository marketplaces through .agents/plugins/marketplace.json in the current conversation workspace. An owner does not need to register that marketplace in OpenClaw configuration before listing or installing its plugins. Official bundled, primary-runtime, curated, workspace, shared, and personal marketplaces depend on the signed-in Codex account and upstream feature or administrator policies. When Codex requires marketplace sources to be explicitly configured or allowlisted, those requirements remain in force; OpenClaw does not bypass them.

Installation creates an explicit configuration entry like this:

{
  plugins: {
    entries: {
      codex: {
        enabled: true,
        config: {
          codexPlugins: {
            enabled: true,
            plugins: {
              "security-review@company-tools": {
                enabled: true,
                marketplaceName: "company-tools",
                pluginName: "security-review",
              },
            },
          },
        },
      },
    },
  },
}

The install command verifies the authenticated owner or administrator before calling Codex plugin/install. Codex continues to enforce marketplace source, workspace administrator, account, and connector-authentication policies. Remote plugins that need a Codex installation interstitial, or that do not indicate whether one is required, must be installed in Codex first; rerun the OpenClaw install command afterward to authorize the already-installed plugin. OpenClaw keeps apps hidden when the response omits the exact marketplace, plugin identity, detail identity, or app-readiness evidence. If a connector requires additional sign-in, finish that authorization before expecting the plugin's tools to become available.

After a codexPlugins change, new Codex conversations automatically pick up the updated app set. Run /new or /reset to refresh the current conversation. A gateway restart is not needed for plugin enable/disable changes.

Scheduled automations

When an authenticated owner creates an automation from a Codex turn, OpenClaw records the app IDs and approval limits callable on that specific Codex thread. The stored authority is tied to the creator's prepared Codex profile and account. Scheduled runs intersect that cap with current Codex policy and app availability. They never acquire new app IDs or a broader destructive, open-world, or approval ceiling. Tools added later within an already captured app may run only when both the stored ceiling and current policy permit them.

Scheduled app calls run unattended. Only actions explicitly allowed both at job creation and at execution time can proceed without a prompt. An action that still requires approval or elicitation is declined. A changed account, runtime, revoked app, narrower policy, or unavailable inventory halts before app execution and reports how to restore access or reauthorize the automation. Model fallbacks cannot transfer this authority to another runtime or account.

Jobs created before app authority capture may keep their ordinary OpenClaw tool cap and continue non-app work, but cannot recover Codex app access automatically. Recreate or reauthorize only a job that needs app access, from a fresh authenticated owner turn. See Automations. Ordinary edits preserve captured app authority. Explicitly replacing a job's toolsAllow cap without a fresh authenticated Codex authority capture clears that authority; the next run reports that app access requires reauthorization. An update from a fresh authenticated owner turn can instead capture and store a new app ceiling for the updated job.

Manage plugins from chat

/codex plugins inspects or modifies configured native Codex plugins from the same chat where you operate the Codex harness:

/codex plugins
/codex plugins list
/codex plugins available
/codex plugins install security-review@company-tools
/codex plugins disable google-calendar
/codex plugins enable google-calendar
/codex plugins disable security-review@company-tools

/codex plugins serves as an alias for /codex plugins list. The list displays each configured plugin's key, on/off state, Codex plugin name, and marketplace from plugins.entries.codex.config.codexPlugins.plugins.

available reads Codex's marketplace catalog using the bound workspace, so it can discover repository-local plugins without enabling them. The owner-scoped codex_plugins model tool is also read-only: it can suggest an exact install command but cannot install, enable, or add a marketplace.

install, enable, and disable require the owner or a gateway client with the operator.admin scope. OpenClaw's reserved /codex command is dispatched before agent invocation, so a model-generated recommendation does not count as installation approval. For a plugin that Codex has not installed yet, install calls the Codex app-server and records the explicit plugin policy only after installation succeeds. If Codex confirms that the plugin is already installed and enabled, the same command records its authorization without reinstalling it. enable and disable modify OpenClaw's persisted policy; qualified identities and existing configuration keys are both accepted.

Installing or enabling a configured plugin also activates the global codexPlugins.enabled switch without enabling allow_all_plugins. If a plugin reports auth_required, authorize the app in Codex before starting a new conversation. Authorization remains valid for later conversations until the plugin is disabled or the upstream account or workspace revokes access.

Only install plugins you trust. A Codex plugin can contribute skills, apps, MCP servers, and hooks. Some hooks can participate in permission decisions, so explicit installation trusts the selected plugin's code; it is not a security review or an isolation boundary.

How native plugin setup works

The integration tracks three states:

StateMeaning
InstalledCodex has the plugin bundle in the target app-server runtime.
EnabledCodex reports the plugin enabled, and OpenClaw config allows it for Codex harness turns.
AccessibleCodex app-server confirms the plugin's app entries are available for the active account and map to the configured plugin identity.

For openai-curated plugins, migration is the durable install/eligibility step:

  • During the planning phase, OpenClaw pulls source Codex plugin/read details and verifies the source Codex app-server account. codex_subscription_required indicates that account/read confirmed an API-key or other non-ChatGPT account; the absence of an account does not prove that a subscription does not exist.
  • Migration by default skips source app inventory calls: app-backed source plugins that satisfy the account gate are planned without checking source app accessibility. A missing account or a failed account/read causes them to be skipped with codex_account_unavailable.
  • With --verify-plugin-apps, migration captures a fresh source app/installed snapshot, retrieves authenticated metadata via app/read, and demands that every owned app be present, enabled, and reachable in the source Codex account prior to planning native activation. Should account/read be absent or fail, strict verification can still demonstrate access using the source app-server's configured bearer or header authentication. A positively identified non-ChatGPT account stays ineligible.

For explicitly approved plugins originating from any discovered marketplace, OpenClaw relies on its plugin/installed snapshot and plugin/read details to pin down the exact marketplace-qualified identity and app ownership. The installed-only check performed during ordinary thread setup is read-only; apps from disabled or unapproved plugins remain denied. Owner-issued installation is the explicit mutation path. Missing or ambiguous ownership fails closed rather than granting account-wide access.

Runtime app inventory serves as the target-session accessibility check for both migrated curated plugins and manually configured workspace plugins. Codex harness session setup derives a restrictive thread app config from the enabled and accessible plugin apps; it is not recalculated on every turn, so /codex plugins enable/disable only impact new Codex conversations. To apply the change in the current conversation, use /new or /reset.

Support boundary

  • Only openai-curated plugins that are already installed in the source Codex app-server inventory qualify for migration.
  • Runtime supports explicitly approved plugins from Codex-discovered official, workspace, personal, shared, and repository-local marketplaces. A missing marketplace, plugin, ownership detail, or app readiness evidence exposes no plugin app.
  • Positively identified non-ChatGPT source accounts fail the subscription gate. Missing or unreadable source accounts are unavailable by default. --verify-plugin-apps can instead establish access through authenticated source app inventory, including bearer- or header-authenticated app-servers. Inaccessible, disabled, or missing source apps and inventory refresh failures remain skipped manual items. Unreadable plugin details are skipped before the app-inventory gate.
  • Migration writes explicit plugin identities (marketplaceName and pluginName); it does not write local marketplacePath cache paths.
  • codexPlugins.enabled is the only global enablement switch; there is no plugins["*"] wildcard or config key that grants arbitrary install authority.
  • Migration does not automatically import non-curated marketplaces, cached plugin bundles, hooks, or Codex config files. Use /codex plugins available and an owner-issued /codex plugins install <plugin>@<marketplace> command to opt into an additional discovered plugin.
  • OpenClaw does not add new Git or local marketplace sources in this flow. Additional sources must already be configured in Codex or be discoverable from the bound repository.

App inventory and ownership

OpenClaw first reads and caches one plugin/installed snapshot scoped to the target Codex app-server and configured workspace. That snapshot covers plugins from the marketplaces visible in that scope, including disabled plugin identities; failed or incomplete snapshots are never cached. plugin/read is limited to exact configured plugin details required to establish ownership. Explicit discovery queries plugin/list with the conversation workspace to find repository marketplaces. Routine setup retains its existing curated recovery behavior; additional marketplace installation requires the explicit owner or administrator command.

OpenClaw reads installed app runtime state through app/installed and fetches canonical app metadata with app/read in batches of at most 100 app IDs. The first read force-refreshes a cold installed runtime snapshot. When multiple configured curated plugins are installed, OpenClaw combines their cache invalidations into a single app-inventory refresh. Ordinary cached reads do not force a connector refresh for every new thread. OpenClaw caches the combined inventory in memory for one hour and refreshes stale or missing entries asynchronously. The cache is process-local; restarting the CLI or gateway drops it.

Missing inventory methods, authentication errors, transport failures, and connector refresh failures fail closed.

Migration and runtime use separate cache keys:

  • Source migration verification uses the source Codex home and start options. It runs only with --verify-plugin-apps and forces a fresh source runtime snapshot and metadata read for that planning run.
  • Target runtime setup uses the target agent's Codex app-server identity when building and verifying the thread app config. Curated plugin activation invalidates that target cache key, then force-refreshes it after plugin/install. Explicit marketplace installation refreshes the same target runtime state before subsequent conversations use the plugin.

A plugin app is exposed only when OpenClaw can map it back to the configured plugin through stable ownership: an exact app id from plugin detail, a known MCP server name, or unique stable metadata. Display-name-only or ambiguous ownership is excluded until the next inventory refresh proves ownership.

Connected account apps

Owner-operated agents can opt into every app already connected to their Codex account without requiring a matching plugin package:

{
  plugins: {
    entries: {
      codex: {
        enabled: true,
        config: {
          codexPlugins: {
            enabled: true,
            allow_all_plugins: true,
            allow_destructive_actions: "auto",
          },
        },
      },
    },
  },
}

allow_all_plugins: true reads the installed app snapshot and authenticated metadata when a new native Codex thread is established. It admits only account-accessible apps. Codex must also confirm each admitted app is enabled and callable for that thread. OpenClaw does not install, authenticate, or enable apps globally. Existing threads keep their persisted app set; use /new, /reset, or restart the gateway to pick up newly connected or revoked apps.

An explicitly disabled configured plugin always overrides account-wide app access. Because Codex app/read omits a disabled workspace plugin's display names, OpenClaw uses its plugin/installed snapshot and reads only that exact configured plugin's details to reserve its owned app IDs. This narrow, read-only check does not discover unrelated marketplaces, activate the plugin, or grant its apps. If the disabled plugin's ownership cannot be established, the account-wide app selection fails closed.

Account apps inherit the global codexPlugins.allow_destructive_actions value, which accepts true, false, "auto", or "ask". Explicit per-plugin policy overrides the global policy for overlapping app ids. Inventory failures fail closed instead of falling back to an unrestricted default.

Thread app config

OpenClaw injects a restrictive config.apps patch for the Codex thread: _default is disabled, and only apps owned by enabled configured plugins or accessible account apps admitted by allow_all_plugins are enabled.

An app can be installed and authenticated but non-callable in the account-wide snapshot while _default is disabled. OpenClaw provisionally admits only ownership-proven, policy-allowed apps, creates the restrictive thread, and then rereads app/installed once with the resulting thread ID and forceRefresh: false. Codex must confirm each admitted app is enabled and callable under the thread's effective app, managed, workspace, and tool policies before the turn proceeds. If that attestation fails, the provisional thread is never bound or used. OpenClaw deletes a failed persistent provisional thread, unsubscribes a failed ephemeral thread, and retires the app-server connection if safe cleanup cannot be confirmed.

destructive_enabled on each app comes from the effective global or per-plugin allow_destructive_actions policy; true, "auto", and "ask" all set destructive_enabled: true, and false sets it false. Codex still enforces destructive tool metadata from its native app tool annotations. _default is disabled with open_world_enabled: false; enabled plugin apps get open_world_enabled: true. OpenClaw does not expose a separate plugin-level open-world policy knob and does not maintain per-plugin destructive tool-name deny lists.

Tool approval mode defaults to automatic for admitted apps, so non-destructive read tools run without a same-thread approval prompt. Destructive tools stay controlled by each app's destructive_enabled policy.

Destructive action policy

Destructive plugin elicitations are allowed by default for configured Codex plugins, while unsafe schemas and ambiguous ownership fail closed:

  • Global allow_destructive_actions defaults to true.
  • Per-plugin allow_destructive_actions overrides the global policy for that plugin.
  • false: OpenClaw returns a deterministic decline.
  • true: OpenClaw auto-accepts only safe schemas it can map to an approval response, such as a boolean approve field.
  • "auto": OpenClaw exposes destructive plugin actions to Codex, then turns ownership-proven MCP approval elicitations into OpenClaw plugin approvals before returning the Codex approval response.
  • "ask": OpenClaw uses the same Codex write/destructive gating as "auto", clears durable Codex per-tool approval overrides for the app before the thread starts, and offers only one-shot approval or denial so durable approvals cannot suppress later write-action prompts. For each admitted app using "ask", OpenClaw selects Codex's human approvals reviewer for that app so Codex sends its approval elicitations to OpenClaw; other apps and non-app thread approvals keep their configured reviewer and policy.
  • Missing plugin identity, ambiguous ownership, a missing or mismatched turn id, or an unsafe elicitation schema declines instead of prompting.

Troubleshooting

CodeMeaningFix
auth_requiredMigration installed the plugin, but one of its apps still needs authentication. The entry is written disabled until you reauthorize.Reauthorize the app in Codex, then enable the plugin in OpenClaw.
app_inaccessible, app_disabled, app_missingWith --verify-plugin-apps, the source Codex app inventory did not show all owned apps as present, enabled, and accessible.Reauthorize or enable the app in Codex, then rerun migration with --verify-plugin-apps.
app_inventory_unavailableStrict source app verification was requested but the source Codex app inventory refresh failed.Fix source Codex app-server access, or retry without --verify-plugin-apps to accept the faster account-gated plan.
codex_subscription_requiredThe source app-server positively identified an API-key or other non-ChatGPT account.Log in to the Codex app with subscription auth, then rerun migration.
codex_account_unavailableThe source account was missing or account/read failed without strict app verification.Restore source account access, or use --verify-plugin-apps when authenticated source app inventory can prove access.
marketplace_missing, plugin_missingThe exact marketplace or configured plugin is unavailable in the installed snapshot; plugin apps fail closed.Verify the target app-server's plugin/installed response and exact configured plugin identity.
plugin_detail_unavailableOpenClaw could not read the exact configured plugin's ownership details.Inspect the target app-server's plugin/installed and plugin/read responses.
plugin_disabledCodex reports the plugin installed but disabled.Enable the plugin in Codex, or have the owner explicitly install and authorize it again.
plugin_activation_failedPlugin activation did not complete.Use the attached diagnostic to distinguish marketplace, auth, refresh, or workspace-readiness failures.
app_inventory_missing, app_inventory_staleApp readiness came from an empty or stale cache.OpenClaw schedules an async refresh automatically; plugin apps stay excluded until ownership and readiness are known.
app_ownership_ambiguousApp inventory only matched by display name.The app stays hidden from the Codex thread until a later refresh proves ownership.

Workspace plugin is installed but not visible: confirm the workspace plugin/installed snapshot reports the exact configured ID as installed and enabled, then confirm app/installed returns every owned app for the same Codex account and app/read returns its metadata. An app disabled only by the account-wide default can become callable after OpenClaw starts and verifies its explicitly configured thread. Revoked auth, missing metadata, disabled workspace plugins, and Codex managed or workspace restrictions still block access. Reauthorize or repair those upstream conditions before starting a new thread. If you changed that state after the gateway cached app inventory, wait for the one-hour cache refresh or restart the gateway, then use /new or /reset. OpenClaw does not authenticate plugin apps on the owner's behalf.

For plugin_detail_unavailable, verify that the exact installed marketplace and plugin identity select a matching plugin/read result. OpenClaw keeps owned apps hidden when that selector or ownership detail is unavailable. For plugin_activation_failed, inspect the marketplace, app authorization, and post-install refresh diagnostics. An explicitly approved plugin must be installed, enabled, and authenticated before its apps can appear in a thread.

Config changed but the agent cannot see the plugin: run /codex plugins list to confirm the configured state, then /new or /reset. Existing Codex thread bindings keep the app config they started with until OpenClaw establishes a new harness session or replaces a stale binding.

Destructive action is declined: verify the allow_destructive_actions settings at both the global and per-plugin levels. Even when true, "auto", or "ask" are enabled, dangerous elicitation patterns and unclear plugin identification continue to fail closed.

3,386 words · updated Aug 25, 2026