> 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/exemption-rules.md).

# Exemption Rules

Manage admin-defined rules that gate Exemption creation

## GET /api/v2/exemption-rules

> List a collection of Exemption Rules

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"ExemptionRules","description":"Manage admin-defined rules that gate Exemption creation"}],"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_exemption_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":{"ExemptionRulesListExemptionRulesResponseBody":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ExemptionRule"}}},"required":["results","pagination"]},"Pagination":{"type":"object","properties":{"link":{"type":"string","description":"Link-based paging"},"page":{"type":"integer","description":"Page number (starting from 0)","format":"int64"},"pageSize":{"type":"integer","description":"Requested page size","format":"int64"},"totalItems":{"type":"integer","description":"Total results available","format":"int64"},"totalPages":{"type":"integer","description":"Total pages available","format":"int64"}},"required":["page","pageSize","totalPages","totalItems"]},"ExemptionRule":{"type":"object","properties":{"actions":{"type":"object","description":"Actions to apply when the rule matches. Today: duration only. Action handlers are pluggable; see the design doc for the planned set.","additionalProperties":true},"conditions":{"type":"object","description":"Matcher conditions. Keys are attribute names that appear in the issue context (severity_code, type, reachability, exploitability, epss, plus anything in issue.details). Missing keys are wildcards. Each value is either an array (OR-list), an object describing a numeric range, or a scalar (equality).","additionalProperties":true},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"createdBy":{"type":"string","description":"ID of the user who created the rule.","pattern":"^[a-zA-Z0-9_-]{22}$"},"description":{"type":"string","description":"Free-form rule description.","maxLength":1024},"enabled":{"type":"boolean","description":"Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle."},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"lastModified":{"type":"integer","description":"Unix timestamp at which the resource was most recently modified","format":"int64"},"lastModifiedBy":{"type":"string","description":"ID of the user who last modified the rule.","pattern":"^[a-zA-Z0-9_-]{22}$"},"name":{"type":"string","description":"Human-readable rule name. Must be unique within an account.","minLength":1,"maxLength":256},"priority":{"type":"integer","description":"0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.","format":"int64","minimum":0}},"description":"An admin-defined rule that gates Exemption creation and approval. Rules are evaluated against an exemption request; if a rule matches, its actions fire — typically capping the requested duration.","required":["id","name","conditions","actions","priority","enabled","createdBy","lastModifiedBy","created","lastModified"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/exemption-rules":{"get":{"tags":["ExemptionRules"],"description":"List a collection of Exemption Rules","operationId":"ExemptionRules#ListExemptionRules","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":"page","in":"query","description":"Page number to fetch (starting from 0)","allowEmptyValue":true,"schema":{"type":"integer","description":"Page number to fetch (starting from 0)","default":0,"format":"int64","minimum":0}},{"name":"pageSize","in":"query","description":"Number of results per page","allowEmptyValue":true,"schema":{"type":"integer","description":"Number of results per page","default":30,"format":"int64","minimum":1,"maximum":100}},{"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"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExemptionRulesListExemptionRulesResponseBody"}}}},"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"}}}},"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"}}}}}}}}}
```

## POST /api/v2/exemption-rules

> Create a new Exemption Rule

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"ExemptionRules","description":"Manage admin-defined rules that gate Exemption creation"}],"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_exemption_approve"]}],"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":{"CreateExemptionRuleRequestBody":{"type":"object","properties":{"actions":{"type":"object","description":"Actions to apply when the rule matches. Today: duration only. Action handlers are pluggable; see the design doc for the planned set.","additionalProperties":true},"conditions":{"type":"object","description":"Matcher conditions. Keys are attribute names that appear in the issue context (severity_code, type, reachability, exploitability, epss, plus anything in issue.details). Missing keys are wildcards. Each value is either an array (OR-list), an object describing a numeric range, or a scalar (equality).","additionalProperties":true},"description":{"type":"string","description":"Free-form rule description.","maxLength":1024},"enabled":{"type":"boolean","description":"Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle."},"name":{"type":"string","description":"Human-readable rule name. Must be unique within an account.","minLength":1,"maxLength":256},"priority":{"type":"integer","description":"0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.","format":"int64","minimum":0},"userId":{"type":"string","description":"Harness User ID"}},"required":["userId","name","conditions","actions"]},"ExemptionRulesCreateExemptionRuleResponseBody":{"$ref":"#/components/schemas/IDResult"},"IDResult":{"type":"object","properties":{"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"}},"required":["id"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/exemption-rules":{"post":{"tags":["ExemptionRules"],"description":"Create a new Exemption Rule","operationId":"ExemptionRules#CreateExemptionRule","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":"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":{"$ref":"#/components/schemas/CreateExemptionRuleRequestBody"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExemptionRulesCreateExemptionRuleResponseBody"}}}},"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"}}}},"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"}}}}}}}}}
```

## GET /api/v2/exemption-rules/{id}

> Find Exemption Rule by ID

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"ExemptionRules","description":"Manage admin-defined rules that gate Exemption creation"}],"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_exemption_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":{"ExemptionRule":{"type":"object","properties":{"actions":{"type":"object","description":"Actions to apply when the rule matches. Today: duration only. Action handlers are pluggable; see the design doc for the planned set.","additionalProperties":true},"conditions":{"type":"object","description":"Matcher conditions. Keys are attribute names that appear in the issue context (severity_code, type, reachability, exploitability, epss, plus anything in issue.details). Missing keys are wildcards. Each value is either an array (OR-list), an object describing a numeric range, or a scalar (equality).","additionalProperties":true},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"createdBy":{"type":"string","description":"ID of the user who created the rule.","pattern":"^[a-zA-Z0-9_-]{22}$"},"description":{"type":"string","description":"Free-form rule description.","maxLength":1024},"enabled":{"type":"boolean","description":"Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle."},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"lastModified":{"type":"integer","description":"Unix timestamp at which the resource was most recently modified","format":"int64"},"lastModifiedBy":{"type":"string","description":"ID of the user who last modified the rule.","pattern":"^[a-zA-Z0-9_-]{22}$"},"name":{"type":"string","description":"Human-readable rule name. Must be unique within an account.","minLength":1,"maxLength":256},"priority":{"type":"integer","description":"0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.","format":"int64","minimum":0}},"description":"An admin-defined rule that gates Exemption creation and approval. Rules are evaluated against an exemption request; if a rule matches, its actions fire — typically capping the requested duration.","required":["id","name","conditions","actions","priority","enabled","createdBy","lastModifiedBy","created","lastModified"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/exemption-rules/{id}":{"get":{"tags":["ExemptionRules"],"description":"Find Exemption Rule by ID","operationId":"ExemptionRules#FindExemptionRuleById","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":"id","in":"path","description":"The ID of the Exemption Rule to retrieve","required":true,"schema":{"type":"string","description":"The ID of the Exemption Rule to retrieve","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"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"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExemptionRule"}}}},"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"}}}},"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"}}}}}}}}}
```

## PUT /api/v2/exemption-rules/{id}

> Update an existing Exemption Rule

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"ExemptionRules","description":"Manage admin-defined rules that gate Exemption creation"}],"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_exemption_approve"]}],"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":{"UpdateExemptionRuleRequestBody":{"type":"object","properties":{"actions":{"type":"object","description":"Actions to apply when the rule matches. Today: duration only. Action handlers are pluggable; see the design doc for the planned set.","additionalProperties":true},"conditions":{"type":"object","description":"Matcher conditions. Keys are attribute names that appear in the issue context (severity_code, type, reachability, exploitability, epss, plus anything in issue.details). Missing keys are wildcards. Each value is either an array (OR-list), an object describing a numeric range, or a scalar (equality).","additionalProperties":true},"description":{"type":"string","description":"Free-form rule description.","maxLength":1024},"enabled":{"type":"boolean","description":"Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle."},"name":{"type":"string","description":"Human-readable rule name. Must be unique within an account.","minLength":1,"maxLength":256},"priority":{"type":"integer","description":"0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.","format":"int64","minimum":0},"userId":{"type":"string","description":"Harness User ID"}},"required":["userId"]},"ExemptionRule":{"type":"object","properties":{"actions":{"type":"object","description":"Actions to apply when the rule matches. Today: duration only. Action handlers are pluggable; see the design doc for the planned set.","additionalProperties":true},"conditions":{"type":"object","description":"Matcher conditions. Keys are attribute names that appear in the issue context (severity_code, type, reachability, exploitability, epss, plus anything in issue.details). Missing keys are wildcards. Each value is either an array (OR-list), an object describing a numeric range, or a scalar (equality).","additionalProperties":true},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"createdBy":{"type":"string","description":"ID of the user who created the rule.","pattern":"^[a-zA-Z0-9_-]{22}$"},"description":{"type":"string","description":"Free-form rule description.","maxLength":1024},"enabled":{"type":"boolean","description":"Whether the rule is active. Disabled rules are retained and still listed, but are skipped during evaluation. OPTIONAL: defaults to true on create; on update, omit to keep the current state or send false/true to toggle."},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"lastModified":{"type":"integer","description":"Unix timestamp at which the resource was most recently modified","format":"int64"},"lastModifiedBy":{"type":"string","description":"ID of the user who last modified the rule.","pattern":"^[a-zA-Z0-9_-]{22}$"},"name":{"type":"string","description":"Human-readable rule name. Must be unique within an account.","minLength":1,"maxLength":256},"priority":{"type":"integer","description":"0-based rank within an account. Lower fires first (first-match-wins). OPTIONAL on both create and update: if omitted on CREATE the new rule is appended at the bottom (rank = current rule count); if omitted on UPDATE the rule keeps its current rank. When supplied, send 0 to insert at the top, 1..n to insert at that rank, or any value >= rule count to land at the tail.","format":"int64","minimum":0}},"description":"An admin-defined rule that gates Exemption creation and approval. Rules are evaluated against an exemption request; if a rule matches, its actions fire — typically capping the requested duration.","required":["id","name","conditions","actions","priority","enabled","createdBy","lastModifiedBy","created","lastModified"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/exemption-rules/{id}":{"put":{"tags":["ExemptionRules"],"description":"Update an existing Exemption Rule","operationId":"ExemptionRules#UpdateExemptionRule","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":"id","in":"path","description":"The ID of the Exemption Rule to update","required":true,"schema":{"type":"string","description":"The ID of the Exemption Rule to update","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"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":{"$ref":"#/components/schemas/UpdateExemptionRuleRequestBody"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExemptionRule"}}}},"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"}}}},"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"}}}}}}}}}
```

## Get exemption constraints for issues or occurrences

> Evaluate the exemption rule engine and return the \*\*strictest\*\* constraint that applies to an exemption request. Pass \`items\[]\` (max 100); a single exemption is just a one-element list. Each item self-describes its own scope and kind:\
> \
> • \*\*target-scoped issue\*\*: set \`targetId\`.\
> • \*\*pipeline-scoped issue\*\*: set \`pipelineId\` (mutually exclusive with \`targetId\`).\
> • \*\*project-scoped issue\*\*: set neither (scope comes from the request-level \`orgId\`/\`projectId\`).\
> • \*\*occurrence-level\*\*: set \`occurrences\[]\`, or set \`scanId\` (with \`targetId\`) to evaluate all non-exempted occurrences from that scan — used when "Exempt all future occurrences" is unchecked.\
> \
> Items in a single batch may mix scopes and kinds freely. The response carries the strictest matched constraint across everything evaluated: \`maxDurationDays\` is the minimum of every non-null per-item cap (or null if all are unconstrained), and \`matchedRuleId\` names the rule contributing that minimum. Optional \`type\` carries the FE "Reason" dropdown value (same enum as POST /exemptions.type) so rules with \`reason\` conditions evaluate correctly.

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"ExemptionRules","description":"Manage admin-defined rules that gate Exemption creation"}],"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_exemption_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":{"GetExemptionConstraintsRequestBody":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/IssueItem"},"description":"Evaluation entries (max 100). Each item self-describes its scope (`targetId` / `pipelineId` / neither) and kind (`occurrences[]` present ⇒ occurrence-level). A single exemption is a one-element list. Items may mix scopes and kinds.","maxItems":100},"orgId":{"type":"string","description":"Harness Organization id this exemption request is scoped to. Required: the backend resolves the project hierarchy (parent_unique_id) from `orgId`/`projectId` to scope attribute resolution for project- and pipeline-level evaluation, and rules conditioned on `org_id` evaluate correctly.","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"projectId":{"type":"string","description":"Harness Project id this exemption request is scoped to. Required: the backend resolves the project hierarchy (parent_unique_id) from `orgId`/`projectId` to scope attribute resolution for project- and pipeline-level evaluation, and rules conditioned on `project_id` evaluate correctly.","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"type":{"type":"string","description":"Value of the FE's \"Reason\" dropdown — i.e. the same enum sent as `type` on POST /exemptions (\"False Positive\", \"Acceptable Risk\", \"Compensating Controls\", \"Acceptable Use\", \"Fix Unavailable\", \"Other\"). When set, it is merged into every issue's context so rules with `reason` conditions evaluate correctly. Omit if the user has not picked from the dropdown yet — rules with reason conditions will be skipped in that case. Named `type` here for parity with POST /exemptions.type; internally the rule engine surfaces it as the `reason` axis (which matches the FE dropdown label customers see).","enum":["Compensating Controls","Acceptable Use","Acceptable Risk","False Positive","Fix Unavailable","Other"]}},"required":["orgId","projectId"]},"IssueItem":{"type":"object","properties":{"issueId":{"type":"string","description":"Issue ID to evaluate.","pattern":"^[a-zA-Z0-9_-]{22}$"},"occurrences":{"type":"array","items":{"type":"integer","format":"int64"},"description":"Occurrence internal IDs being exempted. When present, this item is an occurrence-level exemption (always target-scoped, `targetId` required). When omitted but `scanId` is set, all non-exempted occurrences for the issue in that scan are evaluated."},"pipelineId":{"type":"string","description":"Pipeline id for this item (pipeline scope). Mutually exclusive with `targetId`. Different items may target different pipelines.","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"scanId":{"type":"string","description":"Harness Scan ID. When set with `targetId` and without `occurrences[]`, expands to all non-exempted occurrences for the issue in that scan (current-occurrences-only exemption). Mutually exclusive with `pipelineId`.","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetId":{"type":"string","description":"Target id for this item (target scope). Required when `occurrences[]` is set. Mutually exclusive with `pipelineId`.","pattern":"^[a-zA-Z0-9_-]{22}$"}},"required":["issueId"]},"ExemptionRulesGetExemptionConstraintsResponseBody":{"$ref":"#/components/schemas/ExemptionConstraints"},"ExemptionConstraints":{"type":"object","properties":{"matchedRuleId":{"type":"string","description":"ID of the rule that fired. Empty string if no rule matched (request is unconstrained by policy)."},"maxDurationDays":{"type":"integer","description":"Maximum duration in days that this exemption may run. Null means no cap and indefinite (\"All Time\") is allowed; a non-null value forbids \"All Time\".","format":"int64","minimum":1}},"description":"Constraints that apply to an exemption request for a specific issue, computed by evaluating account-level exemption rules against the issue's attributes.","required":["matchedRuleId"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/exemption-rules/constraints":{"post":{"tags":["ExemptionRules"],"summary":"Get exemption constraints for issues or occurrences","description":"Evaluate the exemption rule engine and return the **strictest** constraint that applies to an exemption request. Pass `items[]` (max 100); a single exemption is just a one-element list. Each item self-describes its own scope and kind:\n\n• **target-scoped issue**: set `targetId`.\n• **pipeline-scoped issue**: set `pipelineId` (mutually exclusive with `targetId`).\n• **project-scoped issue**: set neither (scope comes from the request-level `orgId`/`projectId`).\n• **occurrence-level**: set `occurrences[]`, or set `scanId` (with `targetId`) to evaluate all non-exempted occurrences from that scan — used when \"Exempt all future occurrences\" is unchecked.\n\nItems in a single batch may mix scopes and kinds freely. The response carries the strictest matched constraint across everything evaluated: `maxDurationDays` is the minimum of every non-null per-item cap (or null if all are unconstrained), and `matchedRuleId` names the rule contributing that minimum. Optional `type` carries the FE \"Reason\" dropdown value (same enum as POST /exemptions.type) so rules with `reason` conditions evaluate correctly.","operationId":"ExemptionRules#GetExemptionConstraints","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":"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":{"$ref":"#/components/schemas/GetExemptionConstraintsRequestBody"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExemptionRulesGetExemptionConstraintsResponseBody"}}}},"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"}}}},"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"}}}}}}}}}
```
