Skip to main content

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

MicroSkills Reference

Validate CSP

security.validate_csp

ProductionBounded custom (Class B)Deterministicverifiableinstantv1.0.0
No network

Overview

You pass a Content-Security-Policy header value; we parse it and return structured diagnostics — duplicate directives, unknown directives, risky sources (wildcards, unsafe-inline/eval, insecure schemes), unquoted keywords, and missing protections. We never fetch external sources. Do not use this to generate a policy (use security.generate_csp) or as proof of browser enforcement.

When you review web security, you need actionable CSP defects — not vague advice from an agent guessing at header semantics.

Reliability

VERIFIABLE and deterministic: the same header and profile always give you the same defects. We recognize the directive vocabulary of W3C CSP Level 3, so a newer directive may come back as UNKNOWN_DIRECTIVE. Risk scoring reads tokens; it does not model what a browser enforces, so a low riskLevel is a clean bill on the text you sent and nothing more. Input validation (not retryable): headerValue missing or not a string; header longer than 32768 characters; profile other than strict, balanced or legacy; maxDefects outside 1 to 1000.

Context footprint

Structured defects replace prose security review. A successful call costs 1 execution credit.

When to use it

When you audit or review a CSP header during development or CI.

When you need to generate a new policy — use security.generate_csp.

Scope

Note
Parses and risk-classifies a CSP header value with actionable defects.

Non-goals

  • Does not fetch external sources
  • Does not fix the policy
  • validSyntax + a low riskLevel is not proof of protection — real enforcement is browser behavior, which this token-level analyzer does not model

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 input32 KB

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

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 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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
headerValuestringYesCSP header value without its name.
profilestringNoRisk profile; omit it for balanced.
maxDefectsintegerNoDefect cap; omit it for 200.

Output schema

FieldTypeRequiredDescription
validSyntaxbooleanYesWhether the header is structurally valid.
riskLevelstringYesOverall token-level risk.
directivesobjectYesPurpose-bound parsed map from directive names to source-token arrays.
defectsarrayYesFrom 0 through 1,000 bounded CSP defects, each with a stable code, severity, and 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":"security.validate_csp","input":{"headerValue":"default-src ''self''"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("security.validate_csp", {"headerValue":"script-src * 'unsafe-inline'"});

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 fetch external sources
  • Does not fix the policy
  • validSyntax + a low riskLevel is not proof of protection — real enforcement is browser behavior, which this token-level analyzer does not model
  • Generating a policy (use security.generate_csp)

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "security.validate_csp",
  "input": {
    "headerValue": "script-src * 'unsafe-inline'"
  }
}

Examples

Risky script-src policy

Inputjson
{
  "headerValue": "script-src * 'unsafe-inline'"
}
Expected outputjson
{
  "directives": {
    "script-src": [
      "*",
      "'unsafe-inline'"
    ]
  },
  "riskLevel": "critical",
  "validSyntax": true,
  "defects": [
    {
      "code": "WILDCARD_SOURCE",
      "severity": "high",
      "directive": "script-src",
      "message": "Wildcard source '*' in 'script-src' is overly permissive."
    },
    {
      "code": "UNSAFE_INLINE",
      "severity": "high",
      "directive": "script-src",
      "message": "'unsafe-inline' in 'script-src' permits inline scripts/styles."
    },
    {
      "code": "MISSING_DEFAULT_SRC",
      "severity": "medium",
      "directive": "default-src",
      "message": "No 'default-src' fallback; unlisted resource types are unrestricted."
    },
    {
      "code": "MISSING_FRAME_ANCESTORS",
      "severity": "medium",
      "directive": "frame-ancestors",
      "message": "No 'frame-ancestors'; clickjacking protection relies on X-Frame-Options only."
    }
  ]
}

Strict profile passes

Inputjson
{
  "headerValue": "default-src 'none'; script-src 'self'; frame-ancestors 'none'; object-src 'none'",
  "profile": "strict"
}
Expected outputjson
{
  "directives": {
    "object-src": [
      "'none'"
    ],
    "default-src": [
      "'none'"
    ],
    "frame-ancestors": [
      "'none'"
    ],
    "script-src": [
      "'self'"
    ]
  },
  "riskLevel": "low",
  "validSyntax": true,
  "defects": []
}
  • Audit a CSP header during a security review
  • Gate CSP changes in CI

Avoid for

  • Generating a policy (use security.generate_csp)

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

securityvalidationcsp