Skip to main content

6 — Output schema & write-back — structured payload design & systems-of-record integration.

The Layerup AI Agent produces a fully structured JSON payload upon completion of each case. This payload is the machine-readable representation of every dimension of the agent’s analysis — recommendation, confidence, evidence, flags, and open questions. Your downstream systems of record consume this payload via API or direct S3 read, using whichever integration pattern fits your existing architecture.

6.1 Output payload structure — nine top-level objects

The output JSON payload is designed to be human-reviewable at the operator console and machine-readable at the systems-of-record integration layer simultaneously.
{
  "case_metadata": { ... },
  "ai_recommendation": { ... },
  "occupation_analysis": { ... },
  "financial_analysis": { ... },
  "medical_analysis": { ... },
  "requirements": [ ... ],
  "evidence_citations": [ ... ],
  "open_questions": [ ... ],
  "escalation_flag": { ... }
}

case_metadata

Traceability envelope for the case. Every field required to reconstruct the agent’s state at the time of processing.
fielddescription
case_idUnique case identifier, correlated with your intake system.
applicant_idAnonymised / pseudonymised applicant identifier as configured.
processing_timestampsISO 8601 timestamps for intake, processing start, and completion, with millisecond precision.
agent_versionSemantic version of the Layerup agent container image (e.g., 1.4.2).
aop_versionSemantic version of the Agent Operating Procedure active at time of processing.
model_versionModel identifier and version for the foundation model invoked, per reasoning step.

ai_recommendation

The agent’s top-level underwriting recommendation and confidence posture.
fielddescription
decisionOne of: Approve · Defer Pending Requirements · Decline · Escalate to Senior Underwriter
confidence_score0–100 integer. Cases below your configured threshold (default: 75) automatically receive Escalate to Senior Underwriter.
reasoning_summaryNatural-language summary of the reasoning chain that produced the recommendation. Evidence-grounded and cross-referenced to source documents.

occupation_analysis

fielddescription
submitted_occupationOccupation as stated by the applicant.
resolved_classificationResolved occupation class under your classification manual.
mismatch_flagsDiscrepancies between submitted occupation and evidence in supporting documents, with severity ratings.
duty_mix_breakdownPercentage breakdown of manual, supervisory, and clerical duty components, where determinable.
occupation_risk_scoreRelative risk score under your configured occupation class table.

financial_analysis

fielddescription
income_sourcesExtracted income streams with source document citations.
income_quality_scoreDocumentation sufficiency score across all income sources.
documentation_sufficiency_scoreOverall financial documentation adequacy rating.
yoy_trendsYear-over-year income trends where multi-year documentation is available.
financial_flagsSpecific financial anomalies with severity scores (e.g., implausible YTD amounts, missing documentation, inconsistent income representations).

medical_analysis

fielddescription
medical_history_summaryEvidence-grounded narrative summary of the applicant’s medical history as extracted from all available documents.
risk_driversIdentified medical underwriting risk drivers with severity ratings (Low · Moderate · High).
identified_medicationsMedication list extracted from Rx history and APS documents.
flagged_inconsistenciesConflicts or anomalies across medical documents with severity scores.
missing_recordsRecords expected under the AOP configuration but not found in the submitted document set.

requirements

Ordered list of requirements the agent determines cannot be waived given available documentation. Each requirement object contains:
  • The specific requirement (e.g., “Attending Physician Statement from treating cardiologist”).
  • The agent’s evidence-grounded reasoning for why it is required.
  • A suggested due date, if applicable under your AOP configuration.

evidence_citations

For every extracted data point and every flag raised, a structured citation object references the source with precision:
fielddescription
source_documentDocument filename as received in the intake packet.
page_numberPage number within the document.
sectionSection or region identifier within the page.
extracted_textVerbatim extracted text snippet supporting the data point or flag.
ocr_confidenceOCR confidence score for this extraction, where applicable.
Evidence citations are attached to every data point — not just flags. This means your underwriting team can trace any value in the recommendation back to the exact text in the exact page of the exact document from which it was extracted.

open_questions

Natural-language list of questions the agent determines remain unanswered after reviewing all available documents. Each open question is grounded in a specific evidence gap — the agent does not generate speculative questions beyond what the document set and AOP configuration define as required.

escalation_flag

fielddescription
escalatedBoolean. true if the agent is routing the case to senior underwriter review.
escalation_reasonsStructured list of specific reasons (low confidence · critical extraction failure · edge case outside AOP · specific rule triggers).
escalation_routingQueue or routing target for the escalated case, as configured in the AOP.

6.2 Write-back integration patterns

Your IT team integrates the agent’s output payload using whichever of the following patterns fits your existing system architecture. The agent supports all three simultaneously — you select the appropriate pattern per downstream consumer.

S3 Drop + Lambda Consumer

The agent writes the output JSON to a designated S3 output prefix. An S3 event trigger invokes a Lambda function that reads the payload and updates your policy administration system or CRM via its internal API. Recommended for teams already using event-driven Lambda patterns for system-of-record updates.

Direct API Callback

The agent POSTs the completed output payload to a designated internal HTTPS endpoint (e.g., your internal microservice endpoint within the VPC) upon case completion. The endpoint must be within the VPC and reachable without public internet routing. Recommended for synchronous CRM integration patterns.

Queue-Based Handoff

The agent writes a completion notification to an SQS queue (AWS) or Service Bus topic (Azure), allowing your downstream system to poll and consume at its own pace. Recommended for downstream systems with their own processing schedules or rate limits.

Direct S3 Read

Your downstream system reads the output JSON directly from the designated S3 output prefix on a schedule or in response to the SQS completion notification. Simplest integration pattern for systems that already have S3 read capabilities.
Fig. A6.1 — Write-back integration patterns. All patterns route output exclusively within your VPC boundary. No output copy is sent to Layerup’s infrastructure.