Confirm sensitive CLI commands
Confirm deletes, secret reads and access changes from the CLI with Touch ID, a security key, Windows Hello or a passkey, and choose when your own CLI sessions ask.
A CLI session that must confirm asks for your device key or your passkey before a sensitive action when your last confirmation is older than your confirmation window: five minutes unless you choose more (up to 60, or less than your organization's cap). Console sessions and access keys never ask.
These actions are sensitive:
- every action marked destructive in the
::iam-actionstables of the guides; - reads of secret material or source code (the actions marked sensitive);
- every IAM change;
- actions that hand out another credential:
git:CreateAccessToken,s3:CreateAccessKey,s3:CreateTemporaryCredentials,eks:GetClusterAdminCredentials,ecr:GetAuthorizationToken,npm:GetAuthorizationTokenandci:CreateIdToken.
A session confirms when your organization requires Touch ID or a passkey (see Require Touch ID or a passkey for the CLI), and otherwise as your own setting says: by default, sessions opened with a device key (Touch ID, a security key, Windows Hello) confirm and browser sessions do not.
Prerequisites
- A CLI session from
dcloud login(see Sign in the CLI). - A device enrolled with a passkey that can confirm (a Mac with Touch ID, a security key with a PIN, a PC with Windows Hello), or a passkey on your account (see Add a passkey).
- No IAM action is needed to confirm or to change your own setting. The action itself still needs its permission: after the confirmation, a refused action is answered 403 as usual. Most actions are checked against your policies before a confirmation is asked; some sensitive reads are refused with a plain 403 while a confirmation is due, and the CLI then asks for one before it learns whether your policies allow the read.
Confirm a command
Not available in Console. The console never asks for a confirmation.
- Run the command. When a confirmation is due, the CLI says the action needs a fresh confirmation.
- When the profile has an enrolled device key, confirm with it: the Touch ID prompt on a Mac (it
names the action), a touch of the security key and its PIN on Linux, the Windows Hello prompt on
Windows. When the key cannot confirm (enrolled without a passkey, or a security key without a
PIN), the prompt still appears, the CLI then prints
This device key cannot confirm it is you (a software key, or one enrolled without a passkey). Confirm in the browser with your passkey.and goes on in the browser. In the browser, and on a profile without a device key, the CLI prints a code and the/activateaddress: on the page Approve a device, which shows Confirm a command, choose Confirm with passkey and confirm with your passkey.
The CLI sends the command again and prints its result.
With an enrolled Mac or Windows PC that can confirm, its prompt appears even for a command run from
a script. When the confirmation would go to the browser, a command without a terminal cannot open
it and fails with … needs you to confirm it, and there is nobody at this terminal. Confirm once in a terminal first;
the commands within your confirmation window run without asking:
dcloud auth verifydcloud auth whoami shows when you last confirmed under Confirmed.
For most actions, the API answers a due confirmation with 403, the code STEP_UP_REQUIRED and, for
example,
secrets:DeleteSecret needs you to confirm it with Touch ID or a passkey (last confirmation more than 5 minutes ago).
Some sensitive reads answer a plain 403 Forbidden instead.
A device that an administrator blocked in the organization cannot confirm there: the CLI prints
An administrator blocked this device for the organization and confirms in the browser instead.
A confirmation in the browser needs a passkey. Without one on your account, the page says
Your organization or your account requires a passkey here, and your account has none yet. and
offers no approval.
Choose when your CLI sessions ask
- Open My account. Under Command line sign-in, find Confirm sensitive commands.
- Choose one:
- When I sign in with Touch ID, a security key or Windows Hello (default): sessions opened with a device key confirm, browser sessions do not.
- Always, and only sign in with one of those or a passkey: every CLI session of yours confirms, signing in needs a device key that verifies you or a passkey, and connecting an app (an AI assistant over MCP) needs a passkey.
- Never: no confirmations.
- For any choice but Always, and only sign in with one of those or a passkey, confirm with your passkey.
The setting is saved at once, and the console says Setting changed. It applies in every organization you belong to.
Not available in CLI. The CLI has no command for this setting.
While your organization requires Touch ID or a passkey, the choice shows Always, and only sign in with one of those or a passkey and cannot be changed. Choosing Always, and only sign in with one of those or a passkey stops your CLI sessions that were opened without Touch ID or a passkey, and
the apps you connected without a passkey, at their next request. Without a passkey on your account,
loosening the setting is refused with 400 Your account has no passkey yet.
Choose how long a confirmation lasts
- Open My account and go to Command line sign-in.
- Under A confirmation lasts, choose 5 (the default), 10, 15, 30 or 60 minutes. A longer time asks for your passkey first; a shorter one does not. Times above your organization's cap cannot be chosen.
dcloud auth whoami shows the time under Confirmation lasts.