Logotipo de Bitwarden Credential Management

Bitwarden Credential Management

Comunidad
tamirdresher
bitwarden-credential-management

Secure credential management for AI agents via official Bitwarden MCP server and bw CLI. Agents can store and retrieve secrets without exposing the entire vault. All access is audited.

Descripción general

Editortamirdresher
Repositoriosquad-skills
Nombre de la habilidadbitwarden-credential-management
Estrellas
44
Forks
9
Archivos incluidos
2
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 2

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por tamirdresher en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Bitwarden Credential Management en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/tamirdresher/squad-skills/tree/main/plugins/bitwarden-credential-management
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tamirdresher/squad-skills.git /tmp/squad-skills
mkdir -p .claude/skills
cp -r /tmp/squad-skills/plugins/bitwarden-credential-management .claude/skills/bitwarden-credential-management
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Bitwarden Credential Management en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Bitwarden Credential Management automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Bitwarden Credential Management no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Bitwarden — AI Agent Credential Management

Provides secure, audited credential management for AI agents. Two access methods: Bitwarden MCP server (preferred) and bw CLI (fallback).

CRITICAL: Security Rules

  1. NO DELETE — Agents may NEVER delete vault items. Only the vault owner (human) can delete.
  2. NO EXPORT — Never export the entire vault or dump all passwords.
  3. NO MASTER PASSWORD — Never request, store, or log the master password.
  4. AUDIT ALL ACCESS — Every credential access must be logged.
  5. LEAST PRIVILEGE — Only retrieve the specific credential needed for the current task.
  6. NO PLAINTEXT LOGGING — Never log actual password values. Log only item name/ID + action + timestamp.

Architecture

┌─────────────────────────────────────────────────┐
│  Agent Process (Copilot CLI, CI runner, etc.)    │
│                                                   │
│  ┌──────────────┐    ┌─────────────────────────┐ │
│  │ MCP tools     │    │ bw CLI (fallback)       │ │
│  │ (preferred)   │    │ inherits BW_SESSION     │ │
│  └──────┬───────┘    └────────────┬────────────┘ │
│         │                         │               │
│  ┌──────▼─────────────────────────▼──────────┐   │
│  │ @bitwarden/mcp-server (stdio)             │   │
│  │ Inherits BW_SESSION from User env var      │   │
│  └──────────────────┬────────────────────────┘   │
│                      │                             │
└──────────────────────┼─────────────────────────────┘
                       │
               ┌───────▼───────┐
               │ Bitwarden     │
               │ Vault (cloud) │
               └───────────────┘

Prerequisites

  • Bitwarden CLI: npm install -g @bitwarden/cli
  • Bitwarden MCP server: npm install -g @bitwarden/mcp-server
  • BW_SESSION: Set as a persistent environment variable (see below)
  • MCP config: Entry in your Copilot MCP config for the "bitwarden" server

BW_SESSION — Persistent Session Key

BW_SESSION is an encryption key derived from the master password. It is NOT a JWT and does NOT expire on its own. This is the key insight that makes persistent agent access work.

How it's stored: As a User-level environment variable (Windows) or in shell profile (macOS/Linux). All new processes inherit it automatically — including background agents, watch processes, and new terminal sessions.

It only breaks if:

  • Master password is changed
  • Account is reset
  • Explicit bw lock or bw logout is run

Setting it (one-time, done by vault owner):

Windows (PowerShell)
powershell
# Login (first time only)
bw login your-vault-email@example.com

# Unlock and persist as User-level env var
$session = bw unlock --raw
[System.Environment]::SetEnvironmentVariable("BW_SESSION", $session, "User")
$env:BW_SESSION = $session
macOS / Linux
bash
# Login (first time only)
bw login your-vault-email@example.com

# Unlock and persist in shell profile
export BW_SESSION=$(bw unlock --raw)
echo "export BW_SESSION=$BW_SESSION" >> ~/.bashrc  # or ~/.zshrc

Agent Auto-Detection Pattern

Before using Bitwarden, every agent MUST run this check:

1. Is the Bitwarden MCP server available? (check tool list for bitwarden tools)
   → YES: Use MCP tools (preferred path)
2. Is BW_SESSION set?
   → YES: Use bw CLI as fallback
3. Neither available?
   → Report: "Bitwarden not available — BW_SESSION not set and MCP server not configured."
   → Do NOT fail silently. Do NOT attempt to unlock.

Access Method 1: MCP Tools (Preferred)

When the Bitwarden MCP server is configured, agents get native tools for vault operations. No CLI invocation needed.

MCP config entry (add to your MCP config file):

json
{
  "servers": {
    "bitwarden": {
      "type": "stdio",
      "command": "npx",
      "args": ["@bitwarden/mcp-server"]
    }
  }
}

The MCP server runs via stdio, inherits env vars (including BW_SESSION), and exposes tools directly. Agents don't need to do anything special — the tools appear automatically.

