Skip to main content

Setup Guide - Dev Assist for Codex CLI

This guide explains how to deploy cx-devassist to developer machines using Codex CLI's enterprise managed-configuration capabilities and your organization's endpoint-management tooling.

Organizations can provision the Checkmarx marketplace and plugin for each developer, then deploy managed policy and hook files through MDM or configuration management. Developers do not need to run installation commands themselves when these commands are included in user-context provisioning.

Important

requirements.toml does not install the plugin or register its marketplace. It enforces policy. The deployment must also run the plugin-installation commands and deliver the complete managed hook bundle, as described in Procedure.

By default, provisioning can use the official Checkmarx repository. Developers then authenticate to Checkmarx One using browser sign-in (OAuth) or an API key. For OAuth, developers supply their Checkmarx One URL and tenant during setup. API keys carry connection information and must be supplied through your organization's approved secret-management process.

For OAuth deployments, an internal fork or mirror can preconfigure the URL and tenant, as described in Optional — Preconfigure the Checkmarx One URL and Tenant.

Note

There is no separate Codex policy field for Checkmarx onboarding. The URL and tenant defaults must be included in the reviewed plugin bundle served by your marketplace.

Prerequisites

Before deploying cx-devassist, ensure developer machines meet the plugin host requirements:

Requirement

Windows

macOS

Linux

Git / POSIX sh for hooks

Git for Windows; sh available to Codex

Git and sh available

Git and sh available

Python 3

Required

Required

Required

curl or wget for bootstrap

Required

Required

Required

Bootstrap shell / archive tools

Git Bash; unzip or PowerShell Expand-Archive

Bash and tar

Bash and tar

Codex CLI

Installed and managed by your organization

Same

Same

Checkmarx One Assist license and Dev Assist enabled

Required

Required

Required

Marketplace, CLI-download, and tenant connectivity

Required

Required

Required

Windows: Verify sh --version in Codex's environment. Use codex.cmd for the commands below if PowerShell blocks the npm codex.ps1 shim, subject to organizational policy.

The current minimum cx CLI version is 2.3.65, as specified in cx-min-version. The plugin also probes required capabilities; a version number alone is insufficient.

The bootstrap script requires Bash, even though the hook launchers use sh. If your organization preinstalls cx, validate its version and capabilities instead of relying on first-use downloads.

Deployment Methods

requirements.toml enforces constraints. managed_config.toml supplies startup defaults that users can change during a session.

Platform

Requirements

Managed defaults

Linux / macOS

/etc/codex/requirements.toml

/etc/codex/managed_config.toml

Windows

%ProgramData%\OpenAI\Codex\requirements.toml

~/.codex/managed_config.toml

macOS MDM

com.openai.codex:requirements_toml_base64

com.openai.codex:config_toml_base64

For macOS MDM, encode TOML as unwrapped base64 and assign the device profile. Restart Codex after changes. Deploy executable files separately.

Requirements compose from lower to higher precedence: system file, cloud requirements, legacy managed-config requirements, then macOS managed preferences. Tables have field-specific merging. Legacy defaults use MDM > managed file > user configuration; cloud defaults use normal configuration precedence. See managed configuration.

Cloud-managed requirements are also available for supported plans and ChatGPT-signed-in clients. They deliver policy; endpoint tooling must still deliver the referenced scripts. This is separate from workspace plugin import described below.

Deploy policy through the applicable file or macOS MDM mechanism. Use endpoint management to copy the bundle and run per-user provisioning. Follow the layering rules above if multiple policy sources exist; do not assume the sources are mutually exclusive.

Procedure

Step 1 — Configure Codex CLI Deployment

Marketplace and Plugin Installation

Run these commands under each developer's account and intended CODEX_HOME, through a user-context provisioning task or manually during a pilot. Running them as SYSTEM/root configures that account, not every developer. Provisioning can eliminate manual installation commands; authentication remains a separate step.

codex plugin marketplace add https://github.com/Checkmarx/cx-agentic-ai
codex plugin marketplace list
codex plugin add cx-devassist@cx-devassist-marketplace
codex plugin list --marketplace cx-devassist-marketplace

Restart Codex and confirm installation and enablement in /plugins. Prepare any internal fork as described below before provisioning it.

These commands are this guide's provisioning route. Codex also supports marketplace definitions in system, cloud-managed, user, and trusted-project config.toml. Those settings have a different schema from the source allowlist in requirements.toml; do not interchange them. See marketplace configuration.

Managed Hook Configuration

