> 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/api-reference/security-testing-agent-apis/security-testing-orchestration/policy-enforcements.md).

# Policy Enforcements

Evaluate STO scan issues against Harness policy sets

## POST /api/v2/policy-enforcements

> Evaluate PolicyEnforcements

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"PolicyEnforcements","description":"Evaluate STO scan issues against Harness policy sets"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_scan_view"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"PolicyEnforcementResult":{"type":"object","properties":{"evaluationId":{"type":"string"},"failedPolicySets":{"type":"array","items":{"$ref":"#/components/schemas/PolicyEnforcementPolicySet"}},"status":{"type":"string","enum":["pass","warning","error"]},"warningPolicySets":{"type":"array","items":{"$ref":"#/components/schemas/PolicyEnforcementPolicySet"}}},"required":["status","evaluationId","failedPolicySets","warningPolicySets"]},"PolicyEnforcementPolicySet":{"type":"object","properties":{"identifier":{"type":"string"},"name":{"type":"string"},"policies":{"type":"array","items":{"$ref":"#/components/schemas/PolicyEnforcementPolicy"}},"status":{"type":"string","enum":["pass","warning","error"]}},"required":["identifier","name","status","policies"]},"PolicyEnforcementPolicy":{"type":"object","properties":{"denyMessages":{"type":"array","items":{"type":"string"}},"error":{"type":"string"},"identifier":{"type":"string"},"name":{"type":"string"},"severity":{"type":"string"},"status":{"type":"string","enum":["pass","warning","error"]}},"required":["identifier","name","status","denyMessages"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/policy-enforcements":{"post":{"tags":["PolicyEnforcements"],"summary":"Evaluate PolicyEnforcements","operationId":"PolicyEnforcements#Evaluate","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"orgId","in":"query","description":"Harness Organization ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128}},{"name":"projectId","in":"query","description":"Harness Project ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entityName":{"type":"string","description":"Name shown for this evaluation. Step name, pipeline name, or pipeline id."},"executionId":{"type":"string"},"policySetIds":{"type":"array","items":{"type":"string"},"minItems":1},"scanner":{"type":"string"},"target":{"type":"string"},"targetOrgId":{"type":"string","description":"Org that owns the scan target or execution. Defaults to orgId.","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"targetProjectId":{"type":"string","description":"Project that owns the scan target or execution. Defaults to projectId.","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"variant":{"type":"string"}}}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyEnforcementResult"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"409":{"description":"Conflict: Conflict response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```
