The Model Returned an Extra Field: Accept or Reject It?
The extraction result contains one extra item. confidence, which appears quite useful on the front end, was thus directly displayed as “trustworthiness.” The pr
Model output sometimes includes a field you never asked for, such as confidence. It can look helpful, but if your system displays or stores it, downstream code may start treating an undefined value as trusted data. This guide explains how to decide whether to accept or reject extra fields, and how to make that decision visible in your code.
The examples use synthetic samples and were checked in an isolated environment. They do not guarantee the same result for every real file or product. Before you process important documents, keep the originals and check your results against your own boundaries and acceptance criteria.
You will learn how to decide whether your interface is open or closed, how to turn unknown fields into errors you can observe, and how to make rejections easy to repair. You will also see why discarding fields is a processing decision in its own right.
Should you accept an extra field in model output? The short answer
Reject extra fields on stable interfaces, and document any exception you allow.
| Your situation | What to do | Why |
|---|---|---|
| A stable delivery interface receives an extra top-level field | Reject the output and report the unknown key name and protocol version | Undefined values can be mistaken for valid inputs downstream |
| An internal exploration tool receives extra fields | Allow them, but keep them out of trusted outputs | Extension is useful for exploration, but the meaning is not agreed upon |
| A nested object contains an unexpected key | Check the object path and reject the nested key | Closing only the outer layer leaves inner parts open to arbitrary fields |
| You plan to silently drop unknown fields | Document what is kept and what is filtered | Otherwise you cannot tell a missing source field from a field removed at the interface |
| You want to add a new field officially | Publish a new schema version | Changing the old contract quietly alters how historical data is read |
Why an extra field is a risk
The extraction result in this example contains one extra item: confidence. On the front end, it appears useful, so it was displayed as “trustworthiness.” The problem is that this field may be neither defined nor calibrated. Showing it to users as a quality signal gives it a meaning nobody agreed on.
An extra field is not always harmless. It can lead downstream systems to treat values that were never agreed upon as valid inputs.
Decide whether your interface is open or closed
Start by asking whether the interface is open or closed. The answer determines how strict your validation should be.
Open interfaces
- Internal exploration tools can allow extended fields.
- Use them to test ideas, but do not feed their extra values into trusted outputs.
Closed interfaces
- Stable delivery interfaces often need stricter boundaries.
- Use JSON Schema's
additionalProperties: falseto reject undefined properties of the current object. - Note that this setting does not automatically apply to each nested object. You must specify what is allowed at every level.
Not every interface should reject everything
Rejecting all extensions is not the goal. The goal is to make clear-cut choices and to provide a versioning mechanism for upgrades. Silently ignoring a field today and suddenly using a field with the same name tomorrow can lead to divergent interpretations of historical data.
Turn unknown fields into observable errors
The following example rejects unknown fields and reports them.
from jsonschema import Draft202012Validator
schema = {"type": "object", "required": ["name", "evidence"],
"properties": {"name": {"type": "string"},
"evidence": {"type": "object", "required": ["page"],
"properties": {"page": {"type": "integer", "minimum": 1}},
"additionalProperties": False}},
"additionalProperties": False}
validator = Draft202012Validator(schema)
valid = lambda x: not list(validator.iter_errors(x))
assert valid({"name": "Demo", "evidence": {"page": 1}})
assert not valid({"name": "Demo", "confidence": 0.99, "evidence": {"page": 1}})
assert not valid({"name": "Demo", "evidence": {"page": 1, "guess": True}})
The value 0.99 in this example is only a synthetic input that should be rejected. It is not the actual quality result of any model. The example checks both the top level and nested layers, so that the outer layer is not closed while the inner parts remain freely expandable.
Make rejections repairable
When you reject output, the error message should help someone fix the problem. Use the following table to decide what each case should return and what it should avoid.
| Case | The response should include | Avoid |
|---|---|---|
| Unknown top-level field | Unknown key name and protocol version | Displaying it as a trusted indicator |
| Unknown inner field | Object path and unknown key name | Returning only a generic JSON error |
| Legal new extension | A clearly defined new schema | Quietly relaxing the constraints of the old version |
| Model repeatedly outputs a redundant key | The reason the extraction task failed | Pretending the original output was acceptable after each deletion |
Discarding fields is also a processing decision
Some teams choose to read the known fields and ignore the rest. This can work, but you must document the original results and the filtering behavior.
- Without documentation, you cannot tell whether a field was absent from the source data or removed at the interface layer.
- Do not use discarding as a way to hide the model's failure to follow the protocol. A dropped field can make a broken output look clean.
Keep translation and extraction contracts separate
Document translation output and structured field output are two different contracts. When you process documents with OmniDoc (product entry point), you can use your field list to verify the translated result. However, do not automatically accept extra business judgments or confidence fields just because the translation reads well.
🎯 Which approach fits you?
If you build a stable delivery interface
Reject unknown fields at every level, and return the key name and protocol version so the error can be fixed.
If you run internal exploration tools
You can allow extra fields, but keep them out of trusted outputs and user-facing quality indicators.
If you plan to drop unknown fields
Document what you keep, what you filter, and why, so that missing data can be traced later.
If you want to add a field officially
Publish a new schema version instead of changing the old contract.
📊 At a glance
| Approach | When it fits | Main risk to manage |
|---|---|---|
| Reject unknown fields | Stable delivery interfaces | Requests fail until the schema or output is corrected |
| Allow extended fields | Internal exploration tools | Extra values may be mistaken for agreed-upon data |
| Silently ignore unknown fields | Interfaces with documented filtering | Hides protocol failures unless the filtering is recorded |
❓ FAQ
1. Should I always reject extra fields in model output?
Not always. Reject them on stable interfaces, and allow them only in open or exploratory settings where you keep them out of trusted outputs.
2. Does additionalProperties: false protect nested objects too?
No. It applies to the current object, so you must specify what is allowed at each nested level.
3. Is it safe to silently drop unknown fields?
Only if you document the original results and the filtering behavior. Otherwise, you cannot tell missing source data from fields removed at the interface.
4. Can I show a confidence field to users?
Not by default. If the field is not defined or calibrated, showing it as trustworthiness gives it a meaning nobody agreed on.
📝 Summary
An extra field is a contract question, not just a technical detail. Decide whether each interface is open or closed, reject unknown fields where stability matters, and document any filtering you do. Keep translation and extraction contracts separate so that fluent output does not become unverified data.
Try it now: upload a document and get it translated with the layout intact
For the schema reference, see JSON Schema additionalProperties.


