> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/security-testing-orchestration/use-sto/sto-scanner-configuration/openai-codex-security-step-configuration.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# OpenAI Codex Security step configuration

The **OpenAI Codex Security** step in Harness STO uses an OpenAI model to review your code repository for security issues and returns structured findings. STO ingests those findings, normalizes them, and applies your severity threshold, so the results appear in the **Vulnerabilities** tab alongside the results from every other scanner in your pipeline.

The step belongs to the LLM scanner category, which STO introduced for scanners that use AI models rather than deterministic rule engines. The findings it produces are SAST class findings against your source code.

### What you will learn from this topic

By the end of this topic, you will be able to:

* The purpose and scope of the **OpenAI Codex Security** step in STO.
* The steps to add and configure the step in a Security Tests or CI Build stage.
* The way each step setting maps to the scan that runs at pipeline runtime.
* How to control which findings block your pipeline.

***

### Before you begin

Make a note of the following before you configure the step:

* Make sure that you have a Harness account with an STO module license.
* Make sure that you have a *Security Testing Developer* or *AppSec* role assigned. For more information, see [Access Control - RBAC](https://developer.harness.io/security-testing-orchestration/troubleshooting-and-resources/rbac.md).
* Make sure that you have configured the codebase for the stage where you add the step. In most cases, you specify the codebase using a code repo connector that connects to the Git account or repository where your code is stored.
* You must have an OpenAI Model Connector available at the account, organization, or project scope. For more information, see [OpenAI Model Connector](https://developer.harness.io/harness-platform/use-harness-ai/connect-with-ai/openai-model-connector.md).
* You must store your OpenAI API key as a Harness secret and reference it from the connector. For more information, see [Add and reference text secrets](https://developer.harness.io/harness-platform/use-harness-platform/secrets/add-use-text-secrets.md).
* Your OpenAI API key must be enrolled in your organization's Cyber Verification Program (CVP) with OpenAI. A standard OpenAI model key that is not enrolled in CVP causes the scan to fail.
* The step supports direct OpenAI API keys only. It does not support keys accessed through Amazon Bedrock.

***

### OpenAI Codex Security step settings

The recommended workflow is to add an **OpenAI Codex Security** step to a **Security** or **Build** stage and then configure it as described below.

<figure><img src="https://2033425938-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fna57sNwixrWxOX8cOMRg%2Fuploads%2FxQaIYGkqB2yQT7aQhbM2%2Fharness-sto-openai-codex.png?alt=media&amp;token=2158ecea-cb85-4ae2-9246-bb89d673966a" alt="" width="375"><figcaption><p>OpenAI Codex Security step configuration</p></figcaption></figure>

#### Scan

**Details**

* **Name**: Specify a name for the scanner step, for example, *OpenAISecurityProduction*.
* **Description**: Specify a brief description for the scanner step, for example, *Scanner for identifying vulnerabilities in the production environment*.

**Scan Mode**

* **Orchestration**: Configure the step to run a scan and then ingest, normalize, and deduplicate the results. For more information, see [Orchestration mode](https://developer.harness.io/security-testing-orchestration/new-to-sto/key-concepts/run-an-orchestrated-scan-in-sto.md).
* **Ingestion**: Configure the step to ingest results from a previously run scan, rather than running the scan itself. For more information, see [Ingestion mode](https://developer.harness.io/security-testing-orchestration/new-to-sto/key-concepts/ingest-scan-results-into-an-sto-pipeline.md).

**Scan Configuration**

The predefined configuration to use for the scan. All scan steps have at least one configuration.

* **Full Scan**: Reviews the full repository specified in **Target**. Use this configuration for comprehensive coverage on a schedule or on demand.
* **Incremental Scan**: Reviews only the code that changed, rather than the full repository. Use this configuration to keep review time and model cost predictable on frequently built branches.

#### Target

**Type**

* **Repository**: Scan a codebase repo. This step supports **Repository** as the only target type, so the field is read-only.

**Target and Variant Detection**

* **Auto** (default): When enabled for code repositories, the step detects these values using `git`:
  * To detect the target, the step runs `git config --get remote.origin.url`.
  * To detect the variant, the step runs `git rev-parse --abbrev-ref HEAD`. The default assumption is that the `HEAD` branch is the one you want to scan.
* **Manual**: When you want to set the target and variant yourself, which then exposes the **Name** and **Variant** fields.
  * **Name**: The identifier for the target, such as `codebaseAlpha` or `jsmith/myalphaservice`. Descriptive target names make it easier to navigate your scan data in STO. Harness recommends specifying a baseline for each target. For more information, see [Targets, baselines, and variants](https://developer.harness.io/security-testing-orchestration/~/changes/5/new-to-sto/key-concepts/targets-and-baselines).
  * **Variant**: The identifier for the specific variant to scan. This is usually the branch name or the product version. Harness maintains a historical trend for each variant.

**Workspace** (Optional)

The workspace path on the pod running the scan step. The workspace path is `/harness` by default. You can override this path if you want the step to review only a subset of the workspace. For example, if you want to review a single service directory, specify the workspace path as `/harness/services/payments`.

#### LLM Connector

The OpenAI Model Connector that defines the model provider and the model the step uses for the review. Select a connector that is available at account, organization, or project scope.

This field is required for the **OpenAI Codex Security** step. The step authenticates with the credential that the connector references, so Harness orchestrates the scan using your own OpenAI credential.

For more information, see [OpenAI Model Connector](https://developer.harness.io/harness-platform/use-harness-ai/connect-with-ai/openai-model-connector.md).

The **Third-Party AI Integration Terms** define the terms and conditions for using the third-party AI integration with Harness. You must review and accept these terms before proceeding with the Claude Code Security integration. Click the **Third-Party AI Integration Terms** url, select the acceptance checkbox, and click **Accept and Activate** to complete the process. Click the **Review Terms** url to review the terms once accepted.

{% hint style="info" %}

* The credential behind the connector is stored as a Harness secret. Harness injects it into the scanner container at runtime and does not write it to the scan logs. If the key is missing, invalid, or expired, the step fails before the scan starts.
* Your OpenAI API key must be enrolled in your organization's Cyber Verification Program (CVP) with OpenAI. If the connector references a standard OpenAI model key that isn't CVP enrolled, the scan fails.
* The step supports direct OpenAI API keys only. It does not support keys accessed through Amazon Bedrock.
* When selecting an LLM model for security scanning, consider its vulnerability detection accuracy, scan performance, cost, and consistency. Harness published the [LLMScanBench Q3 2026 benchmarking report](https://www.harness.io/blog/llmscanbench-q3-2026-choosing-the-right-approach-for-ai-vulnerability-discovery), which compares LLM-based security scanners across these parameters and provides insights into their effectiveness. Review the report to make an informed decision when choosing a model for your security scanning requirements. If model selection is available in your LLM connector configuration, select the model that best aligns with your requirements.
  {% endhint %}

#### Log Level (Optional)

The minimum severity of the messages you want to include in your scan logs. You can specify one of the following:

* **DEBUG**
* **INFO**
* **WARNING**
* **ERROR**

The step uses **Info** by default.

#### Additional CLI flags (Optional)

Use this field to pass flags to the scanner at runtime.

{% hint style="info" %}
Passing additional CLI flags is an advanced feature. Test your flags thoroughly before you use them in your Harness pipelines, and do not add flags that the step already sets in its default configuration. To check the default configuration, go to a pipeline execution where the step ran with no additional flags and review the command line in the log output for the step.
{% endhint %}

#### Fail On Severity (Optional)

Every STO scan step has a **Fail On Severity** setting. If the scan finds any issue with the specified severity level or higher, the pipeline fails automatically. You can specify one of the following:

* **`CRITICAL`**
* **`HIGH`**
* **`MEDIUM`**
* **`LOW`**
* **`INFO`**
* **`NONE`**: Do not fail on severity

For more information, see [Severity scores and levels](https://developer.harness.io/security-testing-orchestration/~/changes/5/new-to-sto/key-concepts/severities).

#### Settings (Optional)

Use this field to specify environment variables for your scanner as key and value pairs. Click **+ Add** to add each pair.

#### Additional Configuration

The fields under **Additional Configuration** vary based on the type of build infrastructure. Depending on the infrastructure type you select, some fields might not appear in your settings.

| Field              | Description                                                                                                                                                                                       |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Container Registry | The container registry that hosts the scan image, when you override the default security test image. For more information, see Configure your pipeline to use STO images from a private registry. |
| Image Tag          | The tag of the scan image to use. The default is `latest`.                                                                                                                                        |
| Image Pull Policy  | When Harness pulls the scan image. For more information, see Image Pull Policy.                                                                                                                   |
| Run as User        | The user ID the step runs as inside the container, for example `1000`. For more information, see Run as User.                                                                                     |
| Timeout            | The maximum time the step can run before it fails, specified in `w/d/h/m/s` format. For more information, see Timeout.                                                                            |

**Advanced settings**

In the **Advanced** tab, you can use the following options:

* [Conditional Execution](https://developer.harness.io/harness-ai/use-harness-platform/pipelines/step-skip-condition-settings)
* [Failure Strategy](https://developer.harness.io/harness-ai/use-harness-platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps)
* [Looping Strategy](https://developer.harness.io/harness-ai/use-harness-platform/pipelines/looping-strategies/looping-strategies-matrix-repeat-and-parallelism)
* [Policy Enforcement](https://developer.harness.io/harness-ai/use-harness-platform/governance/policy-as-code/harness-governance-overview)

### View your scan results

After the pipeline runs, go to the pipeline execution and open the **Vulnerabilities** tab to review the issues the step found. Each issue shows its severity, the file and line where the model located it, and the remediation guidance the model returned. For more information, see [View scan results](https://developer.harness.io/security-testing-orchestration/~/changes/5/use-sto/sto-security-issues/view-scan-results).

### Proxy settings

This step supports private network connectivity if you are using Harness Cloud infrastructure. For more information, see Private network connectivity options.

When you use proxy configurations, the `HTTPS_PROXY` and `HTTP_PROXY` variables are automatically set to route traffic through the secure tunnel. If there are specific addresses that you want to bypass the proxy, define those in the `NO_PROXY` variable. You can configure this in the **Settings** of your step.

If you need to configure a different proxy, you can manually set the `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` variables in the **Settings** of your step.

**Definitions of proxy variables:**

* `HTTPS_PROXY`: Specify the proxy server for HTTPS requests, for example `https://sc.internal.harness.io:30000`
* `HTTP_PROXY`: Specify the proxy server for HTTP requests, for example `http://sc.internal.harness.io:30000`
* `NO_PROXY`: Specify the domains as comma separated values that should bypass the proxy.