Copy the complete plugins/codex-devassist/ bundle from the reviewed release into:

Platform

Example bundle root

Linux / macOS

/etc/codex/managed-hooks/cx-devassist

Windows

C:\ProgramData\OpenAI\Codex\managed-hooks\cx-devassist

Preserve hidden files and directory structure. The hooks require sibling config/ and scripts/ files; copying only hooks/ breaks those dependencies. Restrict modification of policy and bundle files to administrators or the deployment service. Developers need read/execute access. Deploy the bundle before activating policy, as described in Step 2 — Deploy the Configuration.

Setting managed_dir alone does not convert the plugin JSON into managed hooks. Declare events inline with absolute paths. Do not assume ${PLUGIN_ROOT} exists for managed commands. Pin [features].hooks = true to enforce enablement. Managed hooks bypass user trust review. See managed hooks.

Merge this example into existing requirements, keeping top-level keys before tables and avoiding duplicate declarations. It mirrors the shipped chain. Replace C:/ProgramData if the actual Windows ProgramData directory differs.

# Top-level: excludes ALL non-managed hooks, including other plugins.
allow_managed_hooks_only = true

[features]
hooks = true

[hooks]
managed_dir = "/etc/codex/managed-hooks/cx-devassist"
windows_managed_dir = 'C:\ProgramData\OpenAI\Codex\managed-hooks\cx-devassist'

[[hooks.PreToolUse]]
matcher = "Bash"
[[hooks.PreToolUse.hooks]]
type = "command"
command = 'sh "/etc/codex/managed-hooks/cx-devassist/hooks/cx_record_login.sh"'
command_windows = 'sh "C:/ProgramData/OpenAI/Codex/managed-hooks/cx-devassist/hooks/cx_record_login.sh"'
timeout = 10

[[hooks.PreToolUse]]
matcher = "apply_patch"
[[hooks.PreToolUse.hooks]]
type = "command"
command = 'sh "/etc/codex/managed-hooks/cx-devassist/hooks/cx_check.sh" --codex'
command_windows = 'sh "C:/ProgramData/OpenAI/Codex/managed-hooks/cx-devassist/hooks/cx_check.sh" --codex'
timeout = 45
[[hooks.PreToolUse.hooks]]
type = "command"
command = 'sh "/etc/codex/managed-hooks/cx-devassist/hooks/cx_run.sh" hooks codex-pre-file-write'
command_windows = 'sh "C:/ProgramData/OpenAI/Codex/managed-hooks/cx-devassist/hooks/cx_run.sh" hooks codex-pre-file-write'
timeout = 60

[[hooks.PreToolUse]]
matcher = "mcp__Checkmarx__.*"
[[hooks.PreToolUse.hooks]]
type = "command"
command = 'sh "/etc/codex/managed-hooks/cx-devassist/hooks/cx_check.sh" --codex'
command_windows = 'sh "C:/ProgramData/OpenAI/Codex/managed-hooks/cx-devassist/hooks/cx_check.sh" --codex'
timeout = 45
[[hooks.PreToolUse.hooks]]
type = "command"
command = 'sh "/etc/codex/managed-hooks/cx-devassist/hooks/cx_run.sh" hooks codex-pre-tool-use'
command_windows = 'sh "C:/ProgramData/OpenAI/Codex/managed-hooks/cx-devassist/hooks/cx_run.sh" hooks codex-pre-tool-use'
timeout = 45

[[hooks.Stop]]
matcher = ".*"
[[hooks.Stop.hooks]]
type = "command"
command = 'sh "/etc/codex/managed-hooks/cx-devassist/hooks/cx_run.sh" hooks codex-stop'
command_windows = 'sh "C:/ProgramData/OpenAI/Codex/managed-hooks/cx-devassist/hooks/cx_run.sh" hooks codex-stop'
timeout = 45

allow_managed_hooks_only affects all non-managed hooks, including other plugins. Include other required enterprise hooks in managed policy before enabling it. If omitted, trusted plugin hooks can run alongside managed hooks and duplicate scans. It does not disable plugin skills or MCP.

The shipped chain gates scannable apply_patch writes and matching Checkmarx MCP calls. Its Bash hook records login context only; shell writes are not scanned. A hook that cannot start is not proof of enforcement. Verify real scan and deny outcomes during the pilot.

Managed policy enforces hook configuration, not every scanner setting. The plugin still reads environment options such as CX_ALLOW_UNLICENSED and CX_LOG_DISABLE. Verify their effective values in the managed execution environment when validating scanning and audit requirements.

Step 2 — Deploy the Configuration

