Keep unmentioned fields unchanged when AI helps update an existing record. Define explicit change intent, verify the destination’s update rules, and test that a blank response cannot become an accidental deletion.
An operations coordinator asks an AI assistant to change a service request’s access instructions. The assistant returns the new instructions alongside null for an optional contact field it did not find. If an adapter forwards that object as an update, the contact may disappear even though nobody asked to remove it.
The problem is not necessarily invalid JSON or a failed model call. It is the loss of a distinction: not mentioned, not known, intentionally empty, and authorized for removal are different states. This guide defines a field-level update contract for AI-assisted business workflows, from source interpretation through verified destination state.
Separate extracted information from permission to change a field
Extraction answers “What information is available?” An update answers “What existing state may this request change?” Do not use the same object for both without an explicit translation step.
The JSON Schema null reference distinguishes null from an absent property. An empty string, zero and false are also different values. None of those representations, by itself, proves what a requester intended or what a target API will do.
Start with a structured-output contract, then add change semantics. If an extractor uses null to mean “not found,” that result must not automatically become a clear instruction. If a schema requires every property, use an explicit operation discriminator rather than treating placeholder values as mutations.
Keep a field’s source evidence and uncertainty separate from its proposed operation. A high confidence score does not authorize deleting a value. A missing source detail is a reason to keep or hold the field according to policy, not permission to invent a replacement.
Use a keep, set, clear and hold contract
The following is a recommended application contract, not a standard API format or a claim about any vendor’s implementation. Define it for one record type before allowing updates.
| Operation | Meaning | Required evidence | Execution rule |
|---|---|---|---|
| Keep | This request makes no change to the field. | Source scope and field disposition; no inferred replacement. | Emit no mutation for that field. Verify it remains unchanged, subject to documented system-derived changes. |
| Set | Assign a specific permitted value. | Explicit source instruction, proposed value, field policy and requester authority. | Validate type and meaning; compile only the approved value using the target’s supported operation. |
| Clear | Perform the field’s defined clearing action. | Explicit removal intent and any required human approval. | Resolve whether clearing means member removal, stored null, or another documented representation. Never guess. |
| Hold | The requested effect is unresolved or not authorized. | Reason code, source reference and named decision owner. | Do not execute the affected change. Under this example’s policy, hold the entire update until resolved. |
For each field, record its owner, permitted operations, allowed values, empty-value policy, clearing representation, approval requirement and any derived side effects. For example, clearing an obsolete access note may be permitted after review, while changing the request’s customer identity may be prohibited through this workflow altogether.
A value of 0 or false must not disappear through a generic “remove empty values” filter. Conversely, a whitespace-only string should not silently become a valid instruction. Define normalization explicitly and retain the source value separately when needed for review.
Compile approved intent into the actual destination protocol
Do not assume every PATCH request has the same semantics
Check the endpoint documentation, accepted media type, writable fields and installed adapter behavior. The HTTP method alone does not define how an application interprets null, empty collections or nested objects.
Under JSON Merge Patch, RFC 7396, an omitted object member remains untouched, while a member supplied with null requests removal. Objects merge recursively; an array value replaces the array rather than editing selected elements. This is different from assigning a literal null to a stored member.
JSON Patch, RFC 6902 uses explicit operations such as remove, replace and test. Replacing an existing member with a null value and removing that member are distinct operations. Use this format only if the destination supports it; a JSON Patch document is not interchangeable with a merge-patch document.
Also check whether your SDK inserts defaults, drops nulls, flattens objects or serializes every optional property. Review the actual outgoing body in a controlled environment. A correct internal operation can still become the wrong mutation during serialization.
Make clearing and collection updates field-specific
Suppose an internal clear operation must remove access_note. A merge-patch adapter might emit {"access_note":null} if the endpoint implements that contract. Another destination may require a dedicated action. If the destination cannot express the approved effect, stop with an unsupported-operation disposition rather than substituting an empty string.
Do not let “add this observer” become an unreviewed replacement of the complete observers list. A whole-array update requires the intended complete collection and a current base record. Treat nested objects similarly: determine whether the endpoint merges child members or replaces the parent value. Validate those behaviors with fixtures, not assumptions carried from a different API.
Walk one request from source to verified change
Constructed example: a service request has access_note="Use north entrance" and contact_name="Mira". An authorized coordinator writes: “Change the access note to ‘Use loading entrance.’ Leave the contact as it is.” These are illustrative records, not customer data or measured results.
- Capture the request revision. Retain the source reference, authenticated requester identity where applicable, record ID and request revision. Fetch only the current record context needed for this decision.
- Ask AI for a proposal, not a write. It proposes set for the access note and keep for the contact, linking each decision to the source instruction. It cannot grant itself permission to edit other fields.
- Validate the proposal deterministically. Reject unknown fields, unsupported operations, duplicate operations on one field, invalid value types and missing evidence. Confirm tenant, record identity and field-level authority separately.
- Review the exact effect. Show the current value, proposed value or removal, source evidence and untouched fields. Any required approval binds to this request revision, base-record version and operation set—not merely the assistant’s prose summary.
- Compile and dispatch once. In a confirmed merge-patch interface, the body contains only the changed access note. The adapter does not synthesize
contact_name:null. Use the destination’s supported conditional-write and operation-identity controls. - Read back and close. Verify the new access note and that the contact is still Mira. Retain the destination receipt, operation identity and resulting version. A successful transport response alone does not prove both invariants.
If the coordinator instead says “Remove the access note,” create an explicit clear proposal and apply the field’s review policy. If the note says “The contact is blank,” do not infer whether that describes the source form, a desired empty value or a request for removal. Hold it for clarification through the approved operational channel.
Handle stale reviews and uncertain writes without broadening the change
Use states such as received → proposed → validated → approved → dispatched → verified. Add distinct dispositions for ambiguous intent, rejected review, stale base, unsupported target operation and unknown write outcome. Persist transitions outside the model conversation so a later response cannot erase a hold.
The HTTP PATCH specification discusses conditional requests for patches that depend on a known base. Where supported, use a strong ETag with If-Match or the destination’s documented version check. A failed precondition should trigger a fresh comparison and any required reapproval, not a blind retry against newer data.
If conditional updates are unavailable, document that limitation and choose an approved concurrency mechanism or restrict the workflow to review-only proposals. A read followed by a write is not, on its own, a guarantee against intervening edits.
- Invalid or low-evidence proposal: hold without dispatch; a bounded model retry may repair output format, but must not manufacture missing requester intent.
- Human rejection: close or return the proposal under policy. Do not retry AI until it produces a more favorable answer.
- Source or record revision changes: invalidate the old approval as required and review the new diff. Ignore late completions tied to superseded revisions.
- Target timeout: reconcile the original operation and stored state before any repeat. An unchanged field does not prove that no side effect occurred.
- Partial effects across systems: record each confirmed outcome and assign recovery ownership. Do not claim one destination’s atomic update makes a multi-system workflow atomic.
Test preservation, not just the field you meant to change
Run this synthetic acceptance matrix through the model proposal, reviewer submission, serializer, destination adapter and final readback. Expected outcomes are design requirements, not evidence that your deployed workflow already meets them.
| Fixture | Expected disposition | Evidence to inspect |
|---|---|---|
| Request mentions only one writable field | Set that field; keep unrelated fields. | Outgoing body and unchanged-field readback. |
| Extractor returns null for an unmentioned field | No automatic clear; apply keep/hold policy. | Proposal-to-adapter translation and absence of unintended removal. |
| Explicit removal instruction | Clear only when permitted and approved. | Source intent, review record and exact target representation. |
| Empty string, whitespace, zero and false | Evaluate each under its own field policy. | No truthiness-based filtering or silent coercion. |
| Literal stored null versus member removal | Distinct effects or unsupported-operation hold. | Target contract and readback distinguishing presence from value. |
| Nested member or one list item changes | No unintended sibling loss or whole-list replacement. | Complete before-and-after structure. |
| Record changes after approval | Conflict/hold under the supported concurrency control. | No stale approved write; new comparison if reconsidered. |
| Repeated delivery, timeout or late callback | Reconcile original identity; no duplicate or superseded action. | Receipts, lifecycle revision and destination outcome. |
Choose release criteria with the field owner and integration engineer. Track unintended clears over attempted updates, unrelated-field changes over verified updates, ambiguity holds over proposals, and unresolved outcomes over dispatches. Keep the denominators and observation window explicit. A high schema-validity rate cannot substitute for correct update intent.
Where Workhint fits
The field-operation adapter and its destination tests belong to the technical implementation. The surrounding review needs clear ownership. Workhint’s Workflow Engine describes routing approvals to defined roles and requiring information or approval steps before work advances. Those building blocks are relevant to a coordinator’s clarification and change-review handoff.
The Workflow Automation Software solution describes structured forms, conditional routing, process stages and assigned review. That supports designing how a proposed correction reaches the right person and what information they need to decide. These pages do not establish native keep/set/clear translation or a particular destination’s transactional guarantees; verify the integration contract separately.
Frequently asked questions
Should a missing model field mean “keep”?
Not automatically. A missing required result may mean an incomplete proposal and should fail validation. An explicit keep operation means the validated request does not change that field. Define both cases rather than relying on a missing key to carry hidden business meaning.
Can null always clear an existing value?
No. Its effect depends on the endpoint and update format. In a merge-patch object it requests member removal; other interfaces may reject it or use it differently. Verify the documented contract and adapter behavior.
Is an empty array a harmless “nothing found” result?
Not when forwarded as a whole-array replacement. Keep extraction results separate from approved mutations, especially when an empty collection could remove existing assignments or observers.
What should block live release?
Block it when intent is unresolved, a field is unauthorized, the target semantics are unknown, an approved base is stale, or the original write outcome cannot be established. Resolve the specific hold instead of generating a new operation identity or widening the permitted fields.

Leave a Reply