2FA Authenticator Skill for AI

Two-Factor Authentication (TOTP / HOTP) for AI Agents — Muse, Grok, ChatGPT, Claude, Gemini

Give your AI agent the ability to generate its own two-factor authentication codes: import your authenticator once, and sign-ins stop stalling on a code from your phone.

Get it on GitHub How to install

What it is

The Two-Factor Authentication Skill for AI Agents is a free, open-source skill built around one small Python command-line tool. It stores your 2FA seeds locally — in ~/.authenticator/seeds.json, permissions 0600 — and generates the same rotating 6-digit codes your authenticator app does, using the open standards RFC 4226 (HOTP) and RFC 6238 (TOTP). The OTP math is pure Python standard library; nothing is sent to a server, and no command ever prints a seed.

It supports TOTP and HOTP with SHA1, SHA256, SHA512 and MD5, 6-, 7- and 8-digit codes, custom periods, HOTP counters, and Steam Guard's 5-character codes. Seeds can arrive as an enrollment QR photo, an otpauth:// or steam:// URI, a base32 / base64 / hex setup key, a Google Authenticator migration QR, or an export file from another authenticator app.

Authenticator app compatibility

Source appImport pathStatus
Google AuthenticatorTransfer-accounts migration QR photo✅ Direct
andOTP, FreeOTP+Plain JSON backup✅ Direct
AegisPlain-text JSON vault export✅ Direct
2FASPlain .2fas / JSON backup✅ Direct
Bitwarden / Bitwarden AuthenticatorVault JSON or CSV✅ Direct
Ente Auth, RaivoPlain-text otpauth:// list✅ Direct
Proton Authenticator / Proton PassJSON export✅ Direct
KeePassXCCSV export✅ Direct (basic)
Steam Guardsteam:// link or maFile JSON✅ Direct
Microsoft AuthenticatorNo export exists⚠️ Locked in — re-enroll per service
Authy (Twilio)No export exists⚠️ Locked in — re-enroll per service
Duo Mobile, Okta Verify, Salesforce AuthenticatorDevice-bound push accounts⚠️ Locked in
Yubico AuthenticatorSeeds stay on the hardware key⚠️ Cannot be extracted
RSA SecurIDProprietary format❌ Not TOTP

Encrypted exports (password-protected Aegis, 2FAS or andOTP backups) are detected and refused with the exact plain re-export to make — never a silent failure. Locked-in apps are a vendor restriction, not a limitation of this skill; the FAQ below gives the re-enrollment workaround.

Install in 3 steps

  1. Copy the skill folder — download the repository and copy authenticator/ into your agent's skills directory or workspace.
  2. Install the QR decoder (photo intake only; everything else is standard library):
    pip install --user pillow zxing-cpp
  3. Import your authenticator — one Google Authenticator transfer QR photo enrolls everything:
    python3 authenticator/bin/auth.py import --qr ~/transfer-qr-photo.jpg
    python3 authenticator/bin/auth.py list
    python3 authenticator/bin/auth.py code github

On Muse, the skill loads natively. On Grok, ChatGPT, Gemini, Claude Code, Cursor and other agents there is no native skills system — the repository's guide for other AI agents includes a ready-to-paste system-prompt snippet; any agent with shell and file access can run the same CLI.

Security model

Seeds are credentials and are treated like them: a single local store with 0700/0600 permissions in the user's home directory, no seed ever printed by any command (covered by the test suite), codes computed entirely on-device, and a built-in consent rule — the agent generates a code only for a sign-in the user has authorized. Holding the codes is not standing permission to sign in anywhere new.

Frequently asked questions

What is the 2FA Authenticator Skill for AI?
It is a small open-source skill — one Python command-line tool plus instructions — that lets an AI agent hold your two-factor authentication seeds locally and generate TOTP and HOTP codes on demand. Sign-ins the agent runs for you stop stalling on "enter the 6-digit code from your phone", because the agent can generate the same code your authenticator app would.
Which authenticator apps can I import from?
Directly: Google Authenticator (transfer/migration QR photo, or single enrollment QRs), andOTP and FreeOTP+ (plain JSON backup), Aegis (plain-text JSON vault), 2FAS (plain backup), Bitwarden and Bitwarden Authenticator (vault JSON or CSV), Ente Auth and Raivo (otpauth text list), Proton Authenticator and Proton Pass (JSON export), KeePassXC (CSV), and Steam Guard (steam:// links and maFiles). Any single enrollment QR, otpauth:// URI, or base32, base64 or hex setup key from any service also works.
Why can't I import from Microsoft Authenticator or Authy?
Because those vendors offer no export at all — to anyone. Microsoft Authenticator's cloud backup restores only into Microsoft Authenticator on the same platform, and Microsoft-account entries are proprietary push sign-in, not TOTP. Authy syncs only into Authy, encrypted, with no export. The workaround is per-service re-enrollment: disable 2FA at the service, re-enable it, and capture the setup QR into both your phone app and this skill's store. From then on both generate identical codes.
Is it safe to let an AI agent hold my 2FA seeds?
The skill is built for it: seeds live only in ~/.authenticator/seeds.json with 0700 directory and 0600 file permissions, no command ever prints a seed, codes are computed locally with the Python standard library, and nothing is sent to a server. The skill also instructs the agent to generate a code only for a sign-in you have authorized. The honest trade-off: storing seeds where your agent can reach them concentrates password and 2FA in one stack — the same model as a password manager holding both — so protect the host accordingly.
Which AI agents can use this skill?
Muse loads it natively as a skill. Grok, ChatGPT, Gemini, Claude, Claude Code, Cursor, Copilot and other agents can use it too: there is no platform SDK — any agent with shell and file access can run the CLI. For agents without a native skills system, the repo includes a ready-to-paste system-prompt snippet and CLAUDE.md / AGENTS.md snippets. A chat-only session with no shell or file access cannot store seeds or run the tool.
How do I install it?
Three steps: (1) copy the authenticator/ folder from the GitHub repo into your agent's skills directory or workspace; (2) run pip install --user pillow zxing-cpp for QR photo scanning (seed, URI and file imports need only the Python standard library); (3) enroll with python3 authenticator/bin/auth.py import --qr <photo of your Google Authenticator transfer QR> — then python3 authenticator/bin/auth.py code <label> generates codes.