> For the complete documentation index, see [llms.txt](https://docs.soda.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.soda.io/data-testing/git-managed-data-contracts/verify-a-contract.md).

# Verify a contract

Once your contract is authored and published (or available locally), you can verify whether the actual data complies with the defined expectations. Soda provides two execution options:

* **Soda Core** – run verifications locally, typically in CI/CD pipelines or dev environments.
* **Soda Runner** – run verifications remotely using a runner deployed in your environment, triggered via Soda Cloud.

Both approaches support variable overrides, publishing results to Soda Cloud, and integration into automated workflows.

> Learn more about [Deployment options](/deployment-options.md)

## Using Soda Core

Soda Core runs the verification locally, connecting to your data source using the defined data source configuration file.

```javascript
soda contract verify --data-source ds_config.yml --contract contract.yaml
```

This command:

* Connects to your database using the local config
* Loads the contract
* Runs all checks and returns a pass/fail result

### With variable overrides

You can pass variables defined in the contract using the `--set` flag:

```javascript
soda contract verify --data-source ds_config.yml --contract contract.yaml --set START_DATE=2024-05-01
```

> Learn about variables in Data Contract: [Contract Language reference](/reference/contract-language-reference.md#make-contracts-dynamic-with-variables)

### Publish results to Soda Cloud

To send verification results to Soda Cloud for visibility and reporting.

Add the flag `--publish` to the command.

{% hint style="warning" %}
This action requires the "Manage contract" permission on the dataset; the user is identified based on the API key provided in the Soda Cloud configuration.

Learn more about permissions here: [Dataset Attributes & Responsibilities](/dataset-attributes-and-responsibilities.md)
{% endhint %}

```bash
soda contract verify --data-source ds_config.yml --contract contract.yaml --publish --soda-cloud sc_config.yml
```

> Learn how to connect the CLI to Soda Cloud: [Core CLI reference](/reference/cli-reference.md#connect-to-soda-cloud)

This is recommended if you want stakeholders to see the outcomes in Soda Cloud or include them in dashboards and alerting.

### Run a subset of checks

Use `--check-filter` (or `-cf`) to run only specific checks from your contract. Each filter is a `key=value` expression that matches checks by their properties such as type, column, name, or custom attributes.

{% code overflow="wrap" %}

```bash
# Run only missing checks
soda contract verify --data-source ds_config.yml --contract contract.yaml -cf type=missing
```

{% endcode %}

```bash
# Run only checks on the id column with severity=critical
soda contract verify --data-source ds_config.yml --contract contract.yaml \
  -cf column=id -cf attributes.severity=critical
```

You can also use `--check-paths` (or `-cp`) to select checks by their YAML path.

> Learn more about check filters, check paths, wildcards, and combinations in the [CLI reference](/reference/cli-reference.md#run-a-subset-of-checks).

## Using Soda Runner

Soda Runner executes verifications using data sources configured in Soda Cloud.

```bash
soda contract verify --contract contract.yaml --use-runner --soda-cloud sc_config.yml
```

This setup:

* Runs verifications through the Soda Runner connected to your data source
* Fetches the published contract from Soda Cloud
* Returns the result locally in the CLI

### With variable overrides

You can pass variables defined in the contract using the `--set` flag:

```bash
soda contract verify --contract contract.yaml --use-runner --soda-cloud sc_config.yml --set START_DATE=2024-05-01
```

> Learn about variables in Data Contract: [Contract Language reference](/reference/contract-language-reference.md#make-contracts-dynamic-with-variables)

### Publish results to Soda Cloud

You can also push results to Soda Cloud from the runner-based run.

Add the flag `--publish` to the command.

{% hint style="warning" %}
This action requires the "Manage contract" permission on the dataset; the user is identified based on the API key provided in the Soda Cloud configuration.

Learn more about permissions here: [Dataset Attributes & Responsibilities](/dataset-attributes-and-responsibilities.md)
{% endhint %}

```bash
soda contract verify --dataset datasource/db/schema/table --publish --use-runner --soda-cloud sc_config.yml
```

This is recommended if you want stakeholders to see the outcomes in the Soda Cloud or include them in dashboards and alerting.

***

{% hint style="info" %}
You are **not logged in to Soda** and are viewing the default public documentation. Learn more about [Licensing & documentation access](/reference/documentation-access-and-licensing.md).

If you do have a Soda license, make sure to **log in to Soda Cloud in this same browser**.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.soda.io/data-testing/git-managed-data-contracts/verify-a-contract.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