Deploy the prepared policy, bundle, and provisioning task through your endpoint-management system.

Note: The exact procedure for creating and assigning a device policy or user-context task depends on your MDM product. The locations and payload types below are Codex-specific.

Native MDM

macOS: Deploy the base64-encoded TOML payload through the com.openai.codex preference domain. Use requirements_toml_base64 for enforced requirements and config_toml_base64 only for managed defaults. Deliver the complete reviewed bundle to the managed directory separately.

Windows (Intune / endpoint management): Use managed file delivery for the requirements and bundle paths listed below. Configure a user-context task for marketplace/plugin installation; a SYSTEM-context installation does not configure each developer's account.

File-based

OS

Enforced policy path

Managed bundle root used in this guide

macOS / Linux

/etc/codex/requirements.toml

/etc/codex/managed-hooks/cx-devassist

Windows

%ProgramData%\OpenAI\Codex\requirements.toml

%ProgramData%\OpenAI\Codex\managed-hooks\cx-devassist

  1. Copy the complete reviewed plugin bundle with administrator-controlled write permissions.

  2. Merge and deploy the requirements prepared in Step 1, using paths that exist on that machine.

  3. Run the marketplace and plugin commands under each developer's account and intended CODEX_HOME.

  4. Restart Codex and complete Step 3 on a pilot machine before broad assignment.

Administrator permissions are required for system file delivery. Preserve unrelated policy when merging or replacing the managed configuration. WSL deployments should be validated in their Linux execution environment with the corresponding Linux files and user context.

Workspace-managed Plugin Delivery

Admins can import a GitHub marketplace, select a branch/tag/commit, and choose Installed for eligible roles. Repository installation policies are not imported automatically. However, current documentation marks imported plugins declaring .mcp.json servers as Desktop only. This plugin declares such a server, so workspace import is not a confirmed automatic CLI rollout route for this package. Use per-user provisioning above. See workspace plugin management.

Step 3 — Verify the Deployment

Skills and MCP

The plugin manifest declares "skills": "./skills". Current Codex supports plugin-bundled skills; a separate copy is not normally required. Confirm $cx-cli-setup, $cx-devassist-asca, and $cx-devassist-sca appear. See plugin packaging.

For deliberately standalone deployment, documented locations include repository .agents/skills, $HOME/.agents/skills, and admin /etc/codex/skills — not /etc/codex/.agents/skills. Avoid duplicate installations and preserve references to the full bundle when adapting these skills. See skill discovery.

Check whether the bundled Checkmarx MCP connects. If it does not, use the repository's MCP registration fallback. For example, an explicit Windows registration in the developer's config.toml can use:

[mcp_servers.Checkmarx]
command = "sh"
args = ["C:/ProgramData/OpenAI/Codex/managed-hooks/cx-devassist/hooks/cx_run.sh", "mcp", "bridge"]

On macOS/Linux, substitute /etc/codex/managed-hooks/cx-devassist/hooks/cx_run.sh. Use the actual ProgramData path on Windows, just as for the managed hook commands. Do not register a second server if the bundled server already works. If MCP restrictions apply, permit the actual configured identity and invocation; a rule allowing every sh command is broader than this plugin. Requirements constrain connections; they do not register servers. Consult the MCP requirements reference.

Deployment and Authentication Checks

Use a test account and disposable repository on each supported OS.

  1. Record Codex and cx versions, plugin source/ref, and managed bundle revision.

  2. Confirm the plugin is installed and enabled, and all three skills are discoverable.

  3. In /hooks, verify the managed handlers and paths. Check there is one effective Checkmarx chain, and that disabling hooks locally does not bypass enforcement. For MCP, confirm the actual tool name matches mcp__Checkmarx__.*; do not assume a differently named registration is covered.

  4. Run $cx-cli-setup. Select API key or browser OAuth and complete the corresponding flow. Supply secrets through your approved process, never through the marketplace or MDM payload.

  5. For OAuth with pre-fill, verify no URL/tenant question is needed. Otherwise enter your organization's URL and tenant. API key setup does not use the onboarding file.

  6. Confirm cx auth validate succeeds. Use the resolved executable path if cx is not on PATH.

  7. Exercise a scannable apply_patch write and verify an actual scanner decision. Test an expected denial using a controlled finding or an unauthenticated test account.

  8. Verify a Checkmarx remediation tool connects. After new registration or a connection failure, exit and relaunch Codex (codex, or codex resume --last for the most recent session), then retry.

