> 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/internal-developer-portal/troubleshooting-and-resources/idp-tutorials/opa-scorecards.md).

# Harness Policy As Code for Services using Scorecards

Harness provides governance using [Open Policy Agent (OPA)](https://www.openpolicyagent.org/), Policy Management, and Rego policies.

In this tutorial we will look into how you can create the policy and apply it to all Services in your Account. The policy is evaluated on Service-level based on the score fetched from scorecards and the conditions set by users, and applues on pipeline-event like On Save which occurs during Connector Creation and Updates. Go to [Harness Governance Quickstart](/harness-ai/use-harness-platform/governance/policy-as-code/harness-governance-quickstart.md).

### Get started <a href="#get-started" id="get-started"></a>

1. Go to **Account Setting** under **Administrative Settings**.

![](/files/DyreLGjbkx5QYuGi0MSy)

2. Select **Policies** under **Security and Governance**.

![](/files/Bkaz3rDLCB3UZL5lEB1h)

3. Now go to the **Policies** tab and select **+New Policy**.

![](/files/YXPNwJzyoKJE0bjnsVHP)

4. Add a name to your policy and then select **Apply**.

![](/files/S5HnHAGKCFmNkhXGwVql)

5. Now from the Library select **IDP Scorecard** and select **Use this Sample**. Presently we have two Policies available for IDP, read more about it in the [detailed docs](/internal-developer-portal/use-idp/scorecards/tutorials/opa-implementation.md).

![](/files/1P32236oxT39DOih0X3z)

6. Now test and save it.

### Create a policy set <a href="#create-a-policy-set" id="create-a-policy-set"></a>

7. Now go to **Policy Sets** and create a **+New Policy Set**.
8. Add a Name and Entity it applies to followed by the event it should be evaluated.

![](/files/vggA1ZrsiBewYwik3c4u)

9. Now add the policy you have created above and change the type to **Warn & Continue** and **Apply**.

![](/files/ZGHThIOcMwVLDDuWjJAa)

![](/files/WMNigRb8nlHJGBxLImMr)

10. Now finish the step and an Policy Set would be created with Account Level Scope.

### Conclusion <a href="#conclusion" id="conclusion"></a>

You have set-up a policy which can be used in your Deployment Pipeline.
