Evaluate RBAC
identity.evaluate_rbac
Overview
You pass a subject with roles, an action, a resource, and an explicit role→permission policy; we evaluate it deterministically and fail closed. Permissions come only from the policy map — role names never imply access. Wildcards match only when you set allowWildcard to true. We return the decision, matched roles and permissions, and a plain explanation. Do not use this for attribute-based rules or as a policy store.
A boolean answer tells you nothing when someone asks why access was granted. Here every allow names the role and the exact permission string behind it, and a role that is not in your policy grants nothing, however privileged its name sounds.
Reliability
Same roles and same policy, same verdict — we read no clock, no network and no stored policy, and a role name on its own never implies a grant. We fail closed: a missing policy object, a rolePermissions that is not an object, or a role key that is not a string all come back as a normal success with decision "deny", empty matched lists, and an explanation naming the problem, so watch decision rather than your error path. Permission strings without a colon are skipped in silence and can never grant, and * matches only when you set allowWildcard to true. Bad input is rejected instead of evaluated — a missing or non-string action or resource, a subject that is not an object, a subject.roles that is not an array of strings, a defaultDecision other than deny or allow, or a non-boolean allowWildcard. Retrying the same payload will not change any of these; fix the payload and call again.
Context footprint
Returns decision, matched roles, matched permissions, and explanation in one auditable pass. A successful call costs 1 execution credit.
When to use it
When access depends on roles alone and you can write the grants as action:resource strings in a policy map you supply on each call.
When the answer depends on attributes of the resource or the request, such as ownership, time of day or record status.
Scope
Non-goals
- Does not store or version policies
- Does not infer permissions from role names alone
- Does not evaluate attribute-based conditions
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| subject | object | Yes | Purpose-bound caller attributes object; roles is evaluated and other bounded keys are ignored. |
| action | string | Yes | Bounded RBAC identifier. |
| resource | string | Yes | Bounded RBAC identifier. |
| policy | object | Yes | Closed role grant policy mapping each role name to the permission strings it confers. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| decision | string | Yes | Fail-closed access verdict. |
| matchedRoles | array | Yes | From 0 through 2,000 matched role names in subject order, each a role string the subject actually held. |
| matchedPermissions | array | Yes | From 0 through 10,000 matching grant receipts, each a closed role, permission and how it matched. |
| explanation | string | Yes | Safe decision explanation. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"identity.evaluate_rbac","input":{"subject":{"id":"u1","roles":["admin"]},"action":"delete","resource":"doc","policy":{"rolePermissions":{"admin":["delete:doc"]}}}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("identity.evaluate_rbac", {"subject":{"id":"u1","roles":["admin"]},"action":"delete","resource":"doc","policy":{"rolePermissions":{"admin":["delete:doc"]}}});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not store or version policies
- Does not infer permissions from role names alone
- Does not evaluate attribute-based conditions
- Attribute-based access (use identity.evaluate_abac)
- Persisting authorization decisions
- Assuming a role name grants access without an explicit policy entry
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "identity.evaluate_rbac",
"input": {
"subject": {
"id": "u1",
"roles": [
"admin"
]
},
"action": "delete",
"resource": "doc",
"policy": {
"rolePermissions": {
"admin": [
"delete:doc"
]
}
}
}
}Examples
Admin role grants delete on a document
{
"subject": {
"id": "u1",
"roles": [
"admin"
]
},
"action": "delete",
"resource": "doc",
"policy": {
"rolePermissions": {
"admin": [
"delete:doc"
]
}
}
}{
"decision": "allow",
"matchedPermissions": [
{
"action": "delete",
"resource": "doc",
"role": "admin"
}
],
"matchedRoles": [
"admin"
],
"explanation": "Allowed by 1 matching permission(s)."
}User role has no matching permission — default deny
{
"subject": {
"id": "u1",
"roles": [
"user"
]
},
"action": "delete",
"resource": "doc",
"policy": {
"rolePermissions": {
"admin": [
"delete:doc"
]
},
"defaultDecision": "deny"
}
}{
"decision": "deny",
"matchedPermissions": [],
"matchedRoles": [],
"explanation": "No matching permission; default decision 'deny' applied."
}Recommended use cases
- Explainable permission checks before you enforce access in your app
- Preview whether a role grants a specific action on a resource
- Audit which role and permission string matched an allow decision
Avoid for
- Attribute-based access (use identity.evaluate_abac)
- Persisting authorization decisions
- Assuming a role name grants access without an explicit policy entry
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.