Best for · Password managers
1Password AWS CLI: set up the shell plugin, add MFA, and know when not to use it
- Last checked
- 3 sources, linked below
- By the vectaai team
We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.
Verdict Our pick
The bar guide has a call.

- the 1Password plugin if you must use IAM user access keys and want them off your disk.
- AWS console login or IAM Identity Center if you can: AWS's own CLI guide ranks short-term credentials first and marks long-term IAM user keys as not recommended.
- credentialprocess only if you know why; AWS also marks external storage as not recommended.
Compared here
- 011Password AWS shell plugin
- 02AWS console login or IAM Identity Center
- 03AWS credential_process with an external store
Short answer
To use 1Password with the AWS CLI, install 1Password CLI 2.9.0 or later, turn on the desktop app integration, run op plugin init aws, import or pick your access key item, then add source ~/.config/op/plugins.sh to your shell profile. After that every aws command asks for your fingerprint or system password, and 1Password injects AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as environment variables, so you can delete the plaintext ~/.aws/credentials file. Add a one-time password field and an mfa serial field to the item and the plugin swaps in temporary session credentials.
Pick the 1Password plugin if you must use IAM user access keys and want them off your disk. Pick AWS console login or IAM Identity Center if you can: AWS's own CLI guide ranks short-term credentials first and marks long-term IAM user keys as not recommended. Pick credential_process only if you know why; AWS also marks external storage as not recommended.
Sponsored links. We may earn a commission; it never changes the pick.
At a glance
| Method | What it does | Credential lifetime | AWS's own ranking | Best for |
|---|---|---|---|---|
| 1Password AWS shell plugin | Stores access keys in 1Password, injects them as env vars after biometric unlock | Long-term keys; temporary session if MFA fields are set | IAM user long-term credentials: not recommended | Solo devs and small teams stuck with access keys |
| AWS console credentials login | Logs the CLI in with your console sign-in | Short-term | Recommended, listed first | Anyone who can use it |
| IAM Identity Center (SSO) | aws configure sso, then aws sso login | Short-term | Security best practice with AWS Organizations | Teams and companies |
| credential_process with an external store | CLI runs a program that returns credentials | Depends on the store | Not recommended; only as secure as the store | Special cases and custom tooling |
Money talk first. 1Password lists no public consumer affiliate terms, and our link may or may not ever pay us. Bitwarden pays nothing at all. Neither fact matters much here, because the best advice on this page is partly "use AWS's own short-term login instead", which earns nobody anything.
The honest part: we did not run this setup on our own AWS account for this page. Every command and field name below is quoted from 1Password's AWS shell plugin docs and the AWS CLI authentication guide, read on 3 December 2026.
Why bother: the plaintext credentials file
Run aws configure the classic way and your access key and secret land in ~/.aws/credentials as plain text. Any script, any malicious npm package, any backup tool that reads your home folder can read them. Leaked AWS keys are how a lot of surprise crypto-mining bills start.
The 1Password shell plugin moves those keys into your encrypted vault. When you run an aws command, 1Password asks for your fingerprint or system password, then hands the keys to that one command as environment variables. Nothing sits on disk.
What you need first
From 1Password's docs:
- A 1Password subscription. The pricing page shows Individual at $2.99 a month in a first-year promo for new customers (regular $3.99), Families at $4.49 (regular $5.99), both billed yearly, with a 14-day free trial and no card needed.
- The 1Password app for Mac or Linux, signed in.
- 1Password CLI 2.9.0 or later.
- CLI integration turned on in the desktop app.
- The AWS CLI installed.
- An AWS config file at
~/.aws/config. No config yet? Runaws configureand skip the access key questions, so nothing gets written to disk.
Supported shells: Bash, Zsh and fish.
Setup, step by step
Step 1: sign in and start the plugin
op signin
op plugin init aws
Optional: cd into a project folder first if you want this setup tied to that folder.
During op plugin init aws you choose:
- Import into 1Password to save new credentials, or Search in 1Password to pick an existing item. Use Expand search if it does not show up.
- A default scope:
- Prompt me for each new terminal session: current session only.
- Use automatically when in this directory or subdirectories: per project.
- Use as global default on my system: everywhere.
Precedence: session beats directory, directory beats global.
No access key yet? Create one in IAM, and the 1Password browser extension can save the secret as an item when prompted. Read the next section before you do.
Step 2: source plugins.sh
op plugin init prints the exact line. The common one:
source ~/.config/op/plugins.sh
Make it permanent, for Zsh:
echo "source ~/.config/op/plugins.sh" >> ~/.zshrc && source ~/.zshrc
For Bash, swap in ~/.bashrc. For fish, ~/.config/fish/config.fish.
Step 3: test it
aws sts get-caller-identity
You should get a biometric or system password prompt, then your identity.
Step 4: delete the plaintext file
Remove the keys from ~/.aws/credentials. One warning from 1Password: if other tools such as Terraform read that file, set up their shell plugins first, or they will break.
How the plugin maps fields
1Password injects these environment variables:
| 1Password field | Environment variable |
|---|---|
| Access Key ID | AWS_ACCESS_KEY_ID |
| Secret Access Key | AWS_SECRET_ACCESS_KEY |
| Default region (optional) | AWS_DEFAULT_REGION |
If you create the item by hand, use those exact field names. If a field is missing, the CLI asks you to rename one.
Adding MFA
Two ways, per the docs:
- Put the MFA device ARN in a profile in your AWS config file.
- Store MFA in the 1Password item:
- Add a One-Time Password field using the secret key AWS shows during virtual MFA setup.
- Add a text field titled
mfa serialwith the MFA device ARN.
With those fields in place, the CLI sets AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN to temporary session values. That is a real upgrade: what your command sees expires. If the code is not picked up, check the field titles: one-time password and mfa serial.
Multiple roles and profiles
Define role profiles in ~/.aws/config:
[profile prod]
role_arn = arn:aws:iam::123456789012:role/prod
source_profile = wendyappleseed
Then:
aws sts get-caller-identity --profile prod
or set it for the session:
export AWS_PROFILE=prod
Combine this with directory defaults and your client-a folder uses one 1Password item while client-b uses another, without you thinking about it.
Inspect, clear and stop using it
op plugin inspect aws
op plugin clear aws
op plugin clear aws --all
clear removes defaults one at a time (session, then directory, then global); --all clears everything. To stop using the plugin, clear it and remove the source line from your shell profile.
Related plugins exist for the AWS CDK Toolkit, eksctl, AWS SAM CLI and awslogs, per the same docs.
The part 1Password will not tell you: AWS prefers no long-term keys
AWS's authentication guide lists CLI login methods "in order of recommendation":
- AWS Management Console credentials: short-term, recommended.
- IAM Identity Center short-term credentials. AWS calls AWS Organizations with IAM Identity Center the security best practice.
- IAM user short-term credentials, "more secure than long-term credentials".
- EC2 instance metadata, and assuming roles.
- IAM user long-term credentials: "(Not recommended)".
- External storage of credentials: "(Not recommended)", "only as secure as the external location".
The 1Password plugin stores IAM user access keys, which are long-term. It makes them much safer to keep, and the MFA setup gives your commands temporary sessions. But if you can sign the CLI in with console credentials or IAM Identity Center, do that, and you have no long-lived key to protect at all.
Pick this if
- Pick the 1Password AWS plugin if your setup needs IAM user access keys (old accounts, some CI-adjacent scripts, client accounts you do not control) and you are on Mac or Linux.
- Pick console login or IAM Identity Center if you control the AWS account. It removes the long-term key problem instead of hiding it better.
- Pick credential_process only if you are building custom tooling and accept that AWS marks external storage as not recommended.
Troubleshooting
- No prompt appears: the
sourceline is missing from your shell profile, or CLI integration is off in the 1Password app. - Credentials not found: field names do not match the table above.
- MFA ignored: fields not titled
one-time passwordandmfa serial. - Wrong account used: run
op plugin inspect aws, then clear the default at the wrong scope.
Setting up two-factor for your 1Password account itself is a separate job; see 1Password two-factor authentication. Still on 1Password 7? Check that your setup meets the requirements above; 1Password 7 vs 8 explains what changed between versions.
How we checked
We read 1Password's AWS shell plugin documentation, 1Password's pricing page and the AWS CLI authentication guide on 3 December 2026. Prices were shown in US dollars. We did not run the setup against a live AWS account. When the official docs change, they win. More on our method on how we pick, and more guides are in the password managers hub.
Questions people ask
How do I use 1Password with the AWS CLI?
Sign in with op signin, run op plugin init aws, choose Import into 1Password or Search in 1Password for your access key item, pick a scope (session, directory or global), then add source ~/.config/op/plugins.sh to your .zshrc, .bashrc or fish config. Run aws sts get-caller-identity to test. You will get a biometric prompt.
Does the 1Password AWS plugin support MFA?
Yes. Add a One-Time Password field with the secret from AWS's virtual MFA setup, and a text field titled mfa serial with the MFA device ARN. The CLI detects those fields and sets AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN to temporary session values. You can also put the MFA ARN in a profile in ~/.aws/config.
Can I use multiple AWS profiles and roles with 1Password?
Yes. Define role profiles in ~/.aws/config with role_arn and source_profile, then call them with --profile prod or export AWS_PROFILE=prod for the session. 1Password supplies the source credentials; AWS assumes the role. Directory defaults let different project folders use different 1Password items automatically.
Does the 1Password AWS plugin work on Windows?
1Password's AWS plugin page lists the 1Password app for Mac or Linux as a requirement and supports Bash, Zsh and fish. It mentions the Windows path for the AWS config file, but Windows shells are not in the supported list on that page. On Windows, AWS's own short-term login methods are the safer bet.
Is storing AWS keys in 1Password safe?
Safer than a plaintext ~/.aws/credentials file, because the keys sit in an encrypted vault and each use needs your unlock. But they are still long-term keys, which AWS marks as not recommended. Best practice is short-term credentials via console login or IAM Identity Center; use 1Password for keys you cannot avoid.
Sources
Every fact above comes from these pages. Prices change, so each one carries the date we read it.
- 1Password developer docs: AWS shell plugin, checked 3 Dec 2026
- AWS CLI user guide: Authentication and access credentials, checked 3 Dec 2026
- 1Password pricing, checked 3 Dec 2026