Validate JWT
security.validate_jwt
Overview
You pass a JWT; we enforce compact JWS structure, reject alg=none and disallowed algorithms, reject unprocessed crit headers fail-closed, validate exp/nbf/iat with configurable clock skew, check issuer and audience, and verify the signature (via Nimbus JOSE+JWT) when you supply JWK/PEM/HMAC key material — refusing asymmetric/HMAC key confusion. trusted=true only when the signature is verified AND required claims pass. We never fetch remote keys (jku/x5u). Do not use this for inspection-only decoding — use security.decode_jwt.
JWTs are easy to decode but dangerous to trust incorrectly — you need a skill that separates parsing, validation, and trust explicitly and fails closed.
Reliability
STRICT and deterministic for a given token, key material, and reference time. trusted=true only when signature verification succeeds and required claims pass. Input validation (not retryable): missing jwt; jwt too long; invalid verificationKey; disallowed algorithm including none; clockSkewSeconds out of range.
Context footprint
Returns compact structured defects instead of prose. A successful call costs 1 execution credit.
When to use it
When you must decide whether a JWT is valid and trusted for auth.
For inspection only — use security.decode_jwt. Do not trust a token without supplying verification key material.
Scope
Non-goals
- Does not fetch remote keys (jku/x5u/JWKS URLs)
- Does not accept alg=none
- Does not process 'crit' critical headers — any 'crit' is rejected fail-closed
- Does not auto-select key type from the token header
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill is designed to detect, mask, redact, validate, or otherwise process sensitive data.
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.
- Targets sensitive data
- The response may contain submitted or transformed 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 |
|---|---|---|---|
| jwt | string | Yes | JWT compact serialization to validate. |
| expectedIssuer | string | No | Required issuer (iss) to match; omit it to skip the issuer check. |
| expectedAudience | object | No | Expected audience as one string or an array of strings; omit it to skip the audience check. The token passes when aud matches any listed value. |
| allowedAlgorithms | array | No | JWS algorithms you accept, 1 to 12 names; omit it for the twelve signed defaults. none is rejected. |
| verificationKey | object | No | Closed signature key with type, serialized value and optional kid; omit it to validate claims with trusted remaining false. |
| clockSkewSeconds | integer | No | Allowed clock skew from 0 through 600 seconds; omit it for 60. |
| requireExpiration | boolean | No | Whether a missing exp claim fails; omit it for true. |
| nowEpochSeconds | integer | No | Reference time in epoch seconds for exp/nbf/iat; omit it to use the current time. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | True when structure, algorithm, timing claims and any issuer or audience you asked for all pass. |
| trusted | boolean | Yes | True only when valid is true and the signature was verified with the key you supplied. |
| signatureVerified | boolean | Yes | True only when the signature check ran against your verificationKey and matched. |
| header | object | Yes | Purpose-bound JSON object copied from one JWT segment, with at most 10000 properties — unconstrained RFC 8259 JSON items. |
| claims | object | Yes | Purpose-bound JSON object copied from one JWT segment, with at most 10000 properties — unconstrained RFC 8259 JSON items. |
| defects | array | Yes | Everything noticed, each a closed {code, severity, message} object; empty only when nothing was noted. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"security.validate_jwt","input":{"jwt":"eyJhbGciOiJIUzI1NiJ9..."}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("security.validate_jwt", {"jwt":"eyJhbGciOiJub25lIn0.eyJzdWIiOiIxIn0."});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 fetch remote keys (jku/x5u/JWKS URLs)
- Does not accept alg=none
- Does not process 'crit' critical headers — any 'crit' is rejected fail-closed
- Does not auto-select key type from the token header
- Discovering keys from the token itself
- Trusting a token without providing verification key material
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "security.validate_jwt",
"input": {
"jwt": "eyJhbGciOiJub25lIn0.eyJzdWIiOiIxIn0."
}
}Examples
Reject alg=none
{
"jwt": "eyJhbGciOiJub25lIn0.eyJzdWIiOiIxIn0."
}{
"trusted": false,
"claims": {
"sub": "1"
},
"valid": false,
"header": {
"alg": "none"
},
"defects": [
{
"code": "ALG_NONE",
"severity": "error",
"message": "Unsecured JWT (alg=none) is rejected. Signed tokens only."
},
{
"code": "MISSING_EXP",
"severity": "error",
"message": "Required 'exp' claim is missing."
},
{
"code": "SIGNATURE_NOT_CHECKED",
"severity": "info",
"message": "No verification key provided; signature was not checked. trusted=false."
}
],
"signatureVerified": false
}Parse without verification key
{
"jwt": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0In0.abc",
"requireExpiration": false
}{
"trusted": false,
"claims": {
"sub": "1234"
},
"valid": true,
"header": {
"alg": "HS256"
},
"defects": [
{
"code": "SIGNATURE_NOT_CHECKED",
"severity": "info",
"message": "No verification key provided; signature was not checked. trusted=false."
}
],
"signatureVerified": false
}Recommended use cases
- Verify a JWT against a known public key or HMAC secret
- Check token expiry, audience, and issuer in an auth flow
Avoid for
- Discovering keys from the token itself
- Trusting a token without providing verification key material
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.