Payroll email with an AI agent

An AI payroll agent can take in timesheets and answer routine questions by email, but it should never change where a salary is paid because a message asked. Give it its own inbox, let screening hold salary redirects, keep identity numbers out of its replies, and send bank changes to your payroll portal.

Updated

What should an AI payroll agent do with each email?

Email that arrivesThe agentThe line it does not cross
A timesheetReads the file as text and files itPays nothing on its own
A pay date questionAnswers from your payroll dataSends no identity numbers or passwords
A new bank account for a salaryPoints to the payroll portalNever edits bank details
A request for pay records or tax formsPasses it to a humanExports nothing by email

How does the agent read a timesheet from email?

An attachment with readable text carries has_text. Read that text instead of opening the file. Instructions aimed at an AI are taken out of it.

TypeScript
import { TrottaMail } from "trotta-mail";

const mail = new TrottaMail({ apiKey: process.env.AGENT_KEY });
const inboxId = process.env.INBOX_ID!;
const since = process.env.LAST_CHECK!; // an ISO time

const msg = await mail.inboxes.wait(inboxId, { subject: "timesheet", after: since });
const file = msg?.attachments.find((a) => a.has_text);
if (msg && file && !msg.verdict.categories.includes("payment_fraud")) {
  const { text } = await mail.messages.attachmentText(msg.id, file.id);
  await fileTimesheet(msg.from.address, text); // your code
}

Check verdict.categories, not just action: a delivered message can still carry a reason. Treat payment_fraud on any message as a stop. A message that gives new account details to pay into is held in an agent's inbox, even when it comes from a coworker.

What happens to a salary redirect email?

The job has two sample messages. We screened both again on December 3, 2026. Dana Whitfield sends a November timesheet from dana@trotta.io: 152 hours, no overtime. Then a message in Dana's name arrives from dana.whitfield@inbox-personal.example, asking for the salary to go to a new account from Friday.

MessageVerdictSummary, as the engine wrote it
November timesheetdeliver, level safeNo threats found.
New bank account for my salaryhold, level dangerThe message says payment details have changed, the pattern of invoice fraud.

The engine calls the pattern invoice fraud even though this is a salary. The shape is the same: payment details that changed. The signal is "Payment request with the marks of invoice fraud", and its advice is to confirm through a channel you already trust.

The FBI also describes a second route. Phishing mail captures payroll sign-ins, the attacker changes the direct deposit inside the portal, and rules stop the employee getting alerts. Screening can stop the phishing mail, but a change made in the portal never crosses your inbox. Require a second factor there. See payroll diversion.

How does a human hear about held payroll mail?

Owners and admins get a notice in their own mailbox about held mail. It is on by default, at most once an hour, with a daily summary while anything waits. If payroll works in another tool, the agent can pass the news on:

TypeScript
for (const held of await mail.guard.held({ inboxId })) {
  if (held.status !== "held") continue; // skip outgoing mail that waits for approval
  // No subject and no body: an id, a sender address and fixed words about why.
  await tellPayroll(held.id, held.from.address, held.verdict.summary); // your code
}

To be told as it happens, register a webhook for message.held with your admin key.

Can a payroll agent leak data by email?

Outgoing mail is screened too. In our test, a reply with a social security number was refused with 422 outbound_blocked, and so was one with a portal password. Text attachments are screened the same way.

A reply with a salary figure and a bank account number waits for a human, as pending_approval. Screening does not know everything that is confidential in your payroll, so give the agent no way to export the pay file.

How should you set up the payroll inbox?

  • Its own inbox and key. Limit the key to that inbox with mail:read and mail:send.
  • Approval for new addresses. With send_approval: first_contact, a human approves the first message to any new recipient.
  • Lockdown for staff mail. In lockdown mode your own organization and allow-listed senders that prove who they are get through. A private address in an employee's name waits.
  • Changes in the portal. Reply with the portal address and let the signed-in employee make the change.

Questions

Can an AI agent change an employee's bank details from an email?

It should not. Have the agent point to the payroll portal, where the employee signs in with a second factor, and keep a human review before each pay run.

What does the agent see when a salary redirect is held?

No subject, no body and no new account number. An agent's key gets a plain sender address and a verdict in fixed words. A human reads the message.

Can a payroll agent email payslips?

Yes, with care. A payslip that carries a social security number is refused, in the body or in a text attachment. Many teams send a link to the payroll portal instead.

Does screening stop payroll diversion?

It holds the message pattern shown here. No filter catches everything, and changes made directly in a payroll portal never pass through email. Verify every change.

Sources

Give your agent an inbox of its own. Free for three agent inboxes and you. No card.