Skip to content
seattlecompute/smith
← blog

AI agent authentication: how agents log in without leaking passwords

· Avi Agola, The Seattle Compute Company

Most of the trouble with AI agents shows up at the login screen. An agent that cannot get in is useless, and an agent that gets in carelessly is a risk. This page covers the mechanics: what the options are, what each one is good for, and where they break.

For the question of whose account to use, see delegated vs agent-owned identity. This page is about how the sign-in itself works.

What "authentication" means for an agent

Authentication is proving who you are to a system. For a person that means a password and maybe a code on a phone. An agent is a non-human identity, and it has the same problem with fewer natural ways to solve it. It has no phone in a pocket and no habit of noticing when something looks off.

So the practical questions are:

  • Where does the credential live? In the agent's context, or somewhere it cannot read?
  • Whose credential is it? Yours or the agent's?
  • What happens at the second factor? Who can approve a code?
  • Can you trace and revoke it? After the fact, and fast.

The main ways an agent gets in

API keys. A long string the agent sends with each request. Simple, and good for services that offer one. The catch is that a key in a prompt or a file is a key anyone reading that prompt or file can copy. Many scopes are also broader than the job needs.

OAuth. The app grants the agent a token for specific actions, and you can revoke it without changing a password. It is the cleanest option when a service supports it, and many do not support the thing you need.

Passwords through a browser. A lot of useful work sits behind sign-in pages with no API, so the agent works the page like a person would. See what a computer use agent is. This is the route that needs the most care, because the password is the whole key.

Saved sessions. Staying signed in avoids repeated logins, but a session eventually expires, and then the agent is back at the door.

The vault approach

The risky pattern is pasting a password into the agent's instructions. Anything the agent can read, it can repeat, leak into a log, or be tricked into handing over.

The alternative is a vault. The password sits in an encrypted vault, and the vault fills in the sign-in on the right site. The agent triggers the login but never sees the password. That is how Smith handles work behind a login. Keeping AI agents safe goes through the rest of the setup.

Two kinds of second factor

2FA is where unattended agents most often stall, and it helps to split it in two.

  • Factors the agent owns. If the agent has its own email and its own accounts, codes sent there are within its reach. It can clear these itself.
  • Factors on the owner's device. A prompt on your phone, or a hardware key, belongs to you. The right move is for the agent to stop and hand the step to a person, not to work around it.

The second kind is not a bug. It is the control doing its job. A good setup makes the handoff quick: the agent says what it needs, you supply the code, and it carries on. If you want a person to take over the live screen for a step, that is possible too.

Who is the identity?

Two models, in one line each:

  • Delegated. The agent works from your account. Good when the account carries a network or reputation, like a professional profile.
  • Agent-owned. The agent has an account of its own. You can revoke it without touching your login, and the record shows the agent, not you.

Either way, the record should say which agent did what and under which account. Setting up agent accounts covers the practical steps.

What breaks

  • Expired sessions. The agent was fine yesterday and is locked out today.
  • Unexpected 2FA. A site asks for a code it did not ask for last time.
  • Sites that do not want automation. Some block it outright. Sometimes there is an official route, and sometimes the right answer is that the agent should not be there.
  • Shared logins. Two agents on one account, and nobody can tell which one did something.
  • Over-broad access. An agent with more reach than the job needs.

A short checklist

  1. Prefer OAuth or a scoped API key where the service offers one.
  2. Where you need a password, keep it in a vault, not in the agent's context.
  3. Decide per account: yours or the agent's.
  4. Know in advance which second factors the agent can clear and which go to a person.
  5. Keep an audit trail that ties every action to an agent and an account.
  6. Keep a way to revoke access and stop a running job.

Pair this with a plain read of what your agent is and is not allowed to do. The autonomous AI agent page covers the limits worth setting. When you are ready to try it, get started.

FAQ

How do AI agents log in to websites?

Either through an official API using a key or OAuth, or by working the sign-in page the way a person would. For the second route, a vault can fill in the credentials so the agent never reads the password.

What is a non-human identity?

An account, key or token that belongs to software rather than a person. An AI agent is one, and it needs the same things a person's account does: access you can limit, revoke and trace.

Can an AI agent handle two-factor authentication?

Some of it. Codes the agent owns, like those sent to its own email, it can clear itself. Codes on your phone or another device only you hold need a person to step in.

Should an agent use my password or its own account?

It depends on whether the account itself is the asset. Where it is, the agent works from yours with the password in a vault. Where any account will do, give the agent its own.

Hire your first AI employee.

Email acme@agents.seattlecompute.com and an agent writes back.