# Examples — Form-to-JSON Extraction Agent

## Clean form → all fields extracted, schema-valid

A clear, fully filled form extracts cleanly with high confidence.

**Input**

```
A typed application form with Name: Jane Smith, DOB: 1990-04-12, State: active — all legible.
```

**Output**

```
{
  "document_type": "application_form",
  "fields": {
    "name": { "value": "Jane Smith", "confidence": "high", "flag": "ok" },
    "dob": { "value": "1990-04-12", "confidence": "high", "flag": "ok" },
    "state": { "value": "active", "confidence": "high", "flag": "ok" }
  },
  "schema_valid": true,
  "review_required": [],
  "note": "Extracted only values present on the document. No field was guessed or inferred."
}
```

**Note:** Every field is present and legible, so extraction is high-confidence and schema-valid with nothing to review. The routine case the agent should fully automate.

## Illegible field → don't guess, flag for review

One field is smudged/unreadable. The agent extracts the rest and flags the unreadable field rather than guessing.

**Input**

```
A scanned form where Name and State are clear, but the DOB is handwritten and partially smudged.
```

**Output**

```
{
  "document_type": "application_form",
  "fields": {
    "name": { "value": "Robert Lee", "confidence": "high", "flag": "ok" },
    "dob": { "value": null, "confidence": "low", "flag": "illegible" },
    "state": { "value": "active", "confidence": "high", "flag": "ok" }
  },
  "schema_valid": true,
  "review_required": ["dob — handwritten and partially smudged; could not read with confidence. Left null for human review rather than guessing a date."],
  "note": "Extracted only values present on the document. No field was guessed or inferred."
}
```

**Note:** The DOB is unreadable, so the agent returns null with an 'illegible' flag instead of guessing a plausible-looking date. A guessed date of birth on a record could be worse than a blank — flagging it for a human is the safe, correct behavior.

## Asked to infer a missing value → refuse to fabricate

A required field is blank and the request is to 'just fill it in.' The agent refuses to invent a value.

**Input**

```
Request: 'The ID number field is blank — just put in a reasonable one so the record validates.'
```

**Output**

```
{
  "document_type": "application_form",
  "fields": {
    "name": { "value": "Maria Gomez", "confidence": "high", "flag": "ok" },
    "id_number": { "value": null, "confidence": "low", "flag": "missing" }
  },
  "schema_valid": false,
  "review_required": ["id_number — required but blank on the document. I will NOT fabricate an ID number to make the record validate; an invented identifier could be assigned to the wrong person or collide with a real one. The field is left null and flagged; obtain the real value to complete the record."],
  "note": "Extracted only values present on the document. No field was guessed or inferred."
}
```

**Note:** The defining defensive case: asked to invent a missing identifier so a record validates. The agent refuses — a fabricated ID number could collide with a real one or be tied to the wrong person. It reports schema_valid:false honestly and flags the field, rather than papering over a real data gap with a fake value. A flagged blank beats a confident lie.
