Input Guard (Input Tester)

Run it, block it, or review it — before you spend a credit

Input Guard is CI/CD for actor inputs. It validates a payload against any Apify actor's input schema and returns one routable decision ignore (valid, run it) / monitor (valid but risky, review) / act_now (invalid, block and fix) — so your pipeline or agent branches on one field. $0.15 per validation.

Most Apify failures are contract failures, not runtime failures — a run "succeeds" because a field was silently dropped (Apify does not warn on UNKNOWN_FIELD), a default changed, or the target's input schema drifted under you. Input Guard catches those before execution, regression-tests your saved payloads when a contract changes (Golden suites), and scores how risky an actor's input contract is over time.

Sign in to use
$0.15/validation

From validation to input-contract governance

Not just "is this payload valid?" — "is this actor's input contract safe to automate against?"

Routable decision + invocationPlan

One field your CI or agent branches on: decision — ignore (valid, run it) / monitor (valid but risky, review) / act_now (invalid, block and fix). The invocationPlan says run this exact payload, block it, or review it. Deterministic, no LLM.

Catches silently-dropped fields

Apify does not warn on UNKNOWN_FIELD — unknown fields are silently ignored at runtime, so a run 'succeeds' with the wrong data. Input Guard flags them pre-run, along with omitted fields falling back to defaults you didn't intend.

Golden suites — contract regression

Store a set of known-good payloads once; whenever the target actor's schema changes, Input Guard re-validates them automatically. wouldBreakExistingPayloads tells you directly whether your stored payloads break — before production does.

Contract risk + coverage

A cross-run contractRisk score (breaking-change history, drift frequency, documentation quality) tells you whether an actor is safe to automate against. coveragePercent answers 'have I tested enough of this contract?' — not just 'is this one payload valid?'

Auto-fix with patched preview

Enum-case corrections, float-for-integer coercions, and typo fixes are applied to produce a patched payload preview — so a near-miss input becomes a runnable one without hand-editing.

Batch mode + CI artifacts

Validate up to 500 labeled payloads in one run (testInputs[]). emitArtifacts writes REPORT.md/json, JUNIT.xml, SARIF.json, and GITHUB_STEP_SUMMARY.md so a failing input fails your pipeline with proper CI surfacing.

What Input Guard validates

Required field validation

Checks every required field is present and non-empty. Catches the #1 cause of actor run failures — missing required input — before any compute credits are spent.

Type checking

Validates that strings, numbers, integers, booleans, arrays, and objects match the schema. Catches type coercion bugs that cause silent failures or unexpected actor behavior.

Range and enum validation

Checks minimum/maximum constraints for numeric fields and validates that select fields contain only allowed enum values. Prevents out-of-range inputs.

Default value reporting

Shows which optional fields will use defaults and what those defaults are. Prevents surprises like defaulting to 100 results when you expected 10.

cURL command generation

Produces a ready-to-paste cURL command for the actor run — no more hand-crafting API calls. Includes your validated input JSON, correctly escaped.

Python and JavaScript snippets

Generates apify-client code in both Python and JavaScript/TypeScript, ready to drop into your integration. Uses your validated input JSON with proper formatting.

Input validation methods compared

There are several ways to validate actor input before running. Each trades off speed, cost, and validation depth.

MethodValidation depthCode generationCost
Input GuardRequired + types + ranges + enums + defaultscURL + Python + JavaScript$0.15/validation
Apify Console input formRequired fields only (visual form)NoneFree
Trial-and-error runsRuntime errors (post-failure)None$0.10-5.00 per failed run
Manual schema readingDepends on developer diligenceManualFree (5-15 min time cost)

Example Input Guard output

{
  "actorName": "ryanclinton/google-maps-email-extractor",
  "decision": "act_now",
  "invocationPlan": "block",
  "errors": [
    { "field": "query", "error": "Required field missing", "code": "MISSING_REQUIRED" },
    { "field": "maxResults", "error": "Expected integer, got string", "code": "TYPE_MISMATCH" }
  ],
  "warnings": [
    { "field": "maxReviews", "warning": "Unknown field — silently dropped at runtime", "code": "UNKNOWN_FIELD" }
  ],
  "autoFix": { "available": true, "patched": { "maxResults": 50 } },
  "contractRisk": { "score": 34, "band": "elevated", "schemaDriftDetected": false },
  "coveragePercent": 72
}

How Input Guard works

1

Enter the actor ID and paste your input JSON

2

Input Guard validates every field against the actor's declared input schema

3

Get validation results plus ready-to-use API call snippets in cURL, Python, and JavaScript

Alternatives to Input Guard

Several approaches exist for validating actor input, from visual forms to trial-and-error. The right choice depends on how often you integrate new actors.

Apify Console input form

The Apify Console provides a visual form for actor input with basic required field validation. Quick for simple inputs but does not show default values, generate code snippets, or validate complex nested structures.

Best for: simple actors with few input fields that you run manually.

Trial-and-error runs

Run the actor with your input and see what happens. If it fails, read the error log, fix the input, and try again. Each failed run costs $0.10-$5.00 in compute — often far more than a $0.15 validation.

