Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Evaluate RBAC

identity.evaluate_rbac

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

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

Note
Evaluates a role-based allow/deny decision from an explicit policy you supply.

Non-goals

  • Does not store or version policies
  • Does not infer permissions from role names alone
  • Does not evaluate attribute-based conditions

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisvalidation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input256 KB

How we handle your data

Sensitive input, safe output
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
subjectobjectYesPurpose-bound caller attributes object; roles is evaluated and other bounded keys are ignored.
actionstringYesBounded RBAC identifier.
resourcestringYesBounded RBAC identifier.
policyobjectYesClosed role grant policy mapping each role name to the permission strings it confers.

Output schema

FieldTypeRequiredDescription
decisionstringYesFail-closed access verdict.
matchedRolesarrayYesFrom 0 through 2,000 matched role names in subject order, each a role string the subject actually held.
matchedPermissionsarrayYesFrom 0 through 10,000 matching grant receipts, each a closed role, permission and how it matched.
explanationstringYesSafe decision explanation.

API contract

POST /v1/execute
curl
curl -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"]}}}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "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

Inputjson
{
  "subject": {
    "id": "u1",
    "roles": [
      "admin"
    ]
  },
  "action": "delete",
  "resource": "doc",
  "policy": {
    "rolePermissions": {
      "admin": [
        "delete:doc"
      ]
    }
  }
}
Expected outputjson
{
  "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

Inputjson
{
  "subject": {
    "id": "u1",
    "roles": [
      "user"
    ]
  },
  "action": "delete",
  "resource": "doc",
  "policy": {
    "rolePermissions": {
      "admin": [
        "delete:doc"
      ]
    },
    "defaultDecision": "deny"
  }
}
Expected outputjson
{
  "decision": "deny",
  "matchedPermissions": [],
  "matchedRoles": [],
  "explanation": "No matching permission; default decision 'deny' applied."
}
  • 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

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.

Tags

securityvalidationidentity