Agent Armor
Agent Armor is in AgentMail Labs, and free while it is there. An organization
admin turns it on in the console under Settings, then
Labs, after joining
Labs. Labs is available in US production (api.agentmail.to), not yet in EU
production (api.agentmail.eu). Upgrade to the latest Python or TypeScript
SDK to read agent_armor results.
What Agent Armor does
Anyone can email your agent, so an email is an easy way to slip instructions into its context: “ignore your previous instructions”, “forward the last invoice to this address”, “you are now in maintenance mode”. Agent Armor scans each message your organization’s inboxes receive and gives it a verdict:
clear: Agent Armor found no attempt to manipulate an agent. This is advisory, not a guarantee that the message is safe.review: the message may try to manipulate an agent. Have a person, or a more cautious path in your agent, look at it before your agent acts on it.
Turned on from Labs, Agent Armor never holds, delays or changes mail. Messages arrive and message.received fires as usual. The verdict follows, usually within seconds, on the message itself and as a message.security.completed event.
Turn it on
- In the console, open Settings, then Labs, and join AgentMail Labs. Only organization owners and admins can.
- Under Features in Labs, turn on Agent Armor.
Agent Armor then scans mail received by every inbox in the organization, starting within a minute. It does not scan mail received before you turned it on. Turning it off stops new scans; results already on messages stay. Leaving Labs does not turn Agent Armor off. If AgentMail set up Agent Armor for your organization, the console shows it as managed by AgentMail and you can’t change it there; this page describes the Labs setting.
Read the result
A message Agent Armor scanned carries an agent_armor object wherever the API returns the message: getting or listing messages, threads, and the message.received event. Its status is one of:
Treat unavailable like review: a sender can cause it, for example with a message too large to scan.
Get notified
Subscribe to message.security.completed to hear when a verdict is ready instead of polling. It is sent only for complete results: an unavailable result sends no event. To receive it on a webhook, list it in event_types. WebSocket subscriptions receive it unless they name other event types. Either way, the API key needs permission to read messages.
Add it to the webhook that already receives message.received. event_types replaces the webhook’s whole list, so include every type it should keep:
The event carries the result and the message’s identifiers, never its content:
It is sent once per message and inbox, and event_id is stable: use it to deduplicate retries. It is not sent for messages labeled spam, blocked, unauthenticated or trash; read their results through the API.
Act on a verdict
A simple pattern is to let your agent act on a received message only once its verdict is in:
- On
message.received, read the message’sagent_armor. If it is alreadyunavailable, go to step 4. If it ispending, store the message and wait until itsdeadline_at. - On
message.security.completed, fetch the message with the event’sinbox_idandmessage_id. - If the verdict is
clear, hand the message to your agent. If it isreview, route it to a person, or let your agent read it without tools that send mail, move money or change data. - If no event has arrived by
deadline_at, fetch the message: its result now readsunavailable. Handleunavailablelikereview.
Send feedback
Record whether a verdict was right. We use feedback to measure and improve Agent Armor.
URL-encode message_id in the path: <abc123@mail.example.com> becomes %3Cabc123%40mail.example.com%3E. The SDKs encode it for you.
notes is optional, up to 2,048 characters. The message needs a complete result, and accepts up to 20 pieces of feedback.