scanner_passthrough means the native scanner could not establish an authenticated session even though CLI validation passed. The gate identifies stale/expired credentials and backend connectivity as possible causes. Check the diagnostic and reauthenticate or restore connectivity as appropriate. The README also documents scanner builds requiring an API key after OAuth; switch methods only when that limitation applies. Successful login alone does not prove scanner readiness.

Default audit log: ~/.checkmarx/agent-logs/codex/cx-devassist.jsonl. CX_LOG_DIR overrides the directory; CX_LOG_DISABLE=1 disables logging. Inspect readiness (gate_decision) and scanner (scan_decision) records where applicable.

Optional — Preconfigure the Checkmarx One URL and Tenant

Maintain an internal fork or mirror for browser OAuth pre-fill. The gate reads config/cx-onboarding.properties relative to its own bundle, not from environment variables or an external onboarding file. API key authentication derives connection information from the credential instead.

Step 1 — Create an Internal Fork or Mirror

  1. Fork or mirror Checkmarx/cx-agentic-ai into an organization-controlled repository, for example YourOrg/cx-agentic-ai.

  2. Create a deployment branch for the changes below. Tag the reviewed result after committing the onboarding configuration and marketplace source changes.

Step 2 — Configure the Checkmarx One URL and Tenant

Set both values in plugins/codex-devassist/config/cx-onboarding.properties:

cx_base_auth_uri=https://eu.ast.checkmarx.net
cx_tenant=your-org-tenant

Value Formats

Key

Format

Example

cx_base_auth_uri

