> 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/claude-code-security-step-configuration.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Claude Code Security step configuration

As organizations increasingly adopt AI-assisted development, traditional security scanners may not always identify complex vulnerabilities that require deeper code-level reasoning. LLM-based security scanners, such as Claude Code Security, can analyze source code and identify potential vulnerabilities. However, running these scanners independently within CI/CD pipelines often leaves security findings disconnected from existing security management and governance workflows.

Without a centralized platform to manage these findings, teams may need to review raw scan results separately, correlate duplicate vulnerabilities across scanners, and manage security policies through different workflows. This makes it difficult to maintain a unified view of application security risks across the software development lifecycle.

Harness Security Testing Orchestration (STO) addresses this gap by integrating Claude Code Security as a native scanner. This enables organizations to bring LLM-based security findings into their existing security workflows, where they can be managed alongside findings from other integrated scanners. By combining LLM-based security analysis with STO's vulnerability management and governance capabilities, teams can improve visibility into security risks and enforce consistent security policies across their CI/CD pipelines.

### What you will learn from this topic

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

* Understand how Claude Code Security integrates with Harness STO.
* Configure the Claude Code Security step in a Harness pipeline.
* Configure scan modes, scan configurations, target detection, and LLM connectors.
* Customize scan execution options and additional settings.
* Run the pipeline and review Claude Code Security findings in STO.

  &#x20;

### Before you begin

Make a note of the following before you proceed with AIBOM generation:

