Validate Scope
identity.validate_scope
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
Non-goals
- Does not grant or persist scopes
- Does not store authorization policy
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 |
|---|---|---|---|
| requestedScopes | array | Yes | From 0 through 2,000 OAuth-style scope strings compared exactly, in caller order. |
| allowedScopes | array | Yes | From 0 through 2,000 OAuth-style scope strings compared exactly, in caller order. |
| requiredScopes | array | No | From 0 through 2,000 required scopes compared exactly; omit it for none. |
| wildcardMode | string | No | Wildcard policy; omit it for disabled. |
| caseSensitive | boolean | No | Whether comparison is case-sensitive; omit it for true. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | Whether every request is granted and every requirement is met. |
| granted | array | Yes | From 0 through 2,000 granted scopes in request order after the allowlist and requirements. |
| denied | array | Yes | From 0 through 2,000 denied scopes in request order because they were absent from the allowlist. |
| missingRequired | array | Yes | From 0 through 2,000 missing required scopes in policy order. |
| warnings | array | Yes | From 0 through 2,001 bounded warning objects with a stable code and a safe message. |
API contract
POST /v1/executecurl -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"]}}'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
| 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 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)
{
"skillKey": "identity.validate_scope",
"input": {
"allowedScopes": [
"read:user"
],
"requestedScopes": [
"read:user"
]
}
}Examples
Exact allowed scope passes
{
"allowedScopes": [
"read:user"
],
"requestedScopes": [
"read:user"
]
}{
"warnings": [],
"valid": true,
"granted": [
"read:user"
],
"missingRequired": [],
"denied": []
}Unknown scope denied — valid=false
{
"allowedScopes": [
"read:user"
],
"requestedScopes": [
"admin"
]
}{
"warnings": [],
"valid": false,
"granted": [],
"missingRequired": [],
"denied": [
"admin"
]
}Hierarchical wildcard grants a whole read family
{
"requestedScopes": [
"read:user",
"read:org"
],
"requiredScopes": [
"read:user"
],
"allowedScopes": [
"read:*"
],
"wildcardMode": "hierarchical"
}{
"warnings": [
{
"message": "Wildcard mode 'hierarchical' is enabled; scopes may match by pattern.",
"code": "WILDCARD_ENABLED"
}
],
"valid": true,
"granted": [
"read:user",
"read:org"
],
"missingRequired": [],
"denied": []
}Recommended use cases
- 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
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.