Skip to content
Blog / Engineering

Human or Agent? How to Tell Who Acted in Your Email and SaaS Logs

Binoy Perera

Logs name whoever held the credential, so agents on shared accounts hide in them. See how to tell human from agent actions and where an email address helps.

  • identity
  • audit-trail
  • governance
  • ai-agents
  • security

TL;DR

Most logs name whoever held the credential. An AI agent running on a shared service account or a person's token shows up as someone else. Telling human actions from agent actions starts when each agent gets its own named identity and a recorded owner. An email address on your domain is a practical first identity for an agent, because other systems already understand it.

Suppose a customer's finance lead replies to your CFO with a screenshot of a payment reminder that went out while the invoice was in dispute. The CFO asks IT one question: who sent that? The security team pulls the logs and finds a service account called svc-automation, which every automation in the finance stack shares.

Nobody can say which automation sent the reminder, who owns it, or whether a person approved it. The log is accurate. It names the account that held the credential, and the credential was shared. The fix starts with giving each agent its own identity and a named owner, and an email address on your domain is a practical first one.

The log names whoever held the credential

A log line records the credential that made the call, not the software or the person behind it. To tell a human from an agent, the agent has to be a principal of its own. A principal is an identity a system can see, such as a user, a service account or an agent.

Whether an agent has its own principal is decided when access is issued, so no log tool can add it later. If an agent signs in with a shared key, every system it touches records the key's owner. The Cloud Security Alliance ran a survey for Aembit in January 2026 and got 228 responses from IT and security professionals. It found that 68% of organizations can't clearly distinguish between human and AI agent activity.

Three ways agents land in your logs today

An agent lands in your logs under a shared service account, a person's token or a principal of its own. The first two are common. In the same survey, 52% of organizations use workload identities, 43% rely on shared service accounts, and 31% allow agents to operate under human user identities.

A shared service account logs the account. Any script or agent that holds the key looks identical, and nobody can revoke one of them without breaking the rest. The owner of the account is whoever created it, which may be nobody who still works there.

A person's token logs the person. This is worse than a missing name, because the log is wrong. It says a human did it. The agent also holds everything that person can reach, so a mistake carries the full reach of that person.

An agent with its own principal logs the agent. The log line says so, and the principal can be switched off without touching anyone else's access. The line still does not say who is responsible for the agent.

Delegation leaves two names, impersonation leaves one

When an agent acts for a person, a well-built system records both of them. OAuth 2.0 Token Exchange, specified in RFC 8693, separates the two cases. With impersonation, the receiving system deals with the person and cannot tell the agent was involved. With delegation, the agent keeps its own identity and the token records that it acts on the person's behalf. In the token, the sub (subject) claim names the person and the act (actor) claim names the acting party.

The practical test is whether the log shows both names. An Okta post on privileged access makes the same case. "The agent accessed the server" is a weaker statement than one that names the agent and the person who started the session. In the demo it describes, the human user ID is present on every event in the chain. Ask every tool that lets an agent act for someone whether it logs one name or two. A borrowed token logs one.

Four questions every agent log line has to answer

An agent log line is usable for attribution when it answers four questions: actor, owner, authority and approval. The six controls in our enterprise-readiness guide say what an audit log should capture. These four test whether a line can be attributed.

Actor. Which principal did this? It must be the agent's own, not a shared account and not a person.

Owner. Which named human or team answers for that agent? A Cloud Security Alliance and Oasis survey asked 383 IT and security professionals. It found that 78% of organizations don't have documented and formally adopted policies for creating or removing AI identities. Where no one writes the owner down at issue time, no one can name it later.

Authority. What was the agent allowed to do when it acted? A scope, a send list or a permission set answers this, and it has to be configuration rather than an instruction in a prompt.

Approval. Did a person approve this action or the standing permission behind it? Only your own records can answer that, so write it down when the agent is issued.

The agent's name starts with an email address

An email address on your domain is a practical first principal, because it is a name outside systems already understand. Each AgentMail inbox has its own address, message store and thread history, and credentials can be scoped to that inbox.

Make an inbox-scoped API key an explicit step when you issue the agent, or give it its own pod, an AgentMail container that isolates inboxes and their credentials, with a pod-scoped key. Organization-level keys are not isolated to a pod. Agents that share one look alike to AgentMail.

An agent with its own address can be signed up to other tools under it. Depending on the tool, the same name can appear in that tool's logs. AgentMail's per-inbox logs can then be joined, in your SIEM, with any other log that records the same address.

