Validate Upload Constraints
file.validate_upload_constraints
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
Non-goals
- No malware scanning
- No archive extraction
- No network fetch
- Does not certify legal or compliance approval beyond your supplied constraints
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
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.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 50 MiB | Platform maximum |
How we handle your data
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.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| files | array | Yes | Bounded array of 1 through 1000 closed upload candidates with ref and logicalName. |
| constraints | object | Yes | Closed upload policy of size, MIME, extension, duplicate, archive, and filename rules. |
| options | object | No | Closed optional evaluation knobs; omit the object to compute SHA-256, continue after failures, and cap findings at 1000. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | True when every file and aggregate check passed. |
| files | array | Yes | Bounded array of 1 through 1000 closed per-file verdicts in input order. |
| aggregate | object | Yes | Closed aggregate counts and policy-level findings with accepted, rejected and total bytes. |
| policyDigest | string | Yes | First 16 hex characters of the SHA-256 of the constraints object. |
| _meta | object | No | Closed provenance naming the validator rule set that produced these findings. |
API contract
POST /v1/executecurl -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}}}'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
| 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
- 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)
{
"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
{
"constraints": {
"maxBytesPerFile": 100
},
"files": [
{
"ref": "squillify://files/f-1",
"logicalName": "a.txt"
}
]
}{
"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
{
"constraints": {
"maxBytesPerFile": 3
},
"files": [
{
"ref": "squillify://files/f-2",
"logicalName": "big.txt"
}
]
}{
"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
}
}Recommended use cases
- 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)
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.