Key MCP tools available:

ToolPurpose
listList vault items (with search/filter)
getRetrieve a specific item by ID or name
create_itemCreate a new vault item
edit_itemUpdate an existing item
generateGenerate secure passwords/passphrases
get_totpGet current TOTP code for an item

Access Method 2: bw CLI (Fallback)

When MCP is not available, use the standard bw CLI. The BW_SESSION env var is inherited automatically.

Store a Credential

powershell
$item = @{
  type = 1  # Login type
  name = "squad/service-name"
  notes = "Created by [agent-name] for [purpose]"
  login = @{
    username = "the-username"
    password = "the-password"
    uris = @(@{ uri = "https://service-url.com" })
  }
} | ConvertTo-Json -Depth 5

$encoded = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($item))
bw create item $encoded --session $env:BW_SESSION

Naming Convention: Prefix item names with a namespace (e.g., squad/github-api-key, myproject/azure-storage-key).

Retrieve a Credential

powershell
bw get item "squad/service-name" --session $env:BW_SESSION
bw get password "squad/service-name" --session $env:BW_SESSION

List Credentials

powershell
bw list items --search "squad/" --session $env:BW_SESSION

Update a Credential

powershell
$item = bw get item "squad/service-name" --session $env:BW_SESSION | ConvertFrom-Json
$item.login.password = "new-password"
$encoded = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes(($item | ConvertTo-Json -Depth 5)))
bw edit item $item.id $encoded --session $env:BW_SESSION

Audit Logging

Every credential access MUST be logged. Example format:

[2026-03-26T18:20:00Z] GET    | agent=AgentName | item=squad/github-token | method=MCP
[2026-03-26T18:21:00Z] STORE  | agent=AgentName | item=squad/azure-key    | method=CLI
[2026-03-26T18:22:00Z] LIST   | agent=AgentName | search=squad/           | method=MCP  | count=5

Format: [ISO-timestamp] ACTION | agent=NAME | item=ITEM_NAME | method=MCP|CLI

Background Agent Integration

Background watch processes and autonomous agents inherit BW_SESSION from the User env var automatically — no special setup needed.

Startup health check: Agents SHOULD verify Bitwarden availability at startup:

powershell
# Check BW health at startup
$bwStatus = bw status --session $env:BW_SESSION 2>&1 | ConvertFrom-Json
if ($bwStatus.status -ne "unlocked") {
    Write-Warning "⚠️ Bitwarden vault is NOT unlocked. Status: $($bwStatus.status)"
    Write-Warning "Credential operations will fail. Notify vault owner."
} else {
    Write-Host "✅ Bitwarden vault unlocked. Last sync: $($bwStatus.lastSync)"
}

Cross-Machine Setup

Each machine needs a one-time setup:

powershell
# 1. Install tooling
npm install -g @bitwarden/cli
npm install -g @bitwarden/mcp-server

# 2. Login and unlock
bw login your-vault-email@example.com
$session = bw unlock --raw

# 3. Persist BW_SESSION (Windows)
[System.Environment]::SetEnvironmentVariable("BW_SESSION", $session, "User")
$env:BW_SESSION = $session

# 4. Configure MCP server in your Copilot MCP config
# Add the bitwarden server entry to your mcp-config.json

# 5. Verify
bw status --session $env:BW_SESSION

What's Next: Bitwarden Agent Access (aac)

Bitwarden is building an official Agent Access tool (aac) — an open protocol with E2E encrypted tunnels (Noise protocol) for agent credential access. Key differences from the BW_SESSION approach:

BW_SESSION approachAgent Access (aac)
ScopeFull vault accessiblePer-domain credential scoping
SecuritySession key in env varE2E encrypted tunnel
LLM exposureCreds flow through toolsaac run injects via env vars only
StatusProduction-readyEarly preview

Watch: github.com/bitwarden/agent-access

Troubleshooting

SymptomCauseFix
You are not logged inNever logged in on this machinebw login your-email@example.com
Vault is lockedBW_SESSION missing or invalidVault owner re-unlocks, sets env var
Item not foundName mismatch or stale cacheCheck namespace prefix; run bw sync
MCP tools not appearingMCP server not configuredAdd entry to your MCP config
MCP tools fail silentlyBW_SESSION not inheritedVerify User-level env var is set (not just process-level)
bw status shows locked after rebootUser env var lost or password changedRe-run unlock + persist steps

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Bitwarden Credential Management?

Secure credential management for AI agents via official Bitwarden MCP server and bw CLI. Agents can store and retrieve secrets without exposing the entire vault. All access is audited.

¿Por qué usar Bitwarden Credential Management en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Bitwarden Credential Management está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Bitwarden Credential Management en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/tamirdresher/squad-skills/tree/main/plugins/bitwarden-credential-management. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Bitwarden Credential Management?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Bitwarden Credential Management?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Bitwarden Credential Management con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Bitwarden Credential Management?

Sí. tamirdresher la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