Create a policy rule
Rules
Create a policy rule
Creates a new policy rule. Rules control how agents interact with external services:
- block — reject matching requests outright.
- rate_limit — allow up to N requests per time window. Requires
rateLimitandrateLimitWindow. - manual_approval — hold matching requests for human approval before forwarding.
POST
Create a policy rule
Documentation Index
Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
API key obtained from the dashboard or GET /user/api-key
Body
application/json
Required string length:
1 - 255Example:
"Block destructive GitHub API calls"
Required string length:
1 - 1000Example:
"api.github.com"
Available options:
block, rate_limit, manual_approval Maximum string length:
1000Example:
"/repos/*/delete"
Available options:
GET, POST, PUT, PATCH, DELETE Scope rule to a specific agent (omit for all agents)
Required when action is rate_limit
Required range:
1 <= x <= 1000000Required when action is rate_limit
Available options:
minute, hour, day Maximum array length:
10Response
Rule created
Available options:
GET, POST, PUT, PATCH, DELETE, null Available options:
block, rate_limit, manual_approval Available options:
minute, hour, day, null