{"openapi":"3.1.0","info":{"title":"HCP Terraform Policies (BYOK) API","version":"0.1.0","description":"HCP Terraform Policies (BYOK) lets an AI assistant read your own HCP Terraform Policies data through the HCP Terraform Policies API with a key you supply (user, team or organization API token). Read-only: 6 tools (list_policies, get_policy, list_policy_sets, get_policy_set, list_run_policy_checks, get_policy_check). The BYOK key travels with each request, is used for that one call only and is...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-hcp-terraform-policies.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-hcp-terraform-policies/docs"},"termsOfService":"https://connectorbay.com/byok-hcp-terraform-policies/terms"},"servers":[{"url":"https://byok-hcp-terraform-policies.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-hcp-terraform-policies/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_policies":{"post":{"operationId":"list_policies","summary":"List an organization's Sentinel and OPA policies with kind, enforcement level and how many policy sets use each. Use for","description":"List an organization's Sentinel and OPA policies with kind, enforcement level and how many policy sets use each. Use for \"Which policies are defined in my HCP Terraform organization\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"organization":{"description":"HCP Terraform organization name, as returned by list_organizations in the HCP Terraform connector.","maxLength":100,"title":"Organization","type":"string"},"search_name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only policies whose name matches this text.","title":"Search Name"},"kind":{"anyOf":[{"enum":["sentinel","opa"],"type":"string"},{"type":"null"}],"default":null,"description":"Only policies of this kind.","title":"Kind"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"Items per page (1 to 100, default 20).","title":"Page Size"},"page_number":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page Number"}},"required":["organization"],"title":"list_policiesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_policy":{"post":{"operationId":"get_policy","summary":"Get one policy: kind, enforcement level and mode, and number of policy sets using it. The policy source code is not retu","description":"Get one policy: kind, enforcement level and mode, and number of policy sets using it. The policy source code is not returned. Use for \"Show settings of HCP Terraform policy pol-oXUppaX2ximkqp8w\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"policy_id":{"description":"Policy id (pol-...), as returned by list_policies.","maxLength":60,"title":"Policy Id","type":"string"}},"required":["policy_id"],"title":"get_policyArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_policy_sets":{"post":{"operationId":"list_policy_sets","summary":"List an organization's policy sets with kind, whether they are global or VCS-managed, tool version and workspace counts.","description":"List an organization's policy sets with kind, whether they are global or VCS-managed, tool version and workspace counts. Use for \"What policy sets does my HCP Terraform organization have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"organization":{"description":"HCP Terraform organization name, as returned by list_organizations in the HCP Terraform connector.","maxLength":100,"title":"Organization","type":"string"},"search_name":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only policy sets whose name matches this text.","title":"Search Name"},"kind":{"anyOf":[{"enum":["sentinel","opa"],"type":"string"},{"type":"null"}],"default":null,"description":"Only policy sets of this kind.","title":"Kind"},"versioned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True for only versioned (VCS or API managed) sets, false for sets built from individual policies.","title":"Versioned"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"Items per page (1 to 100, default 20).","title":"Page Size"},"page_number":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page Number"}},"required":["organization"],"title":"list_policy_setsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_policy_set":{"post":{"operationId":"get_policy_set","summary":"Get one policy set with kind, global flag, policy count, workspace count, VCS source and tool version. Use for \"Show HCP","description":"Get one policy set with kind, global flag, policy count, workspace count, VCS source and tool version. Use for \"Show HCP Terraform policy set polset-3yVQZvHzf5j3WRJ1\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"policy_set_id":{"description":"Policy set id (polset-...), as returned by list_policy_sets.","maxLength":60,"title":"Policy Set Id","type":"string"}},"required":["policy_set_id"],"title":"get_policy_setArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_run_policy_checks":{"post":{"operationId":"list_run_policy_checks","summary":"List the policy checks of one run with status (passed, soft_failed, hard_failed ...), scope and counts of failed policie","description":"List the policy checks of one run with status (passed, soft_failed, hard_failed ...), scope and counts of failed policies. Use for \"Did the policies pass for HCP Terraform run run-veDoQbv6xh6TbnJD\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"run_id":{"description":"Run id (run-...), as returned by list_workspace_runs in the HCP Terraform connector.","maxLength":60,"title":"Run Id","type":"string"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"Items per page (1 to 100, default 20).","title":"Page Size"},"page_number":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"Page number, starting at 1.","title":"Page Number"}},"required":["run_id"],"title":"list_run_policy_checksArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_policy_check":{"post":{"operationId":"get_policy_check","summary":"Get one policy check: status, scope, pass and fail counts and timestamps. Use for \"Show HCP Terraform policy check polch","description":"Get one policy check: status, scope, pass and fail counts and timestamps. Use for \"Show HCP Terraform policy check polchk-9VYRc9bpfJEsnwum\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"policy_check_id":{"description":"Policy check id (polchk-...), as returned by list_run_policy_checks.","maxLength":60,"title":"Policy Check Id","type":"string"}},"required":["policy_check_id"],"title":"get_policy_checkArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}