APIPolicies

Create policy

Create a policy.

POST/policies

Create a policy.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

One rule in the ordered list that decides which tools an agent may call, for which users, under what conditions. Rules are evaluated top to bottom and the first match wins; a request that matches no rule is denied by default.

Response Body

application/json

application/json

curl -X POST "https://example.com/policies" \  -H "Content-Type: application/json" \  -d '{    "tool_patterns": [      "string"    ],    "effect": "allow",    "name": "string"  }'
{  "id": null,  "priority": 0,  "mcp_ids": [    "c2c9208c-a7ac-41cc-84f1-8c1caec92987"  ],  "agent_slugs": [    "string"  ],  "agent_instance_ids": [    "bc3f18ff-0dcd-4cc7-8f61-6ca61814f10b"  ],  "user_ids": [    "2d98503d-4ab4-41bd-8fc6-78cc006fd2db"  ],  "groups": [    "string"  ],  "agent_slug_tag_ids": [    "e428595a-d9dd-4887-8327-2d9cad5b7425"  ],  "mcp_tag_ids": [    "17d4a46c-d971-4171-9a66-88ec59ce6eeb"  ],  "tool_tag_ids": [    "41068329-9b4f-4cc3-b249-3ec2a7a2cee8"  ],  "condition": "string",  "condition_description": "string",  "tool_patterns": [    "string"  ],  "effect": "allow",  "status": "active",  "name": "string",  "description": "string",  "agent_instance_refs": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "display_name": "string"    }  ],  "user_refs": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "display_name": "string"    }  ],  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
{  "code": "bad_request",  "message": "string",  "validation_errors": [    {      "field": "string",      "message": "string",      "rule": "string"    }  ]}