v1

latestOpenAPI 3.0.0CoreStack Inc License2026-07-248001,5071.7 MB
Guardrails

Create Policy

Creates a new policy under the tenant which will generate a unique policy id in the response this is can be used to describe details about the policy, update policy, execute or delete policy. However the policy will be accessible based on its scope Account scope - All users under that account will have access to describe and execute. Only Account admins can update/delete. Tenant - Users with access to the specific tenant will have access scripts to describe and execute. Tenant admins can update/delete. Private - User who created will only have access.

post/governance/guardrails/{tenant_id}/policies

Path parameters

tenant_idstring required

Specify the tenant ID. This is a unique ID and can be retrieved using the List Tenants API.

Request body

namestring required

policy name which is unique and does not allow special character or space

display_namestring

Display name of policy which allow space this is to mostly show on the ui

descriptionstring required

A brief explanation of the policy.

typestring[]

Indicates the type of policy

categorystring required

The category will be either service or resource

contentstring required

The policy content

is_system_policyboolean

Flag to identify system policies

engine_type'corestack_policy' | 'aws_organization_policy' | 'azure_policy' | 'aws_config' | 'gcp_organization_policy' | 'gcp_policy' | 'kubernetes_policy' | 'oracle_cloud_guard' required

Engine type of the policy

cloudstring[]

Displays the cloud associated with the policy

classificationstring required

Policies are classified based on the basis of the activity they perform, for example provisioning, Account Management, Utilization, etc. This value is displayed in this field

sub_classificationstring required

Sub classification for policy

scope'private' | 'account' | 'tenant' required

The scope of the policy: Account scope - All users under that account will have access to view and execute Only Account admins can update/delete the policies, Tenant Scope - Users with access to the specific tenant will have access to policies who can describe or execute policies. Tenant admins can only update/delete. Private Scope - User who created will only have access

content_type'git' | 'file' required

Policy content source

content_password_or_keystring

Password or private key to access of Git repo if repo is authenticated required only in case of content type git

content_usernamestring

Username of Git repo if repo is authenticated required only in case of content type git

content_urlstring

Git project URL when the content type is git required only in case of content type git

content_pathstring

Root path of the policy in git repo required only in case of content type git

severity'high' | 'low' | 'medium' required

Severity of policy.

Example request

{
  "engine_type": "corestack_policy",
  "cloud": [
    "AWS"
  ],
  "scope": "private",
  "content_type": "git",
  "severity": "high"
}

Response

Success

policy_idstring required

unique policy Id returned