Documentation menu
Documentation

Email

Route inbound mail to a durable agent and send replies from the same identity.

Handle mail as an event

Override onEmail() for inbound messages and use native replyToEmail() or sendEmail() for outbound mail. Secure reply routing signs agent identity headers so replies return to the correct durable instance.

Email contents can contain prompt injection. Parse it as untrusted input, limit tools available during mail handling, and require approval before external side effects.