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

Traceability envelope for the case. Every field required to reconstruct the agent’s state at the time of processing.

ai_recommendation

The agent’s top-level underwriting recommendation and confidence posture.

occupation_analysis

financial_analysis

medical_analysis

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:
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


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.