aws-vault-mfa-iam

Provision MFA-protected AWS CLI sessions using aws-vault.

320|3|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/mizchi/skills --skill aws-vault-mfa-iam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aws-vault-mfa-iam
Source: https://github.com/mizchi/skills/tree/main/aws/vault-mfa-iam
Command: npx skills add https://github.com/mizchi/skills --skill aws-vault-mfa-iam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Resolve MFA-required IAM access errors by routing through aws-vault to establish MFA-protected sessions for AWS CLI/SDK usage.

Core Features & Use Cases

  • Enable MFA-protected AWS CLI sessions using aws-vault to satisfy policy MFA requirements.
  • Configure a virtual MFA device and add mfa_serial to the AWS config to automate MFA prompts.
  • Use aws-vault exec to execute IAM/API operations within an MFA-enabled session, avoiding InvalidClientTokenId errors.

Quick Start

Register a virtual MFA device for your AWS user, add mfa_serial to your ~/.aws/config, and run aws-vault exec <profile> -- <aws-command> to complete an MFA-enabled session.

Frequently Asked Questions about aws-vault-mfa-iam

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use aws-vault to satisfy AWS IAM MFA requirements for CLI access?

Use aws-vault exec to run AWS CLI commands within an MFA-protected session. By configuring a virtual MFA device and adding mfa_serial to your AWS config, aws-vault automatically handles MFA authentication for IAM API calls.

Why does my AWS CLI return InvalidClientTokenId errors when MFA is required?

InvalidClientTokenId errors occur when IAM policies require MFA but the CLI session lacks it. Routing commands through aws-vault exec establishes an MFA-enabled session, resolving the authentication failure and allowing IAM operations.

What do I need to configure before setting up MFA-backed AWS access with aws-vault?

You need a registered virtual MFA device for your AWS IAM user and an updated ~/.aws/config file containing the mfa_serial value. aws-vault then uses this configuration to prompt for and manage your MFA-backed sessions.

What's the best way to automate MFA prompts for AWS CLI commands?

Add the mfa_serial parameter to your AWS config profile and execute commands using aws-vault exec. This setup provisions MFA-protected sessions automatically, preventing manual MFA code entry on every individual AWS API call.

Can I use aws-vault for IAM actions when my AWS policy enforces MFA?

Yes, aws-vault exec routes IAM API calls through an MFA-authenticated session. This satisfies AWS policies that enforce MFA for iam:* actions, ensuring your CLI operations comply with security requirements without failing.

How does aws-vault handle MFA-protected sessions for AWS SDK usage?

aws-vault resolves MFA-required IAM access by provisioning secure sessions for both AWS CLI and SDK usage. It leverages the mfa_serial configuration to authenticate via your virtual MFA device and establish valid temporary credentials.