Loading...
Loading...
Create OPA governance policies for Harness via MCP. Define policies that enforce compliance rules on pipelines, services, environments, feature flags, artifacts, code repositories, templates, SBOM, security tests, Terraform, GitOps, connectors, secrets, and more. Use when asked to create, write, fix, or explain an OPA policy, Rego rule, deny rule, governance policy, compliance rule, or policy-as-code for any Harness entity. Trigger phrases: create policy, OPA policy, governance policy, compliance rule, rego policy, deny rule, enforce policy, security policy, supply chain governance.
npx skill4agent add harness/harness-skills create-policyreferences/rego-writing-guide.mdCall MCP tool: harness_create
Parameters:
resource_type: "policy"
org_id: "<organization>"
project_id: "<project>"
body: <policy definition>governanceresource_type: "policy"Call MCP tool: harness_list
Parameters:
resource_type: "scs_compliance_result"
org_id: "<organization>"
project_id: "<project>"package harness.artifact
deny[msg] {
not input.artifact.sbom
msg := "Artifact must have an SBOM before deployment"
}package harness.artifact
deny[msg] {
vuln := input.artifact.vulnerabilities[_]
vuln.severity == "CRITICAL"
msg := sprintf("Critical vulnerability %s found in artifact", [vuln.cve_id])
}package harness.artifact
approved_bases := {"alpine", "distroless", "ubuntu"}
deny[msg] {
not approved_bases[input.artifact.base_image]
msg := sprintf("Base image '%s' is not in the approved list", [input.artifact.base_image])
}package harness.artifact
deny[msg] {
not input.artifact.signed
msg := "Artifact must be signed before deployment"
}| Resource Type | Operations | Description |
|---|---|---|
| list, get, create, update, delete | OPA governance policies (governance toolset) |
| list, get, create, update, delete | Group policies with enforcement actions |
| list, get | View policy evaluation results |
| list | Check SCS policy compliance status |
| list, get | View artifact security posture |
| list, get | View repository security posture |
| get | Verify artifact provenance |
package harness.<domain>resource_type: "policy"policy_setscs_compliance_resultpolicy_evaluationpackage harness.<domain>msgpolicy_set