vault.totp
Generate a TOTP 2FA code
Scope: vault:read
Generate the current 6-digit TOTP code from a stored credential with a TOTP secret.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Credential name with TOTP |
Example
Agent: "Get my AWS 2FA code"
-> vault.totp({ name: "aws-login" })Returns
{
"code": "482901",
"remaining": 18,
"backupCodesRemaining": 8
}| Field | Type | Description |
|---|---|---|
code | string | Current 6-digit TOTP code |
remaining | number | Seconds until code rotates |
backupCodesRemaining | number | Count of single-use backup codes stored. 0 when none. The actual codes are never returned here — fetch them via vault.get (data.backupCodes). |
REST Equivalent
GET /v0/vault/:name/totp