Borrowed credentials: how to give an AI agent an identity you can audit

Borrowed credentials: how to give an AI agent an identity you can audit

• 8 min read
    Tags:

    Security review is the blocker most teams name when they haven’t given an AI agent its own identity. Nylas surveyed 1,030 people who build, buy, or influence AI systems in September 2026 for The State of Agentic AI: H2 2026. Of the 551 whose organizations haven’t given agents a dedicated identity, 56% named security review as what stopped them. Technical complexity was a distant second at 37%.

    Hesitating makes sense. A new mailbox that software controls is one more thing to approve. The trouble is what teams fall back on while they wait. 23% of respondents run agents through a shared team inbox or through OAuth on a human employee’s account, and those two setups have the weakest audit numbers in the survey.

    An AI agent identity is an email address, calendar, and set of credentials that belong to the agent itself rather than to a person or a shared team inbox. Every message and event the agent creates carries that identity, so its actions can be traced, limited, and revoked on their own.

    Which agent authentication methods are easiest to audit

    We asked respondents whether their team could produce a full record of what its agents did last week, including which agent took which action. The share who said yes depends on how the agent gets into email and calendar:

    • Dedicated identity with its own email address and calendar: 66%
    • API credentials with no communications identity: 62%
    • Dedicated service account: 53%
    • Shared team inbox: 52%
    • OAuth on a human employee’s account: 51%

    The gap that matters is narrower than “dedicated identity versus everything else.” API credentials come within four points. The drop comes when the agent acts as someone. The mailbox records a person or a team as the sender, and finding the agent behind a message means matching application logs against inbox history after the fact.

    These numbers are self-reported, and they show a correlation. Teams that give agents their own identities may be more careful in other ways too. Still, the direction fits what an incident review looks like in practice. 54% of respondents had an agent do something wrong in the past 90 days, and 18% had one send an incorrect or inappropriate email. When that email went out from a colleague’s account, the first question is whether the colleague sent it.

    What a security reviewer needs answered

    A review of an agent with email access usually comes down to four questions. Each one maps to a design decision you can make before the review:

    → Attribution. Whose name is on the message, and can you trace it to one agent?
    → Reach. Which recipients and domains can it send to, and how much?
    → Control. How fast can you stop it, and does stopping it affect anyone else?
    → Evidence. What record exists of each action, including who approved it?

    A borrowed login answers all four badly. The sender is a person, the reach is everything that person can reach, stopping the agent means revoking a colleague’s access, and the evidence is the colleague’s sent folder.

    How to give an AI agent its own identity

    Give each agent its own address

    Use one identity per agent, not one per team. With Nylas Agent Accounts, that’s a single API call against a domain you’ve registered:

    curl -X POST https://api.us.nylas.com/v3/connect/custom \
      -H "Authorization: Bearer $NYLAS_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "provider": "nylas",
        "name": "Renewals Agent",
        "settings": {
          "email": "renewals@agents.yourcompany.com"
        }
      }'

    The response returns a grant_id. That ID is the agent’s identity from then on. Every later API call uses it, and every webhook the account fires carries it. The name field becomes the default From name, so customers see “Renewals Agent” instead of a colleague. If you’d rather work from the terminal, the CLI does the same thing with nylas agent account create.

    A subdomain like agents.yourcompany.com keeps agent mail easy to separate in your DNS and mail logs. It also gives a reviewer one place to look.

    Set limits before it sends anything

    Agent Accounts sit in workspaces, and policies and rules attach to the workspace, not to individual accounts. A policy sets send limits, spam detection, and retention, and one policy can cover many agents. Rules match both inbound and outbound mail. An outbound block rule rejects a send before it reaches the email provider, and it can check recipients against a list you maintain, such as personal email domains or domains you never want an agent contacting.

    Set the policy first, then create the account inside that workspace with workspace_id. That way the reviewer approves the limits along with the agent, and nothing sends before the limits exist.

    What an AI agent audit log should record

    Subscribe to the account’s webhooks: message.created fires for inbound mail and for sent copies, event.created fires when an invite creates an event, and the deliverability triggers cover bounces and rejections. Because each agent has its own grant, every event already says which agent it came from. Your job is to add the context Nylas doesn’t have: which workflow triggered the action, which version of the agent ran, and whether a person approved it.

    Here’s an example of a record your system could write. The field names are illustrative, not a Nylas output format:

    {
      "timestamp": "2026-12-02T16:04:11Z",
      "agent": "renewals-agent",
      "agent_version": "1.14.0",
      "grant_id": "b1c2d3e4-5678-4abc-9def-0123456789ab",
      "sender": "renewals@agents.yourcompany.com",
      "action": "message.sent",
      "thread_id": "18c2f0a9e41d7b3c",
      "recipients": ["buyer@customer.com"],
      "triggered_by": "crm.renewal_due:opp_48213",
      "approval": { "mode": "human", "approved_by": "j.ortiz@yourcompany.com" }
    }

    Now picture the same record for an agent on a borrowed login. The sender field reads jordan@yourcompany.com. The approval field is ambiguous at best, because the person who supposedly approved the message is also the one the message claims was its sender. 30% of respondents still require approval on every agent action. If that’s your team, store the approver next to the action, under a sender that isn’t the approver.

    Retire it like a credential

    When the agent is retired, delete its account (nylas agent account delete). Its access ends with it, and no human account changes. Compare an agent running on an employee’s OAuth token: it breaks when that person leaves, or it keeps running on a token nobody owns anymore. Either outcome is harder to explain to a reviewer than a delete command.

    Getting an agent identity through security review

    Each step above answers one of the reviewer’s questions. A dedicated address handles attribution. A workspace policy sets reach. A per-agent grant you can delete gives control. A record keyed to that grant is the evidence. The 56% who stopped at security review were right that it deserved a review. The fix is to show up with these four answers already built.

    Frequently asked questions

    Should an AI agent use a human employee’s email account?

    It depends on whose work the agent is doing. An assistant that works in one person’s mailbox on that person’s behalf should use delegated OAuth access with narrow scopes. An agent that acts on its own, like a support or renewals agent, needs an identity of its own if you want to audit it. In the survey, 51% of respondents whose agents use OAuth on a person’s account could produce a full audit record, against 66% with a dedicated identity.

    Is a service account enough for an AI agent?

    It beats a borrowed login for control, but service accounts had a 53% full-audit rate in the survey.

    What should an AI agent audit log include?

    At minimum: the agent and its version, the identity it acted as, the action, the recipients, what triggered it, and who approved it, if anyone did.

    Where Nylas fits

    Nylas Agent Accounts give each agent a hosted mailbox and primary calendar on your own domain, created from the API, the CLI, or the Dashboard. The grant_id works with the same Email, Calendar, Contacts, and Webhooks endpoints as any connected account, so your audit pipeline doesn’t need a separate integration. The platform is SOC 2 Type II compliant. To get one running, use the Agent Accounts quickstart.

    The identity and audit findings in full are in The State of Agentic AI: H2 2026, no form required.

    Agentic AI guides from Nylas

    Industry insights

    Build guides

    Related resources

    How to authenticate an AI agent with a user’s email account (Gmail and Outlook)

    How an AI agent gets delegated access to a user’s Gmail or Outlook inbox with OAuth, which scopes to request, and how to support both providers with one API.

    Web Summit Lisbon 2026: Agent traffic is here and the web wasn’t built for it

    Notes from Web Summit Lisbon 2026 on agent identity, AI-led buying, bot traffic and what SaaS is for when building is cheap.

    Your product might be the vendor they replace

    Two in three respondents say their company is considering replacing a vendor or tool with…