An AI agent might mark emails as unread if they need human review:
Copy
async function handleEmail(email) { const classification = await aiAgent.classify(email); if (classification.confidence < 0.8) { // Low confidence - mark as unread for human review await markAsUnread(email.uid); await notifyHuman(email, classification); } else { // High confidence - process and mark as read await aiAgent.respond(email); await markAsRead(email.uid); }}