Skip to content
Back to skills

Login

ASecurity

For an admin, a developer, or another skill that needs a signed-in Vault. Use it to sign in to a named Vault with SSO through the browser, a username and password, or an API access token, stay signed in across tool calls, switch Vaults by DNS and prove which one the CLI is on, classify the target as production or sandbox before anything writes, and say what kind of Vault it is ("is this a Quality Vault", "what API version does this Vault support"). Also use it when a call fails with a login, ...

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 11, 2026
developmentgoshellbashgitapisecuritydocumentation

Works with

  • claude code
  • terminal
  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add veeva-ai/claude-plugins --skill login --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Login?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Login
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/veeva-ai-login/badge)](https://www.skillsdirectory.com/skills/veeva-ai-login)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: login
version: "0.1.0"
description: >
  For an admin, a developer, or another skill that needs a signed-in Vault. Use it to sign in
  to a named Vault with SSO through the browser, a username and password, or an API access
  token, stay signed in across tool calls, switch Vaults by DNS and prove which one the CLI is
  on, classify the target as production or sandbox before anything writes, and say what kind
  of Vault it is ("is this a Quality Vault", "what API version does this Vault support").
  Also use it when a call fails with a login, token, or credentials error.
---

# Vault Login

The base skill for live Vault work. It answers four questions the other skills should never
answer on their own: which Vault am I pointed at, am I signed in, is it safe to write here,
and what kind of Vault is it.
The query skill here and the vault-administrator and vault-developer
plugins all call into this skill for those answers.

Sign-in and stored credentials belong to the Vault CLI (`vault`). Classifying the target and
holding writes back from production belong to this skill, with or without the CLI.
`${CLAUDE_PLUGIN_ROOT}/reference/vault-cli.md` has the CLI's commands and the rules every
skill follows when using it.

## Scope

Signing in, staying signed in, signing out, and classifying the target Vault. Out of bounds:

- Writing the VQL, MDL, or REST call itself: query here, mdl in vault-administrator, api in
  vault-developer.
- Managing users and security policies: an admin task in the Vault UI, or api for the
  endpoint.
- Driving a browser or an OAuth flow. `vault login` opens a browser sign-in, and the user
  is the one who runs it.
- Finding an endpoint. Endpoints come from the docs MCP
  (`mcp__vault-docs-mcp__search_documentation`, source `vault_api_reference`) or from
  api, never from guessing a path or a field name. When the docs show no endpoint or
  field for a value, the answer is "not exposed through the API" plus the Admin page that
  holds it. An undocumented path that happens to answer is worse than a 404: it ends up in a
  customer's script and breaks without notice.

## Handoffs

When the ask is "query this", "load this", "run this MDL", or "call this endpoint", sign in
here, then hand the session to the skill that owns the work. Name it and stop. If a skill that
would do the work is not installed, say which plugin carries it (vault-developer for api)
and offer the drafted command instead of running it.

## Secrets stay out of chat

Never ask for a password, an access token, a session ID, or an OAuth token in chat, and never
run a command with one on its command line (`--password`, `--access-token`, `--session-id`).
The user runs sign-in themselves, where Step 2 says. A secret pasted into chat is in the
transcript already: decline to use it and advise rotating it.

## Step 1: Check for the CLI

```bash
vault version
```

An answer at or above 26.2.4 means Steps 2 and 3. No answer, or an
older version, means offer to install or update it first: rule 3 in `reference/vault-cli.md` has the install line per OS,
the path for an older install, and the install-path fallback when this session's PATH has not
refreshed. Run the install only on the user's yes. If they say no or it fails, Step 5 for the
session and do not raise it again. Step 4 applies either way.

## Step 2: Resolve the target

When the user names a Vault ("use my QA sandbox", "switch to prod"), take the DNS from what
they said, say which DNS you are using, and ask for it when they gave only a name. Never match
the name against what the CLI has stored: an invalid DNS can authenticate against the Vault
the user last logged into.

Only `vault login` and `vault switch` take `--dns`. Every other command runs on the CLI's
current Vault, so prove which Vault that is before the first command and again right before
every write:

```bash
MSYS_NO_PATHCONV=1 vault --verbose api "/objects/users/me" 2>&1 | grep -m1 '^> '
```

The host in `> GET https://<dns>/...` is where the next command lands. No line at all means no
request went out. The one re-run allowed is that same call once without the `grep`, to read
the CLI's reason before you decide the user is not signed in. When the host is not the Vault the user named, get the CLI there
first: `vault switch --dns <dns>`, or, when the installed CLI
has no `switch` or refuses it (a token sign-in, or a Vault the session cannot reach), a new
sign-in as below. Prove it again after either.

The domain call lists the Vaults in the current Vault's domain:

```bash
MSYS_NO_PATHCONV=1 vault api "/objects/domain?include_application=true"
```

The response names the domain (`domain_name__v`) and each Vault in it (`vault_name__v`). The
domain name is part of the DNS of every Vault in it, so a domain with several Vaults still needs
the user to say which one is theirs.

### Two Vaults in one task

Copying configuration or moving data means a source and a target in the same session. Settle
both before the first command: the DNS of each, which one is the source, and the
classification of the target (Step 4). Say it back in one line, for example "source DEV
(mycompany-dev.veevavault.com, Sandbox), target QA (mycompany-qa.veevavault.com, Sandbox)".

From then on, work on one Vault at a time: get the CLI onto it, prove it with the line above,
then run. Prove it again after every switch and right before every write. The CLI is on
whichever Vault was signed in to or switched to last, and a push that lands on the source is
the mistake this rule exists to prevent. Reads go to either Vault. Writes go only to the one
the user named as the target, and a write aimed at the source stops for confirmation even when
the source is a sandbox. The user names both Vaults; the Vault the CLI is on is not the target
until they say so.

No API call returns every Vault a user can reach by DNS. `GET /objects/domain` lists the Vaults in
the current Vault's domain by name and ID, and `GET /objects/domains` lists the user's domains
by name and type. Use them to narrow down which Vault the user means, then ask for its DNS.

Not signed in to that Vault, or the session has expired (the proof line prints nothing, or a
command ends in a sign-in error): ask how they sign in to that Vault before
handing over a command. The bare `vault login` is a browser sign-in that assumes SSO, and for
an account with a Vault password and no identity provider it just ends in "SSO login cancelled". One
question settles it: SSO, a Vault username and password, or an API access token they already
have. Then hand over the line that fits, say where to run it (below), and wait.

SSO:

```bash
vault login --dns mycompany-qa.veevavault.com
```

A username and password, or a token. `--password` and `--access-token` take no value: the CLI
asks for the secret with hidden typing, so it stays out of chat and out of their shell history.
`--password` needs `--username` with it. The same line works in PowerShell and bash:

```bash
vault login --dns mycompany-qa.veevavault.com --username me@mycompany.com --password
```

For a token:

```bash
vault login --dns mycompany-qa.veevavault.com --access-token
```

The CLI also reads the secret from one line of stdin when it is piped in. These lines are for
the user to run. Never run them yourself, and never ask for the value.

Say where to run the line. A browser sign-in is typed at this prompt with `!` in front; add
`--username`, because that prompt has no keyboard to ask for it:

```bash
! vault login --dns mycompany-qa.veevavault.com --username me@mycompany.com
```

A password or token needs a keyboard, so it goes in the terminal Claude Code is started from:
the user types `/exit`, runs the sign-in line there, and resumes with `claude --continue`.
The reason: when `vault login --help` lists `--scope`, a sign-in stays with the terminal tab or
window it was made in, out of reach of a Claude Code started elsewhere.

A password or SSO sign-in stores a session, and a session idles out, often in the middle of a
long task: the next command fails with `INVALID_SESSION_ID` and the user has to sign in again.
The CLI keeps no password, so it cannot do that for them. How long a session may idle is the
Session Duration under Admin > Settings > Domain Settings, from 10 minutes to 8 hours, unless
the user's security policy sets Logout user after inactivity under Admin > Settings > Security
Policies, which wins over the domain value. Changing either takes a Domain Admin, and every
session ends at 48 hours however active it is. Right after a password or SSO
sign-in, offer an API access token so the rest of the work does not idle out. The user creates
it in the API Access Tokens section of their user profile in Vault, which shows the value once,
and signs in with it in the terminal Claude Code is started from:

```bash
vault login --dns <dns> --access-token
```

`--access-token` takes no value on the command line: the CLI reads the token from a no-echo
prompt, or from one line of stdin. The line is the user's to run, never yours.

Recommend the credential that fits them rather than taking whichever comes first: an API
access token is the first choice, it is the only option besides SSO for a SAML user, and it
does not expire with an idle session.

Anyone who signed in through the older `vault_login.sh` helper signs in again with
`vault login`. The two never shared a credential store.

`vault logout` signs out of the current sign-in and ends that session in Vault;
`vault logout --all` signs out of every stored one.

## Step 3: Stay signed in across calls

`vault query`, `vault mdl`, and `vault config` read the stored credential themselves. Nothing
to export and nothing to refresh; run the command once the proof line in Step 2 shows the
right Vault.

A call the CLI has no command for (Vault File Staging, a load, a job, any other endpoint)
goes through `vault api`, which sends the stored session itself. No variable holds a
credential:

```bash
MSYS_NO_PATHCONV=1 vault api "/objects/users/me"
```

(`MSYS_NO_PATHCONV=1`: see `${CLAUDE_PLUGIN_ROOT}/reference/vault-cli.md`.)

Do not read the credential out of the CLI's store to build a request
by hand. The CLI already holds the session and the client ID, and a second hand-built client
means two places for a credential to leak and two places for a header to be wrong.

State the auth mode in play (access token or session) when handing the session to another
skill, so it reads the header correctly.

## Step 4: Classify and profile before writing

Before any `POST`, `PUT`, or `DELETE`, a load, an MDL execute, a `vault mdl`, a
`vault config push`, a package deploy, or a job start, read the domain. With the CLI, let
`vault api` make the call: it signs in with the stored credential, so there is no header to
build and no secret in the transcript.

```bash
export MSYS_NO_PATHCONV=1
vault --verbose api "/objects/users/me" 2>&1 | grep -m1 '^> '
vault api "/objects/domain?include_application=true" | grep -o -E '"(domain_type__v|vault_name__v|name__v|name)" *: *"[^"]*"'
```

The first call is Step 2's proof, so the classification that follows is for the Vault the
write lands on. `vault api` takes a path that starts with `/` and adds the `/api/<version>`
segment itself, so leave that off (the `export` is for Git Bash; see `vault-cli.md`). Without the CLI, use `AUTH`
and `VAULT_DNS` from Step 5 and call the same path with `curl`:

```bash
curl -s -H "Authorization: $AUTH" -H "Accept: application/json" \
  "https://$VAULT_DNS/api/v26.2/objects/domain?include_application=true" \
  | grep -o -E '"(domain_type__v|vault_name__v|name__v|name)" *: *"[^"]*"'
```

`domain_type__v` is `Production`, `Sandbox`, `Demo`, or `Test`. The API reference says the
call is for Domain Admins; in practice a Vault Owner who is not one gets the full response.
If it does fail on permissions, `GET /objects/domains` is the fallback: it lists
every domain the user belongs to with a `type`, so believe it only when every row has the
same type. Anything else, a failed call included, is `UNKNOWN`, and `UNKNOWN` counts as
production. Take the current API version from the docs MCP if the version in the curl call is
rejected.

The same response profiles the Vault, which is why the call asks for applications. Each
Vault in the domain comes back with its `vault_family__v` (`name__v` such as `quality__v`)
and its `vault_application__v` list. A domain with one Vault is unambiguous. A customer
sandbox domain can hold dozens; match on the name the user calls it or ask which row is
theirs, and do not guess from the DNS.
`GET /api/` (no version in the path; through the CLI, `MSYS_NO_PATHCONV=1 vault api --api-version none "/api/"`) lists every API version the Vault answers. The last
entry can be the beta of the next release, so the release is the last entry the docs MCP
knows as general; name that one, and name the beta when the list shows one.

Say all of it on the one line this skill already states before a write: target DNS (the host
the proof line showed), classification, family, release. `DEV (mycompany-dev.veevavault.com), Sandbox, Platform, API v<version>`
and then never ask again in the session. The family and the applications do not change, so
keep them in a note per DNS for next time; the classification is read live before every
write regardless, and the version is re-read when a call is rejected for it. If the domain
call failed, the family is `UNKNOWN` too. Say so, and do not infer it from custom objects.

The profile shapes the rest of the work. A feature the docs put in a later release than
every version the Vault lists is "not on this Vault yet", not a suggestion. Standard objects of
another family are not assumed present. When the profile is first established, name once the
plugin here that covers what the user came to do on this Vault, and leave installs alone
after that. On both paths the call above is the source of this profile.

The CLI does not make this check, and a command that runs is not evidence the target is safe.
The rule every skill in these plugins follows: reads run anywhere. Writes run against a Vault
classified as non-production. Against `Production` or `UNKNOWN`, do not execute; show the
target DNS, the classification, and the exact command, and hand it to the user to run. State
the target and classification in one line before any write, even on a sandbox, so the blast
radius is visible before it goes out. Never add `--yes` to get past a prompt.

DNS names are not a substitute for this check: a sandbox can live on a plain `.veevavault.com`
host.

## Step 5: Without the CLI

There is no credential store to read, so the session comes from the user's own shell. Ask
them to set two variables in the terminal they launch Claude Code from, not in chat:

```bash
export VAULT_DNS=mycompany-qa.veevavault.com
read -rs VAULT_ACCESS_TOKEN && export VAULT_ACCESS_TOKEN
```

In PowerShell:

```powershell
$env:VAULT_DNS = "mycompany-qa.veevavault.com"
$env:VAULT_ACCESS_TOKEN = [Net.NetworkCredential]::new("", (Read-Host -AsSecureString)).Password
```

The second line waits for the token with hidden typing, so the value stays out of chat and out
of their shell history; they paste it and press Enter.

Then `AUTH="Bearer $VAULT_ACCESS_TOKEN"` and `export MSYS_NO_PATHCONV=1` at the top of each
block, and Step 4 applies unchanged. An API access token is the credential to
ask for here: it needs no login call, so
there is no session to cache or refresh. Check that both are set with
`[ -n "$VAULT_ACCESS_TOKEN" ] && echo set`, never by printing them.

A user who can only sign in with a password needs a login call first. Take the auth endpoint
and its parameters from the docs MCP, have them put the password in an environment variable
the same way, and keep the returned session ID in a shell variable for the rest of that
block. Do not retry a failed login: failures count against the auth burst limit, which is
counted per username and Vault DNS over a one-minute window.

## Step 6: When a call fails to authenticate

- `INVALID_SESSION_ID`: an expired or ended session, or a disabled or revoked API token. With
  the CLI, the fix is the user running `vault login --dns <dns>` again, where Step 2 says,
  with the DNS they named rather than one the error message suggests. A CLI upgrade can drop every stored
  sign-in the same way. With a token, the token itself is the problem.
- A token/username mismatch, or a credential Vault rejects: stop and say so. Never fall back
  to a different credential than the one the user chose.
- Repeated auth failures then a lockout-shaped error: the auth burst limit. Wait it out rather
  than retrying.
- A message that starts `not logged in` after the user has signed in, or one that starts
  `this shell hasn't confirmed` or `no shell to confirm`: nothing reached the Vault, whatever
  the exit code.
  Show the user the CLI's message as it printed it, say in one line what it means, hand over
  the line that fits, and wait. Never run that line, never retry the command, never set
  `VAULT_CLI_USER`, and never run `vault switch` or `vault user switch` to get past the
  message: confirming a user is the user's step.
  - `this shell hasn't confirmed which user and vault to use` names a user and a Vault: the
    shell Claude Code runs in has not confirmed them. When both are the ones the user means,
    they type `! vault user switch <username>` at this prompt. When either is not, the
    sign-in line from Step 2.
  - `this shell hasn't confirmed which user to use` names no user: run `vault user list`
    (it is not gated), ask which, and hand over `! vault user switch <username>` for the one
    they pick. A bare `vault user switch` through `!` fails when several users are stored.
  - `not logged in`: the shell Claude Code runs in sees no sign-in. Hand over the sign-in
    line from Step 2, run where Step 2 says.
  - `no shell to confirm`: the CLI finds a shell only when Claude Code is started from a
    terminal. Say that and stop; the user decides what to do.
  Once they say it is done, run the proof line from Step 2.
- Any other sign-in error from a CLI command while the user says they are signed in: run the
  proof line from Step 2 and compare its host with the DNS they meant.

`references/auth-and-errors.md` has the credential types, session duration, the response
envelope, rate limits, and the tracking headers to capture for Support.

Files in this skill

  • SKILL.md15.2 KB
  • references/auth-and-errors.md9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.