Overview
Thepolicies sub-client lets you create declarative authorization policies that control when and how agents can use their grants. Policies support scope-based rules, time-of-day restrictions, and priority-based evaluation.
policies.create()
Create a new authorization policy.Parameters
string
required
Human-readable name for the policy.
'allow' | 'deny'
required
Whether this policy allows or denies matching requests.
number
Evaluation priority. Higher-priority policies are evaluated first. Defaults to server-assigned value.
string
Restrict the policy to a specific agent.
string
Restrict the policy to a specific user.
string[]
The scopes this policy applies to. If omitted, the policy applies to all scopes.
string
Start time for a time-of-day restriction (24h format, e.g.
'09:00').string
End time for a time-of-day restriction (24h format, e.g.
'18:00').Response: Policy
string
Unique policy identifier.
string
Policy name.
string
'allow' or 'deny'.number
Evaluation priority.
string | null
Restricted agent ID, or
null for all agents.string | null
Restricted user ID, or
null for all users.string[] | null
Restricted scopes, or
null for all scopes.string | null
Time-of-day restriction start (24h format).
string | null
Time-of-day restriction end (24h format).
string
ISO 8601 creation timestamp.
string
ISO 8601 last-updated timestamp.
policies.list()
List all policies for your organization.Response: ListPoliciesResponse
Policy[]
Array of policy objects.
number
Total number of policies.
policies.get()
Retrieve a single policy by its ID.Parameters
string
required
The policy ID to retrieve.
Response
Returns aPolicy object.
policies.update()
Update an existing policy. Only the provided fields are modified.Parameters
string
required
The policy ID to update.
string
New policy name.
'allow' | 'deny'
New effect.
number
New priority.
string | null
New agent restriction. Pass
null to clear.string | null
New user restriction. Pass
null to clear.string[] | null
New scope restriction. Pass
null to clear.string | null
New time-of-day start. Pass
null to clear.string | null
New time-of-day end. Pass
null to clear.Response
Returns the updatedPolicy object.
policies.delete()
Delete a policy.Parameters
string
required
The policy ID to delete.
Response
Returnsvoid.