* 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.
* Clear understanding of the build stage configuration within the pipeline. Go to [Build Stage Settings](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/ci-stage-settings#execution) to review the settings.

### Understand Claude Code Security step in STO

Claude Code Security is an LLM-based security scanner that analyzes source code to identify potential security vulnerabilities. Unlike traditional static application security testing (SAST) scanners that rely primarily on predefined rules and patterns, Claude Code Security uses an LLM to understand code, reason about potential security weaknesses, and identify vulnerabilities that may require deeper contextual analysis.

Harness Security Testing Orchestration (STO) integrates Claude Code Security as a native scanner, enabling you to incorporate LLM-based security analysis into your CI/CD pipelines. You can use it to analyze an entire repository or review code changes in a pull request (PR). The scanner generates structured security findings that include severity, affected code location, vulnerability description, root cause, and suggested remediation.

STO brings these findings into its centralized vulnerability management workflow, allowing you to review and manage Claude Code Security findings alongside results from other integrated security scanners. This helps you maintain visibility into security risks and apply consistent security governance across your development workflows.

The following table provides an overview of why Claude Code Security is used, when to use it, and how you can leverage it within STO.

| Why use it?                                                                | When to use it?                                                                          | How can you leverage it?                                                                 |
| -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Identify potential security vulnerabilities using LLM-based code analysis. | When you need deeper security analysis of source code.                                   | Run Claude Code Security scans within Harness pipelines.                                 |
| Complement traditional SAST scanners with contextual security analysis.    | When reviewing code changes in pull requests.                                            | Analyze repositories or pull request changes for potential vulnerabilities.              |
| Centralize LLM-generated security findings within STO.                     | When you want to complement existing SAST scanning workflows.                            | Review normalized security findings in STO.                                              |
| Improve visibility into application security risks across scanners.        | When you need to manage LLM-generated findings alongside other security scanner results. | Use STO vulnerability management and governance capabilities to manage identified risks. |

### Configure the Claude Code Security step

Configuring the Claude Code Security step enables you to integrate LLM-based security scanning into your Harness pipeline. You can configure the scan mode, specify the repository to analyze, and connect your Claude credentials using an LLM connector. The step analyzes the configured repository and generates security findings that are ingested into STO for vulnerability management and governance.

<figure><img src="https://2033425938-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fna57sNwixrWxOX8cOMRg%2Fuploads%2Fv0cky2kQ8UVHqY3vh2Py%2Fconfigure-claude-code-step.png?alt=media&amp;token=7cdc86f5-31d4-4d26-8870-90e2816fef0d" alt="Claude Code Security step configuration"><figcaption><p>Claude Code Security step configuration</p></figcaption></figure>

To configure the Claude Code Security step within your pipeline, complete the following steps:

1. [Select the Claude Code Security step in your pipeline](#step-1-select-the-claude-code-security-step-in-your-pipeline)
2. [Configure the scan parameters](#step-2-configure-the-scan-parameters)
3. [Configure the target and variant detection](#step-3-configure-the-target-and-variant-detection)
4. [Configure the LLM connector](#step-4-configure-the-llm-connector)
5. [(Optional) Configure scan execution options](#optional-step-5-configure-scan-execution-options)
6. [(Optional) Configure the scan settings](#optional-step-6-configure-the-scan-settings)
7. [(Optional) Add additional configuration](#optional-step-7-add-additional-configuration)
8. [(Optional) Configure the advanced settings](#optional-step-8-configure-the-advanced-settings)

#### Step 1: Select the Claude Code Security step in your pipeline

To select the Claude Code Security step in your pipeline:

1. Navigate to the **Pipelines** page from the sidebar navigation of your STO account and click the `+ Create a Pipeline` button to create a pipeline. The **Create New Pipeline** dialog will open.
2. Create a pipeline after configuring the initial details within the dialog. The **Pipeline Studio** opens. Go to [CI pipeline creation overview](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/prep-ci-pipeline-components#pipelines) to understand pipeline components.
3. Configure a Build stage within the pipeline. Go to [Add a Build Stage to a Pipeline](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/ci-stage-settings#add-a-build-stage-to-a-pipeline) to create one.
4. Select the **Infrastructure** tab for your Build stage and configure your preferred infrastructure settings. Go to [Infrastructure](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/ci-stage-settings#infrastructure) to review the available options.
5. Click the **Execution** tab for your Build Stage and click **Add Step > Add Step** to open the **Step Library**.
6. Scroll down to the **Security Tests** section or search within the **Step Library** to select the **Claude Code Security** step. \
   The **Step Parameters** tab in the **Configure Claude Code Security** side panel opens by default.
7. In the **Name** field, enter a unique name for the step. \
   Harness automatically generates a step ID from the name. Once the pipeline is created, you cannot change the ID.
8. In the **Description** field, provide a description to explain the purpose for the step.

#### Step 2: Configure the scan parameters

The scan parameters define how the Claude Code Security step processes security scans and the type of scan to perform. You can select the scan mode and choose a predefined scan configuration based on your requirements.

To configure the scan parameters, complete the following steps:

1. In the **Scan Mode** field, click the dropdown to select the required mode:
   * **Orchestration**: Configure the step to run a security scan and then ingest, normalize, and deduplicate the scan results.
   * **Ingestion**: Configure the step to read scan results from a data file and then ingest, normalize, and deduplicate the results.
2. In the **Scan Configuration** field, click the dropdown to select the required scan configuration:
   * **Full Scan**: Performs a full scan of the target repository.
   * **Incremental Scan**: Select this option to configure an incremental scan.
   * **PR Scan**: Performs a scan of the changes associated with a pull request (PR).

#### Step 3: Configure the target and variant detection

The target configuration specifies the repository to scan and how Harness identifies the target and its variant. You can use automatic detection to identify the target and variant from the pipeline context or manually provide the target details.

The scan-mode specific configuration is described below.

{% tabs %}
{% tab title="Orchestration" %}
To configure the target and variant detection for the orchestration mode, complete the following steps:

1. The **Type** field is set to **Repository** by default. This is the currently supported target type and cannot be modified.
2. Under **Target and Variant Detection**, select how you want Harness to identify the target and variant:
   * **Auto**: Automatically detects the target and variant from the pipeline context.
     * (Optional) In the **Workspace** field, specify the workspace path on the pod running the Security step.

       By default, the workspace path is `/harness`. You can override this path to scan a specific directory or a subset of the workspace. For example, specify `/harness/path/to/artifacts/subfolder` to scan a particular subdirectory.
   * **Manual**: Allows you to specify the target name and variant manually.
     * If you select **Manual**, configure the following fields:
       * **Name**: Enter an identifier for the target to scan. For example, specify the repository name.
       * **Variant**: Enter an identifier to distinguish the target variant, such as a branch name. Harness maintains historical scan trends for each variant.
       * (Optional) In the **Workspace** field, specify the workspace path on the pod running the Security step.

         By default, the workspace path is `/harness`. You can override this path to scan a specific directory or a subset of the workspace. For example, specify `/harness/path/to/artifacts/subfolder` to scan a particular subdirectory.
         {% endtab %}

{% tab title="Ingestion" %}
To configure the target and variant detection for the ingestion mode, complete the following steps:

1. The **Type** field is set to **Repository** by default. This is the currently supported target type and cannot be modified.
2. Under **Target and Variant Detection**, the **Manual** option is selected by default. Auto detection is not available in Ingestion mode.
3. Configure the following fields:
   * **Name**: Enter an identifier for the target whose scan results you want to ingest.
   * **Variant**: Enter an identifier to distinguish the target variant. Harness maintains historical scan trends for each variant.
   * In the **Ingestion File** field, enter the path to the scan results file that you want STO to ingest.
     {% endtab %}
     {% endtabs %}

#### Step 4: Configure the LLM connector

The LLM Connector field is available only when the **Scan Mode** is set to **Orchestration**. It specifies the Harness connector used to authenticate with Claude Code Security during scan execution.

To configure the LLM connector:

1. Under the **LLM Connector** field, click **Select** to open the **Create or Select an Existing Connector** dialog.
   * Select your required connector from the list of existing connectors. You can search for your created connector or filter them by **Project**, **Organization**, and **Account**.
   * Alternatively, click **+ New Connector** to create a new LLM connector with your Claude credentials for authenticating the Claude Code Security step.\
     Go to [Anthropic Model Connector](https://developer.harness.io/harness-ai/use-harness-ai/connect-with-ai/anthropic-model-connector) to create the Claude connector.&#x20;
2. Click the **Third-Party AI Integration Terms** url to open the **Third-Party AI Integration Terms** dialog.
3. Select the checkbox at the end of the dialog box to accept the terms.
4. Click **Accept and Activate**.\
   You can review the terms by clicking the **Review Terms** url.

{% 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. For more information, see [Add and reference text secrets](https://developer.harness.io/harness-platform/use-harness-platform/secrets/add-use-text-secrets).
* 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 %}

#### (Optional) Step 5: Configure scan execution options

The scan execution options allow you to control the logging level and define the severity threshold for pipeline failure. You can also provide additional command-line flags to customize scanner execution.

To configure the scan execution options, complete the following steps:

1. In the **Log Level** field, click the dropdown to select the minimum severity of messages to include in the scan logs. The available options are:
   * **Debug**: Includes detailed debug messages.
   * **Info**: Includes informational messages.
   * **Warning**: Includes warning messages.
   * **Error**: Includes error messages.
2. (Optional) In the **Additional CLI flags** field, enter additional command-line flags supported by Claude Code Security to customize scan execution.
3. (Optional) In the **Fail On Severity** field, click the dropdow to select the severity threshold for failing the pipeline. If the scan identifies any vulnerability with a severity of or above the specified level, the pipeline fails. \
   The available options are:
   * **Critical**: Fail the pipeline if a critical or higher-severity vulnerability is detected.
   * **High**: Fail the pipeline if a high or higher-severity vulnerability is detected.
   * **Medium**: Fail the pipeline if a medium or higher-severity vulnerability is detected.
   * **Low**: Fail the pipeline if a low or higher-severity vulnerability is detected.
   * **None**: Do not fail the pipeline based on vulnerability severity.

#### (Optional) Step 6: Configure the scan settings

The scan settings allow you to provide additional configuration parameters using key-value pairs.

To configure the scan settings, complete the following steps:

1. Under **Settings**, click **+ Add** to add a configuration entry.
2. In the **Key** field, enter the configuration parameter name.
3. In the **Value** field, enter the corresponding value for the parameter.
4. Repeat these steps to add more configuration entries, if required.
5. To remove a configuration entry, click the **Delete** icon next to it.

#### (Optional) Step 7: Add additional configuration

The additional configuration options allow you to customize the container image used by the Claude Code Security step and configure its execution environment.

To configure the additional settings, expand **Additional Configuration** and configure the following fields as required:

1. Under the **Container Registry** field, click **Select** to open the **Create or Select an Existing Connector** dialog.
   * Select your required connector from the list of existing connectors. You can search for your created connector or filter them by **Project**, **Organization**, and **Account**.
   * Alternatively, click **+ New Connector** to create a new container registry connector.\
     For more information, go to [Connect to Harness container image registry](https://developer.harness.io/harness-platform/use-harness-platform/connectors/artifact-repositories/add-a-docker-registry-connector/connect-to-harness-container-image-registry-using-docker-connector).
2. &#x20;Under the **Image Tag** field, specify the image tag to use for the security step. The default value is `latest`.
3. Under the **Image Pull Policy** field, select the policy that determines when the container image is pulled. The available options are:
   * **Always**: Always check the registry for the image digest and pull the image if the exact digest is not available locally.
   * **If Not Present**: Pull the image only if it is not already available locally.
   * **Never**: Use the locally available image without attempting to pull it from the registry.
4. Under the **Run as User** field, specify the user ID under which all processes in the container run. The default value is `1000`.
5. Under the **Timeout** field, specify the maximum time allowed for the step execution. You can enter the duration using weeks (w), days (d), hours (h), minutes (m), or seconds (s).

#### (Optional) Step 8: Configure the advanced settings

The advanced settings allow you to customize the execution behavior of the Claude Code Security step. You can configure conditional execution, failure strategies, looping strategies, and policy enforcement based on your pipeline requirements.

To configure the advanced settings for the Claude Code Security step, complete the following steps:

1. Select the **Advanced** tab to configure the advanced settings for the Claude Code Security step.
2. Expand the **Conditional Execution** collapsible to configure when the Claude Code Security step runs within the pipeline. Go to [Define conditional executions for stages and steps](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/step-skip-condition-settings) to configure conditional execution.
3. Expand the **Failure Strategy** collapsible to configure how the pipeline responds if the Claude Code Security step fails. Go to [Define failure strategies for stages and steps](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps) to configure failure strategies.
4. Expand the **Looping Strategy** collapsible to configure how the Claude Code Security step executes across multiple iterations. Go to [Use looping strategies](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/looping-strategies/looping-strategies-matrix-repeat-and-parallelism) to configure looping.
5. Click **Apply Changes** in the upper-right corner of the side panel to save the step configuration.

### Run the pipeline

When the pipeline runs, the Claude Code Security step analyzes the configured repository or pull request changes to identify potential security vulnerabilities. The scanner uses Claude's LLM capabilities to examine the code and generate structured security findings.

After the scan completes, the findings are ingested into Harness STO, where they are normalized and deduplicated. STO makes the findings available alongside results from other integrated security scanners, providing a centralized view of identified vulnerabilities.

You can review the scan results in STO and use its vulnerability management and governance capabilities to track findings, prioritize security risks, and enforce security policies across your development workflows.

To run the pipeline, complete the following steps:

1. Click **Save** in the upper-right corner of Pipeline Studio to save your pipeline changes.
2. Click **Run** to open the **Run Pipeline** dialog.
3. Provide any required runtime inputs, such as:
   * If applicable, select the input set or overlay to apply to the pipeline execution. Go to [Input Sets and Overlays](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/input-sets#run-pipelines-with-input-sets-or-overlays) to run pipelines with input sets.
   * Select the build type for the pipeline execution. By default, **Git Branch** is selected. You can also run the pipeline using a **Git Tag**, **Git Pull Request**, or **Git Commit SHA**. The **Branch Name** field is prepopulated with the default branch configured for the code repository connector. If you want to build from a different branch, provide or select the required branch name.
4. Click **Run Pipeline** to begin execution. \
   After the pipeline starts, you are redirected to the pipeline execution page, where you can monitor the execution status of each pipeline step and view the corresponding execution logs.

### 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 is located, and the remediation guidance the model returned. For more information, see [View scan results](https://developer.harness.io/security-testing-orchestration/use-sto/sto-security-issues/view-scan-results.md).

### 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.