The inbox keeps the send and receive record, and the API lists it. Webhooks deliver each message.received event, one per new incoming email, as it happens.

Allow and block lists set who an agent may send to or receive from. That turns the authority question into configuration you can show an auditor.

The Python SDK, installed with pip install agentmail, can export recent sent messages for a SIEM. The block below was run against a lab inbox on agentmail 2.0.25. It prints the 50 most recent sent messages, one JSON line each, with the inbox you query as the actor field.

Python

# export an inbox's 50 most recent sent messages as JSON lines for a SIEMimport jsonimport osfrom agentmail import AgentMail# AGENTMAIL_API_KEY should be an inbox-scoped key for this one inboxclient = AgentMail(api_key=os.environ["AGENTMAIL_API_KEY"])inbox_id = os.environ["AGENTMAIL_INBOX_ID"]sent = client.inboxes.messages.list(inbox_id, labels=["sent"], limit=50)for message in sent.messages:    print(json.dumps({        "actor": inbox_id,        "sent_at": message.timestamp.isoformat(),        "message_id": message.message_id,        "to": message.to,        "subject": message.subject,    }))# output: one JSON line per sent message, with the keys actor, sent_at, message_id, to and subject

In the lab run the actor value was the inbox's email address. Your directory or ticketing system can hold that same string next to a named owner. A SIEM that ingests this export and a list of addresses with their owners can join the two on that string. Each log line then resolves to a named owner. For live delivery instead of a periodic export, the webhooks guide covers the events.

One bad send, reviewed three ways

The same payment reminder, sent three ways, leaves the reviewer with three different answers. In each case the question is the CFO's: which of ours sent this, and who answers for it?

On the shared service account, the log names svc-automation. The reviewer can find every automation that holds the key and has to read their code to guess which one sends reminders. The owner is whoever created the account. Switching it off stops the whole finance stack.

On a person's token, the log names the collections manager, as if the manager had sent it. The manager says they did not, and now an employee is part of an incident review for something their token did without them. Revoking the token cuts the manager's own access.

On the agent's own address, the log names the collections agent's address on your domain. The reviewer looks the address up in the directory and finds the team that owns it. The message sits in that inbox's sent list, in its thread, with the recipient. Revoking that inbox's scoped key stops this agent's email. The others keep running. Any accounts it holds in other tools under that address have to be revoked in each tool.

The one question still open is approval, which depends on whether you recorded the standing permission when you issued the agent.

SetupWhat the log namesWhere the owner isStop only this agent
Shared service accountThe shared accountWhoever created the accountNo, it stops every automation
A person's tokenThe person, as if they sent itThe wrong personNo, it cuts that person's access
The agent's own addressThe agent's addressThe record you keep for that addressYes, if it has its own scoped key: revoke that key

What AgentMail does not do

AgentMail's logs cover the email an agent sends and receives, not what it did in other tools. Whether a tool logs the agent's address depends on that tool, so check its audit log. AgentMail also does not replace your directory or identity provider, which is where the owner and approval records belong. The security and enterprise pages say what the platform covers.

FAQ

Questions, answered.

Look at the sending address. If each agent has its own inbox, the address names the agent, and the inbox's sent list shows what it sent. If agents share a mailbox or send from a person's account, the address names that account. Nothing in the message separates the agent from the human.

List every automation that uses the account and write down who owns each one. Then give them their own principals one at a time, starting with the agents that send email to people outside the company. Keep the shared credential until the last agent has moved, and retire it then.

Yes. The address tells you which agent acted, but only a record you keep tells you who answers for it. Store the owner next to the address in your directory or ticketing system when you issue the agent. A reviewer can then go from the log line to a person in one lookup.

That depends on the tool. Many tools let you create an account under an email address, so an agent can be set up there with its own address. AgentMail does not control what any tool records. Check that tool's audit log for the address before you rely on it.

Blog

Suggested reading

View all posts

Engineering · September 10, 2026

How to make AI agents enterprise ready: six controls buyers actually ask about

An AI agent is enterprise ready when its limits hold without the model's cooperation. Six controls decide it: whitelisting, authentication, prompt injection screening, permissioning, multi-tenancy, and auditability. If a control depends on the model cooperating, it is not a control.

Prompt

Give yourself access to AgentMail by following the guide at:

https://docs.agentmail.to/agent-onboarding.md

and refer to:

https://docs.agentmail.to/llms.txt

for the documentation index.

Start integrating AgentMail into your AI agents today.