> 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/3.0/use-sto/sto-scanner-configuration/modelscan.md).

# ModelScan Step Configuration

The **ModelScan** step in Harness STO uses the open-source scanner [ModelScan](https://github.com/protectai/modelscan) to scan your machine learning (ML) models for security vulnerabilities. You can perform **ModelScan** scans in both [**Orchestration**](#scan-mode) and [**Ingestion**](#scan-mode) modes. This document will guide you through configuring the **ModelScan** step in your STO pipeline.

{% embed url="<https://youtu.be/PhvIXcwpme8>" %}
Scan your AI/ML models using ModelScan
{% endembed %}

{% hint style="info" %}

* To run scans as a non-root user, you can use custom STO scan images and pipelines. See [Configure your pipeline to use STO images from private registry](/security-testing-orchestration/3.0/troubleshooting-and-resources/sto-use-cases/set-up-sto-pipelines/configure-pipeline-to-use-sto-images-from-private-registry.md).
* STO supports multiple workflows for loading self-signed certificates. See [Run STO scans with custom SSL certificates](/security-testing-orchestration/3.0/troubleshooting-and-resources/sto-use-cases/secure-sto-pipelines/ssl-setup-in-sto.md#supported-workflows-for-adding-custom-ssl-certificates).
  {% endhint %}

#### Supported ML Libraries and Formats <a href="#supported-ml-libraries-and-formats" id="supported-ml-libraries-and-formats"></a>

The following table lists the ML libraries and serialization formats, along with their support status in the **ModelScan** step.

| ML Library                                    | Serialization Format                | Support Status  |
| --------------------------------------------- | ----------------------------------- | --------------- |
| Pytorch                                       | Pickle                              | ✅ Supported     |
| Keras                                         | HD5 (Hierarchical Data Format)      | ✅ Supported     |
| Classic ML Libraries (Sklearn, XGBoost, etc.) | Pickle, Cloudpickle, Dill, Joblib   | ✅ Supported     |
| TensorFlow                                    | Protocol Buffer                     | ❌ Not Supported |
| Keras                                         | Keras V3 (Hierarchical Data Format) | ❌ Not Supported |

Scanning ML models in **binary files** is not supported. Your models must be in one of the supported formats listed above.

### ModelScan step settings <a href="#modelscan-step-settings" id="modelscan-step-settings"></a>

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

#### Scan Mode <a href="#scan-mode" id="scan-mode"></a>

* **Orchestration mode**: In this mode, the step executes the scan, then processes the results by normalizing and deduplicating them.
* **Ingestion mode**: In this mode, the **ModelScan** step ingests scan results from a specified file. The scan results file must be in JSON format.

#### Scan Configuration <a href="#scan-configuration" id="scan-configuration"></a>

#### Target <a href="#target" id="target"></a>

**Type**

You can also scan models stored in **Hugging Face** repositories by using the [Harness GitHub connector](/harness-ai/use-harness-platform/connectors/code-repositories/connect-to-code-repo.md), configured to connect to your Hugging Face account.

**Target and variant detection**

**Name**

**Variant**

**Workspace**

#### Ingestion File <a href="#ingestion-file" id="ingestion-file"></a>

The ingestion file must be in `JSON` format.

#### Log Level <a href="#log-level" id="log-level"></a>

#### Fail on Severity <a href="#fail-on-severity" id="fail-on-severity"></a>

#### Additional Configuration <a href="#additional-configuration" id="additional-configuration"></a>

#### Advanced settings <a href="#advanced-settings" id="advanced-settings"></a>

### Proxy settings <a href="#proxy-settings" id="proxy-settings"></a>
