---
title: Admin rights and API keys, from your phone
nav: Admin and keys
summary: When the Agent needs admin rights or an API key, a card appears on your phone: you type the password or paste the key there, it goes encrypted straight to your computer, and the Agent never sees it.
order: 12
---

# Admin rights and API keys, from your phone

Some things the Agent can't do alone: installing system software needs the admin password, and hooking up a new service needs your API key. Until now that meant going back to the computer to type a sudo password in a terminal, or pasting the key into the chat — where it stayed in the history and went to the model vendor too.

Both now happen on the phone. The Agent asks, your phone shows a card, you type the password or paste the key into it, and it travels encrypted straight to your computer. The Agent only gets the result; it never sees the password or the key.

## The admin password card

When the Agent needs to run a command as admin, it runs:

```bash
agentj sudo --why '<what it is for, in plain words>' --effect '<what it changes>' -- <command>
```

A card titled "Admin rights needed" appears on your phone, showing:

- "What it's for": the purpose in plain words, as the Agent wrote it, shown first;
- "Command": the full command, nothing left out;
- "What it changes": as the Agent wrote it;
- a countdown: the card is valid for 2 minutes.

When you've read it, type this computer's login (admin) password and tap "Approve and run"; if you don't want it to happen, tap "Decline".

If "What it's for" is too short, or just repeats the command, the card is not shown at all: the Agent has to say what the command is for first. Managing Agent J's own background service (start, restart, stop) never shows this card either: it needs no admin password, and neither does switching AI tools — see [Switch AI coding tool](/docs/switch-harness/).

- The password is encrypted on the phone so that only your computer, and only for this one card, can open it. The computer uses it for a single sudo run and then wipes it; it's never stored and never written to any log.
- The Agent gets the command's output and exit code, never the password.
- If the password is wrong, the card comes back and tells you how many tries are left — three per card. Three wrong passwords in a row lock all password cards for a minute; each further miss doubles the lock, up to an hour.
- "Stop everything" voids every open card at once. If the Agent's command is interrupted, a password card is withdrawn as well (a key card is not — see below).

## The key card

When the Agent needs an API key, it runs:

```bash
agentj secret request --name ELEVENLABS_API_KEY --purpose '<what it is for>' --dest env:<file>
```

The card on your phone is titled "A key is needed" and shows "Name", "Purpose", "Saved on the computer at", and how the "Check after saving" works. What you paste shows as dots. Tap "Save to computer" (or Enter) when it's in; tapping it with nothing pasted only asks you to paste first, it never counts as a no. "Don't provide" sits on its own line below and needs a second tap. The card is valid for 10 minutes.

- The key is encrypted and written straight into a file on your computer that only your system user can read. In a `.env`-style file only the `ELEVENLABS_API_KEY=` line changes; every other byte of the file stays as it was.
- Right after saving, the key can be tested: either by a read-only request to an https address, or by a read-only command that gets the key only in its environment. The card says which.
- When the check fails and the key is much shorter than this provider's keys usually are, the phone adds that it may not have been copied completely. Copy it again in full from the provider's dashboard and paste it. This looks at the length only, never at the key itself.
- The Agent's receipt holds only the name, where it was saved, its length, the first few characters of a fingerprint, and whether the check passed. It never gets the key itself and is told not to read or print that file; programs that need the key read it from the file directly.
- Even if the Agent's command is interrupted (say its terminal timed out), the key card stays on your phone and is saved when you submit. The Agent reads the outcome later with `agentj secret result <card-id>`.
- Every approval and refusal is recorded in an audit log on the computer, with no password and no key in it; `agentj secret log` lets you check it.

## The pickup card: your own secrets, on your phone

The other way round — you want back something of yours from the computer, like a proxy ss:// link or a config file with a password — the Agent runs:

```bash
agentj secret send --name 'Shadowrocket SS link' --value-from file:<file>
```

Your phone shows "Your Agent sent a secret pickup card", contents hidden. Tap "View with Face ID"; only then does the computer send it, and you can copy or download it. Tap "Done" and it is cleared from the page; the chat keeps only "picked up" and the time. It can be picked up once within 10 minutes, then the computer wipes it from memory. A phone without Face ID can't open it (the card offers "Set up Face ID"). It goes only to your own paired phones; Telegram, groups and friends still can't get these secrets.

## The admin helper (optional)

If typing the password each time gets old, install the admin helper:

`agentj sudo-helper install`

```bash
agentj sudo-helper install
```

`agentj sudo-helper status`

```bash
agentj sudo-helper status
```

`agentj sudo-helper sync`

```bash
agentj sudo-helper sync
```

`agentj sudo-helper uninstall`

```bash
agentj sudo-helper uninstall
```

- `install`: done once, through one ordinary password card on your phone.
- After that, admin cards on your paired phones show "Approve and run (no password)" instead of asking for the password.
- The helper runs as admin and checks three things itself before running anything: the approval was signed by your phone, it was given just now, and its one-time number hasn't been used. The Agent can call the helper but can't forge your phone's signature, so this does not give the Agent password-free admin rights. The helper only ever runs the one command shown on the card.
- `sync`: run it after pairing a new phone or removing one, so the helper's list of phones is current (it takes one password card too). Removing a phone doesn't update the list by itself, so remember to run it.
- `status` shows whether it's installed; `uninstall` removes it.

## Support and limits

- A paired phone can confirm with a passkey (such as Face ID) before entering the computer password. Touch ID on the computer is a separate authorization path.
- It doesn't work on Windows.
- Macs have been used successfully on real hardware: password and secret cards worked on multiple customer Macs on 2026-10-08. A Mac with sudo fingerprint / Touch ID enabled may still show another authorization dialog on the computer. At the computer, disable sudo Touch ID while preserving password authentication; see [Keep the computer awake](/docs/keep-awake/) for checks and recovery.
- Once a key is in a file, the Agent runs as the same system user as you, so technically it could read that file. What we guarantee is that the key never passes through the chat, logs or git, and never crosses the phone-to-computer channel in plain text; the Agent is explicitly told not to read or print it.

Our servers only pass along encrypted data and never see your password or key. More in [Data security](/docs/privacy/); everything else on the phone is in [Using it on your phone](/docs/phone/).
