All terms
GlossaryInbound

Structured reply event

A structured reply event represents an inbound email reply as an object, with an injection score and sender reputation on every event.

A structured object representing an inbound email reply. injection_score + sender_reputation are computed on every event; intent, entities, and urgency are read from first-contact mail when opt-in classification is enabled on a paid plan.

Every reply received by an agent address — whether a response to automatic mail the agent sent, or an unsolicited inbound to its public-facing address — is normalized into a structured reply event before it reaches your code.

What is in the event

Two fields are computed on every event, plus the raw body for fallback:

  • injection_score — 0–1 prompt-injection risk. See injection_score.
  • sender_reputation — 0–1 trust score for whoever sent the message: the classifier’s estimate, or a preset such as 0.3 for a sender that failed authentication.

Enable opt-in classification (no extra charge on paid plans) and three more fields are read from first-contact mail; a reply in a thread gets the fixed intent general_reply:

  • intent — the classified action, a short label such as schedule_demo, request_pricing or support_request.
  • entities — structured data extracted from the body: dates, amounts, names, emails, durations, timezones.
  • urgency — 0–1 score. Threshold for paging your agent vs. queueing for batch.

Why it matters

Without structured reply events, every agent that reads inbound email re-implements MIME parsing, threading, intent classification, and entity extraction. Each is a class of bugs. Structured reply events let your agent code switch against structured fields rather than regex through bytes — here on first-contact mail, with opt-in classification enabled on a paid plan:

agent.onMessage((event) => {
  // Hold for a person: quarantined, not scanned (no score), or 0.5 and up
  if (event.quarantined || typeof event.injection_score !== "number" || event.injection_score >= 0.5) {
    return flagForReview(event);
  }
  switch (event.intent) {
    case "schedule_demo": return calendar.createEvent(event.entities);
    case "unsubscribe": return suppressionList.add((event.data.from as { address: string }).address);
  }
});

Read the structured reply events post for the full rationale and complete event-shape JSON.

Related

What to read next

Give your first agent an inbox

Free covers 3,000 emails and 3,000 inbound replies a month, with no card. Upgrade when your agents get busy.

Get your API key