HTTPS origin (https://host[:port]); no path, query, fragment, or userinfo

https://eu.ast.checkmarx.net

cx_tenant

Starts alphanumeric; then letters, digits, ., _, or -; maximum 64 characters

your-org-tenant

Obtain the regional or on-premises URL and tenant from your Checkmarx administrator. Missing or invalid pre-fill falls back to interactive setup. The current gate trims surrounding whitespace and trailing slashes before validating the URL. It accepts an ASCII hostname of up to 128 characters (letters, digits, dots, and hyphens, starting alphanumeric) and an optional 2–5 digit port. IPv6 literals and path-prefixed deployment URLs do not pass this validator. Use the canonical origin form shown above.

Step 3 — Point the Rollout at the Internal Repository

Change the marketplace's plugin source too. The current manifest uses git-subdir with an explicit upstream URL. Merely changing the marketplace URL to your fork still points plugin installation upstream. In your fork, replace that entry's source object with:

{
  "source": "local",
  "path": "./plugins/codex-devassist"
}

This selects the plugin from the deployed marketplace snapshot. Preserve the other entry fields and names. See marketplace formats. Commit both changes and create a reviewed release ref, for example mdm-v1.

If restrictions are enabled, replace the upstream source rule:

[marketplaces.allowed_sources.cx_devassist]
source = "git"
url = "https://github.com/YourOrg/cx-agentic-ai"
ref = "mdm-v1"

Provision each user:

codex plugin marketplace add https://github.com/YourOrg/cx-agentic-ai --ref mdm-v1
codex plugin add cx-devassist@cx-devassist-marketplace

Step 4 — Deploy the Updated Configuration

Follow Step 2 — Deploy the Configuration of the main procedure using the internal release and updated source restrictions.

Inspect existing registration before migration: keeping the marketplace name does not prove its source changed. Verify the resulting source/ref and installed onboarding file. Deploy the complete managed bundle from that same release and repeat pilot checks. An old managed copy can supply old onboarding values even after the plugin updates.

Step 5 — Verify Preconfigured Onboarding

  1. Confirm the plugin is installed and enabled from the intended internal source/ref.

  2. Run $cx-cli-setup and select Browser sign-in (OAuth) if authentication is required.

  3. Verify the configured URL and tenant are used without asking the developer to enter them.

  4. Complete browser authentication and confirm cx auth validate succeeds.

  5. Repeat the scan and deny checks from the main deployment procedure.

Maintain the Internal Repository

Merge upstream changes into the internal repository, retain the onboarding values and local plugin source entry, and test before tagging a new release. Update the rollout's source/ref and refresh the managed bundle together. See Updates, Rollback, and Removal.

Optional — Enterprise Policy Controls

These controls are optional additions to the deployment. Apply them according to your organization's Codex security policy.

Restrict Marketplaces

Merge this into requirements.toml, not config.toml:

[marketplaces]
restrict_to_allowed_sources = true

[marketplaces.allowed_sources.cx_devassist]
source = "git"
url = "https://github.com/Checkmarx/cx-agentic-ai"
# ref = "your-reviewed-ref"

This permits sources; it does not register or install them. Restrictions also affect installation, refresh, and runtime visibility. Git URLs are normalized; a configured ref must match exactly. Inventory other required marketplaces before enabling restrictions. See the requirements schema.

Restrict MCP Servers

If your organization uses MCP restrictions, permit the Checkmarx server's actual identity and invocation. Both bundled and explicitly registered servers must satisfy the applicable requirements. The registration fallback and matching guidance are in Step 3 — Verify the Deployment of the main procedure.

Additional Security Controls

Codex requirements can also constrain approvals, sandbox modes, and other runtime behavior. Consult the requirements reference when merging organization-wide controls with this deployment.

Optional — Container / CI Deployment

Provision for the runtime account and persist its intended CODEX_HOME; installing into the image builder's home does not configure a different user. Supply credentials at runtime through approved secret management. Browser OAuth is interactive. Verify hooks in the actual execution mode; this plugin's limited tool coverage does not replace a dedicated CI security scan.

API Key Authentication

API key authentication does not use cx-onboarding.properties. The credential carries the Checkmarx connection information, so no URL/tenant pre-fill is needed.

Distribute credentials through your organization's approved secret-management process, separately from plugin and policy delivery. Developers select API key during $cx-cli-setup. Do not include credentials in the repository, managed TOML, or deployment image.

Updates, Rollback, and Removal

For a tracked branch, refresh and reinstall under each developer's account:

codex plugin marketplace upgrade cx-devassist-marketplace
codex plugin add cx-devassist@cx-devassist-marketplace

For a new pinned tag, update the allowlist and marketplace registration first; refreshing an old fixed tag does not select a new release. Refresh the separately deployed managed bundle and compare the release's hooks/hooks.json with inline policy. Restart and repeat pilot checks. For forks, merge upstream updates and verify onboarding values and the local source entry survive.

Keep the previous bundle, marketplace ref, and policy for coordinated rollback. The cx binary updates independently; verify compatibility during upgrades and rollbacks. Do not edit developer plugin caches to apply permanent changes.

To remove a user-installed plugin and marketplace:

codex plugin remove cx-devassist@cx-devassist-marketplace
codex plugin marketplace remove cx-devassist-marketplace

This does not remove managed hooks, cx, credentials, logs, or explicit MCP registration. For fleet removal, withdraw the Checkmarx hook declarations and explicit MCP registration before deleting their managed bundle, preserving unrelated policy.

Troubleshooting

Symptom

Likely cause

Action

Plugin absent after policy delivery

Only requirements.toml was deployed, or provisioning ran as SYSTEM/root

Run installation under the developer account and intended CODEX_HOME.

Workspace import does not deliver the CLI plugin

Bundled MCP servers cause desktop-only classification

Use the CLI provisioning procedure.

Marketplace rejected or hidden

Source or ref does not satisfy requirements

Check normalized URL, exact ref restriction, and effective policy layers.

Invalid marketplace boolean in config.toml

Source restrictions are in the wrong file

Move them to requirements.toml.

Managed hooks absent

Missing inline declarations, wrong directory, or hooks disabled

Check event declarations, platform paths, and [features].hooks = true.

Duplicate scans or trust prompts

Plugin and managed hook chains both loaded

Review managed-only policy and other required enterprise hooks.

Hook cannot start or files are missing

Missing runtime dependency or incomplete bundle

Verify sh, Python, absolute paths, permissions, config/, and scripts/.

Skills absent

Plugin disabled, incomplete install, or stale session

Check manifest and installed skills, then restart.

Official package asks for URL/tenant

Expected first-use OAuth flow

Enter the organization's connection values or deploy a preconfigured internal release.

Internal package still asks for URL/tenant

Invalid properties, upstream plugin source, or stale managed bundle

Check both properties, the marketplace entry, and bundle revision.

Wrong tenant or region

Stale release or incorrect internal values

Correct the internal release and redeploy plugin and managed bundle together.

incapable blocks writes

cx lacks required native commands

Upgrade cx and verify hook and MCP capabilities.

Login works but scanner reports scanner_passthrough

Scanner authentication failed: stale credentials, connectivity, or build-specific credential support

Check diagnostics and connectivity, then reauthenticate; use an API key if required by that build.

MCP unavailable after setup

Registration, policy, credential, or connection issue

Verify configuration and bridge capability; restart and retry.

Shell writes proceed without scans

Outside the shipped hook chain's scan coverage

Account for this limitation in the organization's security controls.