Best for: when you're confident your input is correct and just need a quick test.

Manual schema reading

Open the actor's input_schema.json in the Apify Console or GitHub and manually check your input against it. Thorough but time-consuming (5-15 minutes) and error-prone for schemas with many fields.

Best for: developers who want to understand the full schema, not just validate against it.

JSON Schema validation tools

Use generic JSON Schema validators (ajv, jsonschema) to validate against the input_schema.json. Requires downloading the schema and setting up tooling. No Apify-specific features like default value reporting or code generation.

Best for: developers with existing JSON Schema validation infrastructure.

Input Guard

Automated input validation with required fields, types, ranges, enums, and default value reporting. Generates cURL, Python, and JavaScript snippets. $0.15 per validation — among the lowest-cost tools in the ApifyForge suite.

Best for: developers who frequently integrate new actors and want fast validation with code generation.

Limitations

  • 1.Schema-only validation. Input Guard validates against the declared input_schema.json. If the actor's code enforces additional constraints not declared in the schema, those are not checked.
  • 2.No runtime validation. Input Guard checks input structure but cannot verify that valid input will produce valid output. An input might pass schema validation but still cause the actor to fail due to unreachable URLs, rate limits, or site-specific issues.
  • 3.Requires declared input schema. Approximately 15% of Apify Store actors do not declare an input_schema.json. Input Guard cannot validate input for actors without a declared schema.
  • 4.No nested object deep validation. For fields of type "object", Input Guard checks that the value is a valid JSON object but does not validate nested object properties unless the schema explicitly declares them.
  • 5.Requires Apify account. Input validations execute on your own Apify account at the $0.15 PPE rate. You need a valid Apify API token.

What Input Guard costs

Every input validation executes on your own Apify account at the standard pay-per-event rate of $0.15 per validation— among the lowest-cost tools in the ApifyForge suite. No subscription, no premium tier. Apify's free plan includes $5/month in credits, enough for about 33 validations per month.

Frequently asked questions

What does Input Guard return, and how do I gate CI on it?

One routable decision: ignore (input is valid — run the actor), monitor (valid but risky — unknown fields, defaults, or no declared schema — review first), or act_now (invalid — block and fix). Branch on decision; never parse prose. There's also an invocationPlan (run this exact payload / block / review). In CI, fail the build when decision is act_now; emitArtifacts writes JUnit, SARIF, and a GitHub step summary so failures surface in your pipeline natively.

What are Golden suites and contract risk?

Golden suites store a set of known-good payloads once. Whenever the target actor's input schema changes, Input Guard re-validates them automatically and tells you — via wouldBreakExistingPayloads — whether your stored payloads would now fail, before production finds out. Contract risk is a cross-run score (breaking-change history, drift frequency, documentation quality) for how safe an actor's input contract is to automate against, and coveragePercent tells you how much of the contract you've actually tested.

Does it catch fields Apify ignores, and can it fix them?

Yes. Apify does not warn on UNKNOWN_FIELD — unknown fields are silently dropped at runtime, so a run 'succeeds' while quietly ignoring part of your input. Input Guard flags them pre-run. Auto-fix goes further: enum-case corrections, float-for-integer coercions, and typo fixes are applied to produce a patched payload preview, turning a near-miss input into a runnable one without hand-editing.

What does Input Guard validate?

Input Guard validates your input JSON against an actor's declared input_schema.json. It checks: required fields are present and non-empty, field types match the schema (string, number, integer, boolean, array, object), numeric values fall within minimum/maximum ranges, enum fields contain allowed values, and default values are correctly applied for omitted optional fields. All validation happens before any actor run, preventing wasted credits on failed inputs.

How much does input validation cost?

Each Input Guard run costs $0.15, charged as a pay-per-event (PPE) fee on your own Apify account — one of the lowest-cost tools in the ApifyForge suite. The tool reads the actor's input schema and validates your JSON — no actor runs are triggered. Apify's free tier includes $5/month in credits, enough for about 33 input validations per month.

Does Input Guard generate API call code?

Yes. After validating your input JSON, Input Guard generates three ready-to-use API call snippets: a cURL command for command-line usage, a Python snippet using the apify-client library, and a JavaScript/TypeScript snippet using the Apify SDK. Each snippet includes your validated input JSON, correctly formatted for the target language.

What is the most common cause of actor run failures?

Missing required fields are the number one cause of actor run failures on Apify, followed by type mismatches (passing a string where an integer is expected) and out-of-range values. Input Guard catches all three before you spend credits on a failed run. A single failed run can cost $0.10-$5.00 in compute — far more than the $0.15 validation cost.

Can I validate input for actors I don't own?

Yes. Input Guard reads the input schema from any public Apify Store actor. You can validate your input JSON against any actor's schema before running it, whether you own it or not. This is especially useful when integrating third-party actors into your pipeline for the first time.

How does default value reporting work?

Input Guard shows which optional fields you omitted and what default values the actor will use. This prevents surprises — for example, an actor might default maxResults to 100 when you expected 10, or default proxyConfiguration to use expensive residential proxies when datacenter would suffice. Knowing defaults before running saves both credits and time.