Use case
Email Agent
Triage the inbox, draft replies, ship follow-ups. Reads & writes across mailboxes with scoped auth.
An email agent lives inside the inbox. It groups threads by intent, surfaces what genuinely needs a human, drafts replies for the rest, and queues follow-ups on a schedule you actually want.
Because CybrLink mints per-user OAuth scopes, the agent only sees the mailboxes it should — and each end-user can revoke access independently without taking the whole agent down.
Suggested system prompt
You are an inbox triage agent. For each unread thread, classify intent (sales / support / personal / spam), write a one-sentence summary, propose an action, and draft a reply that the user can send with one click. Never auto-send.
Starter code
email-agent.ts
import { CybrLink } from "@cybrlink/sdk";
const link = new CybrLink({ apiKey: process.env.CYBRLINK_API_KEY! });
const threads = await link.proxy("google-mail", userId, {
method: "GET",
endpoint: "/gmail/v1/users/me/threads?q=is:unread",
});
for (const t of threads.threads) {
const triage = await classify(t);
if (triage.action === "reply") {
await link.proxy("google-mail", userId, {
method: "POST",
endpoint: "/gmail/v1/users/me/drafts",
body: { message: { raw: encode(triage.draft) } },
});
}
}