Skip to main content

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

MicroSkills Reference

Validate Upload Constraints

file.validate_upload_constraints

ProductionBounded custom (Class B)Deterministicstrictmoderatev1.0.0
File inputNo network

Overview

You pass managed file references and a declarative upload policy; we resolve each file's size, content-detected MIME type, extension, and optional SHA-256, then report per-file findings and an overall valid flag. We never trust caller-supplied MIME metadata. This is policy enforcement only — a valid result does not certify absence of malware. Do not use this for archive extraction or malware scanning.

Upload validation must rely on content we resolve — not MIME types or sizes your client claims.

Reliability

Deterministic for a fixed policy and fixed files, and safe to retry — we only read. A policy rejection is not an error: the call succeeds with valid:false and the reasons in findings, so read valid rather than the HTTP status. Those codes are UPLOAD_FILE_TOO_LARGE, UPLOAD_FILE_TOO_SMALL, UPLOAD_MIME_NOT_ALLOWED, UPLOAD_EXTENSION_NOT_ALLOWED, UPLOAD_MIME_EXTENSION_MISMATCH, UPLOAD_FILENAME_INVALID, UPLOAD_FILE_COUNT_INVALID, UPLOAD_TOTAL_SIZE_EXCEEDED, UPLOAD_DUPLICATE_CONTENT, UPLOAD_ARCHIVE_FORBIDDEN, and FILE_REF_NOT_FOUND. That last one is worth calling out: a reference resolves only inside your own tenant, so one that has expired or was never yours is reported per file as FILE_REF_NOT_FOUND with valid:false rather than failing the whole call, and the fix is to upload the file again and revalidate. Sending more than 1,000 files, or an entry without ref, is a validation error instead — correct the request before you retry. A valid:true verdict means the policy passed; it is not a malware verdict.

Context footprint

Returns per-file resolved facts, aggregate totals, policyDigest, and findings. A successful call costs 1 execution credit.

When to use it

Before running a workflow on uploaded managed files.

When you need malware scanning or archive extraction.

Uses the platform's content-based MIME detection and streaming SHA-256.

Scope

Note
Validates managed files against a declarative upload policy using resolved facts.

Non-goals

  • No malware scanning
  • No archive extraction
  • No network fetch
  • Does not certify legal or compliance approval beyond your supplied constraints

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 input1 KBMax file size1 GB

File limits

Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.

LimitValueLimited by
Maximum size per input file50 MiBPlatform maximum

How we handle your data

Protected temp storage
What this means

This skill may temporarily store files or intermediate data only to complete execution. Temporary data is protected and automatically deleted.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Temporary execution only storage
  • 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
filesarrayYesBounded array of 1 through 1000 closed upload candidates with ref and logicalName.
constraintsobjectYesClosed upload policy of size, MIME, extension, duplicate, archive, and filename rules.
optionsobjectNoClosed optional evaluation knobs; omit the object to compute SHA-256, continue after failures, and cap findings at 1000.

Output schema

FieldTypeRequiredDescription
validbooleanYesTrue when every file and aggregate check passed.
filesarrayYesBounded array of 1 through 1000 closed per-file verdicts in input order.
aggregateobjectYesClosed aggregate counts and policy-level findings with accepted, rejected and total bytes.
policyDigeststringYesFirst 16 hex characters of the SHA-256 of the constraints object.
_metaobjectNoClosed provenance naming the validator rule set that produced these findings.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"file.validate_upload_constraints","input":{"files":[{"ref":"squillify://files/f-1","logicalName":"a.txt"}],"constraints":{"maxBytesPerFile":100}}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("file.validate_upload_constraints", {"constraints":{"maxBytesPerFile":100},"files":[{"ref":"squillify://files/f-1","logicalName":"a.txt"}]});

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

  • No malware scanning
  • No archive extraction
  • No network fetch
  • Does not certify legal or compliance approval beyond your supplied constraints
  • Malware or virus scanning
  • Unpacking ZIP archives (use file.safe_extract_archive after policy pass)

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "file.validate_upload_constraints",
  "input": {
    "constraints": {
      "maxBytesPerFile": 100
    },
    "files": [
      {
        "ref": "squillify://files/f-1",
        "logicalName": "a.txt"
      }
    ]
  }
}

Examples

Text file within a generous per-file size cap

Inputjson
{
  "constraints": {
    "maxBytesPerFile": 100
  },
  "files": [
    {
      "ref": "squillify://files/f-1",
      "logicalName": "a.txt"
    }
  ]
}
Expected outputjson
{
  "valid": true,
  "_meta": {
    "validatorProfile": "upload-constraints-1"
  },
  "policyDigest": "c8993d83af6ed71d",
  "files": [
    {
      "findings": [],
      "valid": true,
      "extension": "txt",
      "size": 5,
      "index": 0,
      "logicalName": "a.txt",
      "detectedMime": "text/plain",
      "sha256": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"
    }
  ],
  "aggregate": {
    "fileCount": 1,
    "policyFindings": [],
    "totalBytes": 5
  }
}

File exceeds maxBytesPerFile — valid:false with finding

Inputjson
{
  "constraints": {
    "maxBytesPerFile": 3
  },
  "files": [
    {
      "ref": "squillify://files/f-2",
      "logicalName": "big.txt"
    }
  ]
}
Expected outputjson
{
  "valid": false,
  "_meta": {
    "validatorProfile": "upload-constraints-1"
  },
  "policyDigest": "9eb4df2ed85b97f1",
  "files": [
    {
      "findings": [
        {
          "code": "UPLOAD_FILE_TOO_LARGE",
          "message": "file exceeds max bytes: big.txt",
          "severity": "error"
        }
      ],
      "valid": false,
      "extension": "txt",
      "size": 10,
      "index": 0,
      "logicalName": "big.txt",
      "detectedMime": "text/plain",
      "sha256": "84d89877f0d4041efb6bf91a16f0248f2fd573e6af05c19f96bedb9f882f7882"
    }
  ],
  "aggregate": {
    "fileCount": 1,
    "policyFindings": [],
    "totalBytes": 10
  }
}
  • Gate uploads before a downstream workflow runs
  • Enforce MIME, extension, size, and filename rules you declare
  • Detect duplicate content when allowDuplicateContent is false

Avoid for

  • Malware or virus scanning
  • Unpacking ZIP archives (use file.safe_extract_archive after policy pass)

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

uploadvalidationfile