How to let an AI agent log in on a phone without seeing your password

Type it yourself, or replay a saved login that reads the password from an environment variable. What phonedriver hides, and what it does not.

To keep a password from an AI agent, do not give it to the model. Type it on the phone yourself, or have phonedriver replay a saved login that reads the password from an environment variable. Passing it with secret keeps it out of logs, but the model has already read it.

Does the model see the password?In phonedriver's logs, traces and replies?
You type it on the phoneNoNo
replay reads it from the environmentNo, unless it can read that environmentNo
The agent types it with MCP secret: trueYes, you gave it to the modelNo, it shows as •••
The agent types it without secretRefused in a password or one-time code fieldNo

Type it yourself

Tell the agent to stop at the login screen, sign in on the phone, then tell it to go on. This is the safest of the three, and the one to use for a bank, an email account or a one-time code.

Replay a saved login

Log in once with a throwaway test account and save the steps:

$ phonedriver save login.steps
saved 3 steps to login.steps
1. tap "Sign in"
2. type secret $PHONEDRIVER_SECRET_1 into "Password"
3. tap "Continue"

The file has no password in it, only the variable's name. Then run it from your own terminal with the real one:

export PHONEDRIVER_SECRET_1
read -rs PHONEDRIVER_SECRET_1
phonedriver replay login.steps
unset PHONEDRIVER_SECRET_1

With MCP, set the variable in the server's env, never in a tool argument. In CI, use a repository secret. A replay types a secret only into a password or one-time code field.

Limits

  • An agent with a shell can read what you can read. If the password is in a config file or in the environment the agent runs in, it can be printed. Run the replay from a terminal the agent does not have.
  • A screenshot shows what the phone shows. A field that displays the password shows it in a picture too.
  • Unlabelled one-time code boxes are not recognised. The refusal goes by the field's type and words.
  • On a Mac over Wi-Fi, iPhone traffic is not encrypted, secret text included. Use the cable (why).

The rules are in the approval guard page.