> 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/cloud-cost-management/3.0/cost-governance/asset-governance/policy-runs.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Policy runs

Read policy runs, their cost impact, and export the output

A policy run is the record of one execution. The list includes runs started with **Live run** on a policy and runs started by a schedule. Each row shows the cost impact and the last time that policy or policy set ran.

## Before you begin

* Make sure at least one policy has been run, from **Test & run** or from a schedule. Navigate to [Create a policy](https://developer.harness.io/cloud-cost-management/3.0/cost-governance/asset-governance/create-a-policy.md) to run a policy once.
* Verify cost settings if the cost impact is blank. Costs use the account default cost settings.

## Statuses

Harness reports three statuses:

* **Success**: The run finished with no errors.
* **Failed**: The run did not finish and has errors.
* **Partial success**: The run finished with no Harness errors, and Cloud Custodian wrote additional logs, or a multi-policy run succeeded for only some of the resources.

## Policy runs list

On the **Policy runs** tab, the columns are:

* **Policy**
* **Run status**
* **Mode**
* **Resources impacted**
* **Schedule**
* **Ran at**
* **Cost impact**

**Mode** is **Live** or **Dry run**. **Schedule** shows the schedule name, or **Run once** when the run was not from a schedule. **Cost impact** can read **Not available**.

To narrow the list:

1. Click **Add filter** and select one or more of the following:
   * **Policies**
   * **Policy sets**
   * **Schedules**
   * **Cloud provider**
   * **Cloud tags**
   * **Cost category**
   * **Min cost impact**
   * **AWS accounts**
   * **AWS regions**
   * **Azure subscription**
   * **Azure regions**
   * **GCP project**
2. Set **Start date**. Presets run from **Last 1 Minute** through **Last Month**, and include a custom range. The tab opens on **Last 1 Day**.
3. Select **Show: resource count > 0** to hide runs that found no resources.
4. Set **Run status** (**Success**, **Partial success**, **Failed**) and **Policy run type** (**Run**, **Dry run**).
5. Click **Save**, then enter a name for the filter.
6. Select who can edit and view the filter.
7. Click **Saved filters** to apply a saved filter.
8. Click **Reset** to clear the filters.

![The Policy runs list, with filters, Export, and the Policy, Run status, Mode, Resources impacted, Schedule, and Ran at columns](https://3362046280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLgkNK1xq1Uj6rzIm2kum%2Fuploads%2Fgit-blob-5baeb59a48ac8dc9acc5dc2fbd8c11b8591f51fd%2Fasset-governance-policy-runs.png?alt=media)

## Read a policy run

Select a row. The page shows **Status**, **Mode**, and **Ran at**, and a **Policy run details** panel:

* **Schedule**: The schedule name, and the cadence, such as **Every hour**.
* **Target and output resources**: The account and the region.
* **Action**: The action the policy ran. A dry run shows no action.
* **Resources identified** and **Actioned resources**:

Click **Open in policy editor** to open the policy. Click **Refresh cost data** to recompute cost for the resources in the run. Use it when cost is missing because the resource is new and not yet in the cost and usage report, the billing report, or the billing data. You can refresh cost once every 30 minutes for a policy run.

The output has three tabs: **Resources identified**, **Logs**, and **Evaluated policy**. A run of a file that contains several policies lists each policy in the output.

On **Resources identified**, the resources are shown as a table or as JSON. Nested objects and arrays start collapsed. Expand them up to two levels. Further nested properties are shown as formatted JSON. You can search, copy, download, and open the output full screen. Filter on keys in the JSON. Numeric values support `==`, `!=`, `<`, `<=`, `>`, and `>=`. A string value supports `LIKE`. Sort ascending or descending, and select the keys to keep.

![The Policy run details panel, with the schedule, target, action, resources identified, and the Resources identified, Logs, and Evaluated policy tabs](https://3362046280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLgkNK1xq1Uj6rzIm2kum%2Fuploads%2Fgit-blob-407da201997af6ba1f371fa692c67644d89594a1%2Fasset-governance-run-details.png?alt=media)

## Cost

Cost correlation connects a policy run with the cost of the resources it found.

Click **Refresh cost data** when the cost for a resource is not yet in the cost and usage report, the billing report, or the billing data. You can refresh once every 30 minutes for a policy run.

{% hint style="info" %}

### Cost settings for policy runs

Cost correlation for GCP requires a detailed billing export. Costs in policy runs use the account-level default cost settings. The settings start from the account defaults. You can override them for Asset Governance in **Settings** > **Preferences**. To change the account defaults, navigate to **Account Settings**, then **Cloud & AI Cost Management**, then **Cost Settings**. A change can take up to 30 minutes to appear.
{% endhint %}

Harness computes savings when a terminal action (stop, delete, release, and similar) is applied to the resources. The savings depend on the cost of the filtered resource, the savings percentage set on the policy, and a supported terminal action. For a resource whose terminal actions are not supported, Harness can still compute the cost of the filtered resources and cannot predict savings. Navigate to [Policies by Harness](https://developer.harness.io/cloud-cost-management/3.0/cost-governance/asset-governance/policies-by-harness.md#what-is-supported) to read the support matrix and the actions that compute savings.

Harness computes cost impact for 150,000 policy runs a day.

## Export

Click **Export** to download the policy runs that match the current filters.

To export:

1. On the **Policy runs** tab, click **Export**.
2. In **Export output**, select the files to include: **Include metadata files**, **Include resource files**, **Include custodian metadata**, **Include log files**, and **Include action files**.
3. Select **Download format**: **JSON** or **CSV**.
4. Click **Generate export**.

The export includes results for all policy runs that match the filters applied. The zip is organized by policy run, with a folder per policy when the run contains more than one policy. You can also export from **Test & run** when you evaluate more than one target.

The files correspond to the run output:

* Metadata is the summary of each policy run.
* Resource files are the resources identified.
* Log files are the execution log (`custodian-run.log`).
* Action files are the resources the policy acted on (`actioned-resources.json`).

![The Export output dialog, with the file checkboxes and Download format set to JSON or CSV](https://3362046280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLgkNK1xq1Uj6rzIm2kum%2Fuploads%2Fgit-blob-f12dc78113646a9836ff609623a3f7dd6f4fa012%2Fasset-governance-export-output.png?alt=media)

{% @harness-feedback/feedback %}
