latestOpenAPI 3.1.02026-08-236994571.1 MB

79928a3d37d3

Policies

Create Policy

Create a new policy.

Example Request:

curl -X POST "http://localhost:4000/policies" \
    -H "Authorization: Bearer <your_api_key>" \
    -H "Content-Type: application/json" \
    -d '{
        "policy_name": "global-baseline",
        "description": "Base guardrails for all requests",
        "guardrails_add": ["pii_masking", "prompt_injection"],
        "guardrails_remove": []
    }'

Example Response:

{
    "policy_id": "123e4567-e89b-12d3-a456-426614174000",
    "policy_name": "global-baseline",
    "inherit": null,
    "description": "Base guardrails for all requests",
    "guardrails_add": ["pii_masking", "prompt_injection"],
    "guardrails_remove": [],
    "condition": null,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z"
}
post/policies

Request body

policy_namestring required

Unique name for the policy.

inheritstring nullable

Name of parent policy to inherit from.

descriptionstring nullable

Human-readable description of the policy.

guardrails_addstring[] nullable

List of guardrail names to add.

guardrails_removestring[] nullable

List of guardrail names to remove (from inherited).

pipelineobject nullable

Optional guardrail pipeline for ordered execution. Contains 'mode' and 'steps'.

Response

Successful Response

policy_idstring required

Unique ID of the policy.

policy_namestring required

Name of the policy.

version_numberinteger

Version number of this policy.

version_statusstring

One of: draft, published, production.

parent_version_idstring nullable

Policy ID this version was cloned from.

is_latestboolean

True if this is the latest version by version_number.

published_atstring date-time nullable

When this version was published.

production_atstring date-time nullable

When this version was promoted to production.

inheritstring nullable

Parent policy name.

descriptionstring nullable

Policy description.

guardrails_addstring[]

Guardrails to add.

guardrails_removestring[]

Guardrails to remove.

conditionobject nullable

Policy condition.

pipelineobject nullable

Optional guardrail pipeline.

created_atstring date-time nullable

When the policy was created.

updated_atstring date-time nullable

When the policy was last updated.

created_bystring nullable

Who created the policy.

updated_bystring nullable

Who last updated the policy.