Skip to main content

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

MicroSkills Reference

Validate Scope

identity.validate_scope

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

Overview

You send requested scopes, an allowed list, and optional required scopes; we return granted, denied, and missing-required separately so authorization is explainable. Comparison is exact and fail-closed — wildcards are disabled unless you set wildcardMode to suffix or hierarchical. Do not use this to persist grants or store policy long term.

Scope checks written inline tend to drift into "starts with admin" and quietly hand out more than intended. Here matching is exact until you say otherwise, and you get the granted, denied and missing lists separately so the decision is easy to log and easy to explain.

Reliability

Same lists and same options, same answer — nothing is stored, nothing is granted, and a scope that is not in your allowlist is never inferred from one that is. A denial is a normal success with valid false, so branch on valid rather than on your error path. Turning wildcardMode on widens matching in ways that are easy to underestimate, which is why we always add a WILDCARD_ENABLED warning: under suffix a trailing * is a plain prefix match, so "read:*" also grants "read:user:secret", while hierarchical matches segment by segment on : and . boundaries. We reject the call itself when requestedScopes or allowedScopes is missing, when any of the three lists is not an array of strings or holds more than 2000 entries, when wildcardMode is not disabled, suffix or hierarchical, or when caseSensitive is not a boolean; retrying the same payload will not change the outcome.

Context footprint

Compact granted, denied, and missing-required breakdown. A successful call costs 1 execution credit.

When to use it

Before you issue a token or authorize a call, when you have the requested scopes and the policy in hand and want them compared without surprises.

When you need to store the grant, version the policy, or decide access from roles or resource attributes rather than scope strings.

Scope

Note
Checks requested scopes against an allowlist and optional required set.

Non-goals

  • Does not grant or persist scopes
  • Does not store authorization policy

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

validation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input250 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
requestedScopesarrayYesFrom 0 through 2,000 OAuth-style scope strings compared exactly, in caller order.
allowedScopesarrayYesFrom 0 through 2,000 OAuth-style scope strings compared exactly, in caller order.
requiredScopesarrayNoFrom 0 through 2,000 required scopes compared exactly; omit it for none.
wildcardModestringNoWildcard policy; omit it for disabled.
caseSensitivebooleanNoWhether comparison is case-sensitive; omit it for true.

Output schema

FieldTypeRequiredDescription
validbooleanYesWhether every request is granted and every requirement is met.
grantedarrayYesFrom 0 through 2,000 granted scopes in request order after the allowlist and requirements.
deniedarrayYesFrom 0 through 2,000 denied scopes in request order because they were absent from the allowlist.
missingRequiredarrayYesFrom 0 through 2,000 missing required scopes in policy order.
warningsarrayYesFrom 0 through 2,001 bounded warning objects with a stable code and a safe message.

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.validate_scope","input":{"requestedScopes":["read:user"],"allowedScopes":["read:user"]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("identity.validate_scope", {"allowedScopes":["read:user"],"requestedScopes":["read:user"]});

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 grant or persist scopes
  • Does not store authorization policy
  • Storing authorization decisions or policy versions
  • Assuming wildcard patterns unless you explicitly enable wildcardMode

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "identity.validate_scope",
  "input": {
    "allowedScopes": [
      "read:user"
    ],
    "requestedScopes": [
      "read:user"
    ]
  }
}

Examples

Exact allowed scope passes

Inputjson
{
  "allowedScopes": [
    "read:user"
  ],
  "requestedScopes": [
    "read:user"
  ]
}
Expected outputjson
{
  "warnings": [],
  "valid": true,
  "granted": [
    "read:user"
  ],
  "missingRequired": [],
  "denied": []
}

Unknown scope denied — valid=false

Inputjson
{
  "allowedScopes": [
    "read:user"
  ],
  "requestedScopes": [
    "admin"
  ]
}
Expected outputjson
{
  "warnings": [],
  "valid": false,
  "granted": [],
  "missingRequired": [],
  "denied": [
    "admin"
  ]
}

Hierarchical wildcard grants a whole read family

Inputjson
{
  "requestedScopes": [
    "read:user",
    "read:org"
  ],
  "requiredScopes": [
    "read:user"
  ],
  "allowedScopes": [
    "read:*"
  ],
  "wildcardMode": "hierarchical"
}
Expected outputjson
{
  "warnings": [
    {
      "message": "Wildcard mode 'hierarchical' is enabled; scopes may match by pattern.",
      "code": "WILDCARD_ENABLED"
    }
  ],
  "valid": true,
  "granted": [
    "read:user",
    "read:org"
  ],
  "missingRequired": [],
  "denied": []
}
  • Pre-flight OAuth scope checks before you issue a token
  • Validate an agent's requested scopes against tenant policy
  • Explain which scopes were denied and which required scopes are missing

Avoid for

  • Storing authorization decisions or policy versions
  • Assuming wildcard patterns unless you explicitly enable wildcardMode

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