Check whether a principal may perform an action
Evaluates one action for a member, service account or key of the organization and returns the decision, the layer that decided it and the deciding policies.
Required permission
Requires the policy.read permission. See Permissions for the roles and API key permissions that include it.
Command line
The orl CLI wraps this endpoint:
orl authz check-access --action <action> --principal-id <principal-id> --principal-type <principal-type>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
application/json- body
principalType*string"member""service_account""api_key"principalId*stringA user id, service account id or API key id of this organization.
action*stringAn action from the catalog, e.g. compute.create.
model?stringThe model to check for inference.invoke.
endpointId?stringThe dedicated endpoint the model is served on.
sourceIp?stringEvaluate as if the request came from this address. Defaults to yours.
The decision
application/json- response
allow*booleanpermission*stringdeniedBy?string"role""key""org_policy""platform"message*stringpolicies*array<>curl -X POST 'https://api.openrelay.inc/v1/authz/check' \ -H 'Content-Type: application/json' \ -d '{ "principalType": "member", "principalId": "string", "action": "string"}'{ "allow": true, "permission": "string", "deniedBy": "role", "message": "string", "policies": [ { "id": "string", "source": "platform" } ]}Show what a principal can do right now GET
Returns the permission ids and actions a member, service account or API key holds right now, and the models it may call, after its restrictions apply. Without parameters, answers for the caller. Naming a member, service account or key of the organization needs policy.read. The answer is the principal's role intersected with its key restrictions, role conditions and the organization's guardrails. Network rules are checked against the address of the request you send, not one the named principal would call from.
List the org's guardrails and custom policies GET
Returns every guardrail and custom Cedar policy in the organization, enabled or disabled, with its networks, models, endpoints and Cedar text.