> 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/platform-apis/governance/aida.md).

# Aida

AIDA API's for Harness OPA

## POST /api/v1/aida/accept

> Record explicit AI acceptance from UI

```json
{"openapi":"3.0.3","info":{"title":"Governance Policy Management API","version":"1.2.0"},"tags":[{"name":"aida","description":"AIDA API's for Harness OPA"}],"servers":[{"url":"https://app.harness.io/gateway/pm/"}],"security":[{"jwt_header_Authorization":["core_governancePolicy_view"]},{"api_key_header_x-api-key":[]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"},"api_key_header_x-api-key":{"type":"apiKey","description":"Harness PAT","name":"x-api-key","in":"header"}},"schemas":{"AcceptRequestBody":{"type":"object","properties":{"output":{"type":"string","description":"Generated rego output"},"prompt":{"type":"string","description":"Text query"}}},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?"},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem."},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem."},"name":{"type":"string","description":"Name is the name of this class of errors."},"temporary":{"type":"boolean","description":"Is the error temporary?"},"timeout":{"type":"boolean","description":"Is the error a timeout?"}},"required":["name","id","message","temporary","timeout","fault"]}}},"paths":{"/api/v1/aida/accept":{"post":{"tags":["aida"],"description":"Record explicit AI acceptance from UI","operationId":"aida#accept","parameters":[{"name":"accountIdentifier","in":"query","description":"Harness account ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness account ID","default":""}},{"name":"orgIdentifier","in":"query","description":"Harness organization ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness organization ID","default":""}},{"name":"projectIdentifier","in":"query","description":"Harness project ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness project ID","default":""}},{"name":"x-api-key","in":"header","description":"Harness PAT key used to perform authorization","allowEmptyValue":true,"schema":{"type":"string","description":"Harness PAT key used to perform authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptRequestBody"}}}},"responses":{"204":{"description":"No Content response."},"400":{"description":"BadRequest: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServer: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGateway: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /api/v1/aida/analyze

> Describe Policy On Basis of rego

```json
{"openapi":"3.0.3","info":{"title":"Governance Policy Management API","version":"1.2.0"},"tags":[{"name":"aida","description":"AIDA API's for Harness OPA"}],"servers":[{"url":"https://app.harness.io/gateway/pm/"}],"security":[{"jwt_header_Authorization":["core_governancePolicy_view"]},{"api_key_header_x-api-key":[]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"},"api_key_header_x-api-key":{"type":"apiKey","description":"Harness PAT","name":"x-api-key","in":"header"}},"schemas":{"AnalyzeRequestBody":{"type":"object","properties":{"entityType":{"type":"string","description":"Type of entity on which rego is written on"},"rego":{"type":"string","description":"Rego Policy"}}},"AnalyzeResponse":{"type":"object","properties":{"desc":{"type":"string","description":"Build identifier"},"status":{"type":"string","description":"status"}},"description":"Description of Policy","required":["status","desc"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?"},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem."},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem."},"name":{"type":"string","description":"Name is the name of this class of errors."},"temporary":{"type":"boolean","description":"Is the error temporary?"},"timeout":{"type":"boolean","description":"Is the error a timeout?"}},"required":["name","id","message","temporary","timeout","fault"]}}},"paths":{"/api/v1/aida/analyze":{"post":{"tags":["aida"],"description":"Describe Policy On Basis of rego","operationId":"aida#analyze","parameters":[{"name":"accountIdentifier","in":"query","description":"Harness account ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness account ID","default":""}},{"name":"orgIdentifier","in":"query","description":"Harness organization ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness organization ID","default":""}},{"name":"projectIdentifier","in":"query","description":"Harness project ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness project ID","default":""}},{"name":"x-api-key","in":"header","description":"Harness PAT key used to perform authorization","allowEmptyValue":true,"schema":{"type":"string","description":"Harness PAT key used to perform authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeRequestBody"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeResponse"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServer: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGateway: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## POST /api/v1/aida/generate

> Generate Policy On Basis of free Text

```json
{"openapi":"3.0.3","info":{"title":"Governance Policy Management API","version":"1.2.0"},"tags":[{"name":"aida","description":"AIDA API's for Harness OPA"}],"servers":[{"url":"https://app.harness.io/gateway/pm/"}],"security":[{"jwt_header_Authorization":["core_governancePolicy_view"]},{"api_key_header_x-api-key":[]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"},"api_key_header_x-api-key":{"type":"apiKey","description":"Harness PAT","name":"x-api-key","in":"header"}},"schemas":{"GenerateRequestBody":{"type":"object","properties":{"policyData":{"type":"string","description":"policySample Data"},"query":{"type":"string","description":"Text query"}}},"PolicySample":{"type":"object","properties":{"policy":{"type":"string","description":"Build identifier"},"status":{"type":"string","description":"status"}},"description":"Sample of Policy","required":["status","policy"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?"},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem."},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem."},"name":{"type":"string","description":"Name is the name of this class of errors."},"temporary":{"type":"boolean","description":"Is the error temporary?"},"timeout":{"type":"boolean","description":"Is the error a timeout?"}},"required":["name","id","message","temporary","timeout","fault"]}}},"paths":{"/api/v1/aida/generate":{"post":{"tags":["aida"],"description":"Generate Policy On Basis of free Text","operationId":"aida#generate","parameters":[{"name":"accountIdentifier","in":"query","description":"Harness account ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness account ID","default":""}},{"name":"orgIdentifier","in":"query","description":"Harness organization ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness organization ID","default":""}},{"name":"projectIdentifier","in":"query","description":"Harness project ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness project ID","default":""}},{"name":"x-api-key","in":"header","description":"Harness PAT key used to perform authorization","allowEmptyValue":true,"schema":{"type":"string","description":"Harness PAT key used to perform authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequestBody"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicySample"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServer: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGateway: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
