# Save logins for Agents

> Save a test account to your Team's Passwords from an Agent's card or in Settings, and fill it into the Preview.

Source: https://air.build/docs/agents/save-logins-for-agents/

Your Team has one shared list of logins called **Passwords**. Agents use it when they need to sign in, for example to log in to the app you're building with a test account while they check it in the Preview. Anyone in the Team can add, see, change or delete these logins, and every Agent in the Team can read them.

> [!WARNING]
> "Everyone on the Team and all of its Agents can see these. A value filled into a preview stays there as plain text. Save test accounts only, not personal accounts or production keys."

To let an Agent work in a service like Linear or Figma, use a Connection instead. See [Connect an Agent to outside services](https://air.build/docs/agents/connect-outside-services/).

## Save a login when an Agent asks

When an Agent needs a login, it posts a card in chat. The card's title is the name the login will be saved under, for example "Staging test account". Under it there may be a line from the Agent, then one box for each field, such as **Email** and **Password**. The Agent may have filled some boxes in already.

1. Fill in every box. Password boxes hide what you type.
2. Tap **Submit**.

Until every box is filled, the button shows how many are done, for example **Submit (1/2)**. Every field is needed.

When it's saved, each field on the card shows dots, even the username, and the values aren't kept anywhere in the chat. The Agent is told only the login's name and its field names: `Saved to Passwords as "Staging test account" (fields: Email, Password).`

If a login with the same name is already in Passwords, the new one replaces all of its fields.

Anyone in the chat can fill in the card, not only the person the Agent was talking to.

## Add a login yourself

**iPhone**

Open **Settings**, tap your Team under **Teams**, then tap **Passwords**.

**Mac**

Open **Settings**, click your Team in the sidebar, then click **Passwords**.

1. Tap **Add Password** (the **+** in the toolbar).
2. Type a **Title**. Agents find the login by this name.
3. Fill in **Username**, **Password** and, if you want, **Note**.
4. Tap **Save**.

**Save** stays off until there's a title and a **Username** or a **Password**. Empty fields aren't saved.

To change a login, open it and tap **Edit**. A login an Agent's card saved keeps its own field names, such as **Email** or **API Key**. You can change the values, not the fields.

To delete one, open it and tap **Delete Password**, or swipe its row (on the Mac, right-click it) and choose **Delete**. The app asks to confirm: "Agents can no longer use this sign-in."

For everything on this page, such as copying a value or the errors it shows, see Settings › [Teams](https://air.build/docs/settings/teams/).

## Fill a login into the Preview

You can type a saved login into the app running in the Preview without looking it up.

1. In the Preview, tap the field in your app where the username or password goes.
2. Open the Preview's **⋯** menu and choose **Passwords**.
3. Choose the login, then **Fill Username** or **Fill Password**.

The Preview briefly shows **Filled** followed by the field's name. The value is pasted into the field you selected. The login's menu only offers the fields it has: a username-type field (such as **Username** or **Email**) and a password-type field (such as **Password** or **Token**).

If Passwords is empty, the menu says **No Passwords**. Choose **Add Password…** in the same menu to save one without leaving the Preview.

Agents fill logins into the Preview the same way. See [Run your app in Preview](https://air.build/docs/build/preview-your-app/).

## How Agents use a login

Agents read Passwords with the `password-book` command. It lists the logins by name and field names, and an Agent reads a value only when it needs to use it. Agents can't add, change or delete logins: a person does that, from a card or in Settings. See [password-book](https://air.build/docs/cli/password-book/).

## Questions

**Fill didn't work**

The Preview says "Unable to fill" followed by the field's name and "Try again." Tap the field in your app again, then choose **Fill Username** or **Fill Password** again.

**Saving says Another password already has this name.**

Each login in Passwords needs its own title. Choose another one, or edit the existing login instead.

**Can I see what I typed into the card?**

Not on the card: it only shows dots. Open the login in **Settings** › your Team › **Passwords** to see or copy the values.

**Can only some Agents use a login?**

No. Every login in Passwords is shared with the whole Team and all of its Agents.
