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
Human-readable name for the policy.
Whether this policy allows or denies matching requests.
Evaluation priority. Higher-priority policies are evaluated first. Defaults to server-assigned value.
Restrict the policy to a specific agent.
Restrict the policy to a specific user.
The scopes this policy applies to. If omitted, the policy applies to all scopes.
Start time for a time-of-day restriction (24h format, e.g.
'09:00').End time for a time-of-day restriction (24h format, e.g.
'18:00').Response: Policy
Unique policy identifier.
Policy name.
'allow' or 'deny'.Evaluation priority.
Restricted agent ID, or
null for all agents.Restricted user ID, or
null for all users.Restricted scopes, or
null for all scopes.Time-of-day restriction start (24h format).
Time-of-day restriction end (24h format).
ISO 8601 creation timestamp.
ISO 8601 last-updated timestamp.
policies.list()
List all policies for your organization.Response: ListPoliciesResponse
Array of policy objects.
Total number of policies.
policies.get()
Retrieve a single policy by its ID.Parameters
The policy ID to retrieve.
Response
Returns aPolicy object.
policies.update()
Update an existing policy. Only the provided fields are modified.Parameters
The policy ID to update.
New policy name.
New effect.
New priority.
New agent restriction. Pass
null to clear.New user restriction. Pass
null to clear.New scope restriction. Pass
null to clear.New time-of-day start. Pass
null to clear.New time-of-day end. Pass
null to clear.Response
Returns the updatedPolicy object.
policies.delete()
Delete a policy.Parameters
The policy ID to delete.
Response
Returnsvoid.