Forge Json

Reliable AI data flow

Your data breaks before AI. And after it.

Transform, validate, and sanitize JSON before and after your AI calls.

No fragile prompts. No regex parsing. No surprises.

Messy JSON

Pipeline

Safe JSON

LLM

Validated Output

Problem

LLM JSON breaks in production

  • JSON outputs are inconsistent
  • Fields go missing or change type
  • You end up writing fragile parsing code
  • Sensitive data can leak to AI APIs

Solution

Fix it with a deterministic pipeline

Contract Validation checks the source shape first, then the pipeline transforms, redacts, and prepares only the data the AI path should see.

Input JSON
Contract
Transform
Redact
Safe JSON

Demo

From messy order JSON to safe AI-ready data

The Contract Validation step proves the payload is the raw order shape this workflow was built for. If the input is missing required fields or has already been normalized, the run stops before producing misleading AI context.

Review before run

AI Draft Review. Forge JSON lets you inspect and compare generated pipelines before you run them, turning AI output from a black box into a reviewable workflow.

Side-by-side comparison of AI-generated pipeline changes before execution.
Compare AI-generated pipelines before execution. See exactly what changed so you don't trust blind transformations.

Messy input JSON

JSON
{
  "order_id": "ord_1049",
  "customer": {
    "name": "Maya Chen",
    "email": "maya@example.com"
  },
  "payments": [
    { "status": "failed", "amount": 66 },
    { "status": "paid", "amount": 66 }
  ],
  "debug": {
    "rawWebhook": "...",
    "internalNote": "VIP customer"
  },
  "tracking": {
    "carrier": "DHL",
    "status": "delayed"
  },
  "items": [
    { "sku": "tee_black_m", "qty": 2, "price": "24.00" },
    { "sku": "cap_white", "qty": 1, "price": "18.00" }
  ]
}

Pipeline steps

deterministic
  1. 1Define required outputDeclare the exact shape the downstream workflow expects.
  2. 2Contract ValidationChecks that required fields exist before the pipeline spends work transforming data.
  3. 3Compute reliable fieldsDerive totals, counts, and statuses with repeatable rules.
  4. 4Pick final schemaKeep only the fields the AI path needs.
  5. 5Redact sensitive dataMask customer data before it can leave the pipeline.

Failure mode this prevents

Prevents running transformations on bad or already-processed data before it corrupts outputs or breaks downstream systems.

Examples: re-processing already structured JSON, missing required fields, or partial webhook payloads.

Structured output JSON

JSON
{
  "order_id": "ord_1049",
  "customer_name": "Maya Chen",
  "customer_email": "****",
  "payment_status": "paid",
  "shipping_status": "delayed",
  "item_count": 3,
  "total_amount": 66
}

How this was generated

Validate raw order data, skip if already processed, compute key fields, and output a clean, AI-ready JSON with sensitive data redacted.

No code. No schema. Just intent.

View prompt

This pipeline was generated from a natural-language instruction — then converted into a deterministic, validated workflow.

Full generation instructions

I'm preparing this messy order JSON for an LLM and need a stable, flat, AI-ready shape.

Validate that the input still looks "raw" — it must contain customer.name, customer.email, a non-empty items array, a non-empty payments array, and tracking.status (all strings except the arrays). If the input already has flattened fields like customer_name, customer_email, item_count, total_amount, payment_status, or shipping_status, treat that as a sign it's been pre-processed and skip the rest of the pipeline.

Then compute these derived top-level fields from the validated input:

  • customer_name from customer.name
  • customer_email from customer.email
  • payment_status = the status of the first payment whose status === "paid"
  • shipping_status from tracking.status
  • item_count = sum of items[].qty
  • total_amount = sum of payments[].amount where status === "paid"

After the derived fields exist, keep only order_id, customer_name, customer_email, payment_status, shipping_status, item_count, total_amount and drop everything else (the nested customer, items, payments, debug, tracking).

Finally, redact the email value at customer_email so it doesn't leak into the LLM prompt.

Pre-LLM shaping

Normalize and structure your data before sending it to AI.

PII Redaction

Remove sensitive data before it reaches the model.

Post-LLM validation

Enforce schema, fix types, and drop invalid fields automatically.

API

Simple enough to drop into your AI path

await runPipeline({
  input: data,
  pipeline,
  llm: {
    model: "gpt-4.1",
    prompt: "Summarize orders"
  }
})

Built for developers working with real production data.

Deterministic. Inspectable. Safe.

Try a pipeline on your messy input. Or see how to make AI JSON safe end-to-end.