# AI agent for contract email: e-signature safety

> How an AI agent files signed contracts from email, what to do when a signature link is flagged, and why the signature itself stays with a human.

Source: https://trotta.email/use-cases/contract-signing

An AI agent can receive contracts by email, read the attached file as text and file signed copies. The danger is a signature request whose link shows one address and opens another. In our sample that message is delivered with a flag, not held, so the agent must check the verdict before it opens anything.

Updated December 3, 2026

## How does an AI agent file a contract from email?

Take the message, check its verdict, and read each attachment that has text:

```typescript
import { TrottaMail } from "trotta-mail";

const mail = new TrottaMail({ apiKey: process.env.AGENT_KEY });
const msg = await mail.messages.get(process.env.MESSAGE_ID!);

if (msg.verdict.action === "deliver") {
  for (const file of msg.attachments.filter((a) => a.has_text)) {
    const { text, truncated } = await mail.messages.attachmentText(msg.id, file.id);
    await fileContract(msg.from.address, file.filename, text, truncated); // your code
  }
}
```

Text is read from PDF, Word, Excel, PowerPoint, OpenDocument text and plain text files. Reading is capped at 15 MB, 50 pages and 200,000 characters, so check `truncated` on a long agreement. A file with no readable text has `has_text` false.

Documents are screened too. An instruction aimed at an AI inside a file holds the message for an agent's inbox. You can watch that happen with the `pdf_instruction` [attack drill](https://trotta.email/use-cases/attack-drills).

## What happens when a signature link opens elsewhere?

The job has two sample messages. We screened both again on December 3, 2026. Priya Shah, counsel, sends a countersigned NDA from `priya@harbor-legal.example`. Then "Harbor Legal" writes from `esign@harbor-legal-docs.example`: the amended agreement is ready, please review and sign today.

| Message | Verdict | Summary, as the engine wrote it |
| --- | --- | --- |
| Signed NDA for Harbor | `deliver`, level `safe` | No threats found. |
| Agreement ready for signature | `flag`, level `caution` | A link is labelled harbor-legal.example but really opens esign-docs.example. |

**A flag is not a hold.** The second message reaches the inbox with the signal "Link text and destination do not match". This is the safe text the agent reads:

Safe view of the flagged message:

```text
The amended agreement is ready. Please review and sign today.
<hxxps://harbor-legal[.]esign-docs[.]example/sign> https://sign.harbor-legal.example/agreement
```

The real destination is defanged. The address the sender wanted you to trust is still there as ordinary text, so code that picks URLs out of the body can be fooled. Read the `links` field instead:

| `domain` | `verdict` | `reasons` |
| --- | --- | --- |
| esign-docs.example | `caution` | `text_says_harbor-legal.example` |
| harbor-legal.example | `ok` | none |

Each entry also has a live `url`. On a flagged message, open none of them, including the one marked `ok`.

## What should the agent do with each verdict?

| Verdict | The agent | A human |
| --- | --- | --- |
| `deliver` | Files and summarizes the document | Signs, if it is right |
| `flag` | Opens no link, asks legal | Confirms with the counterparty |
| `hold` | Sees no content, passes the notice on | Reads, then releases or discards |
| `reject` | Never receives it | Can find it in the Blocked folder |

For a flagged message, leave a draft for legal. A draft sends nothing:

```typescript
if (msg.verdict.action === "flag") {
  await mail.drafts.create(msg.inbox_id, {
    to: "legal@trotta.io",
    subject: "Check this signature request before anyone signs",
    text: `From ${msg.from.address}. ${msg.verdict.summary}`,
  });
}
```

In an MCP client, `read_message` returns the same verdict and safe view.

MCP:

```json
{ "name": "read_message", "arguments": { "message_id": "msg_7c2ndq8xk4v9tb3wmz6r" } }
```

## Should an AI agent sign contracts?

A signature binds your company, so keep it with a human. Trotta Mail does not sign documents, does not check electronic signatures inside a file and does not judge contract terms. It screens the mail around them.

- **Check the sender.** The sample verdicts come from screening content. On arrival, `verdict.auth` also shows SPF, DKIM and DMARC.
- **Confirm changes elsewhere.** Call the counterparty on a number you already have before a new link or a new version is acted on.
- **Approve what leaves.** `send_approval: always` holds every outgoing message for a human, as in [payment approvals](https://trotta.email/use-cases/payment-approvals).
- **Expect macro documents to wait.** A `.docm` file is held for a human, as in the [hiring](https://trotta.email/use-cases/hiring) sample.

## Questions

### Can an AI agent read a contract PDF from an email?

Yes, if the file has readable text. The API and the `read_attachment_text` MCP tool return it with instructions aimed at an AI taken out.

### Is a flagged email safe to act on?

No. A flag means the message was delivered with a warning. Have the agent open no link, sign nothing and ask a human.

### How can an agent spot a fake signature request?

Check the verdict and the `links` field. In the sample, the visible address was on harbor-legal.example while the link opened esign-docs.example.

### Does Trotta Mail provide e-signatures?

No. It is the inbox that receives and sends the mail. Use your signing service for signatures, with a human signing.

## Related

- [Deceptive links](https://trotta.email/threats/deceptive-links) Threat library
- [Hidden instructions in attachments](https://trotta.email/threats/hidden-instructions-in-attachments) Threat library
- [Payment approvals by email with an AI agent](https://trotta.email/use-cases/payment-approvals) Use cases
- [Answering data subject requests with an AI agent](https://trotta.email/use-cases/data-requests) Use cases
- [Send later, invites, files](https://trotta.email/docs/mail-features) Docs
- [Held mail](https://trotta.email/learn/held-mail) Guides

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

[Get an inbox](https://trotta.email/signup) [See every use case](https://trotta.email/use-cases)
