Skip to main content

Programmatic usage

Each SDK exposes the same core operations as a library, so you can integrate credential governance directly into your application code.
import {
  initVault,
  unlockVault,
  createPassport,
  listPassports,
  accessCredential,
  detectCredentials,
} from '@id-wispera/core';

// Initialize a new vault (first time only)
const vault = await initVault('my-secure-passphrase');

// Or unlock an existing vault
// const vault = await unlockVault('my-secure-passphrase');

// Scan text for credentials
const detections = detectCredentials('OPENAI_API_KEY=sk-proj-abc123...');
console.log(`Found ${detections.length} credential(s)`);

// Create a passport for a detected credential
const passport = await createPassport(vault, {
  name: 'OpenAI Production Key',
  agentId: 'my-agent',
  credentialType: 'api-key',
  credentialValue: 'sk-proj-abc123...',
  visaType: 'api-access',
  platforms: ['openai'],
  scope: ['chat.completions', 'embeddings'],
  humanOwner: '[email protected]',
  tags: ['production', 'openai'],
  notes: 'Production API key for the summarization agent',
});

console.log(`Created passport: ${passport.id}`);

// List all active passports
const passports = await listPassports(vault, { status: 'active' });
for (const p of passports) {
  console.log(`${p.name} [${p.status}] - ${p.credentialType}`);
}

// Access a credential (logs the access in the audit trail)
const apiKey = await accessCredential(
  vault,
  passport.id,
  'my-agent',       // actor
  'openai',         // platform
  'chat-completion' // purpose
);

Viewing credentials

List all passports in your vault:
idw list
Filter by status, platform, or tags:
idw list --status active
idw list --platform openai
idw list --tags "source:.env"
Inspect a specific passport by ID:
idw show <id>
To reveal the actual credential value (requires vault passphrase):
idw show <id> --reveal

Audit trail

Every action in ID Wispera is logged: creation, access, modification, revocation, sharing, and delegation. View the full audit trail:
idw audit
See the Audit log page for details on compliance support, export formats, and incident response procedures.

Command reference

ActionTypeScriptPythonGo
Init vaultidw initidw-py initidw init
Scan directoryidw scan [path]idw-py scan [path]idw scan [path]
Scan systemidw scan --systemidw-py scan --systemidw scan --system
Import allidw import <path> --allidw-py import <path> --allidw import <path> --all
Import by confidenceidw import <path> --min-confidence 0.9idw-py import <path> --min-confidence 0.9idw import <path> --min-confidence 0.9
Import fileidw import <file>idw-py import <file>idw import <file>
Import OpenClawidw import --format openclaw
List passportsidw listidw-py listidw list
Show passportidw show <id>idw-py show <id>idw show <id>
Show with secretidw show <id> --revealidw-py show <id> --revealidw show <id> --reveal
Revoke passportidw revoke <id>idw-py revoke <id>idw revoke <id>
Audit logidw auditidw-py auditidw audit

Framework integrations

Each SDK includes integration providers that give AI agent frameworks governed credential access.
IntegrationTypeScriptPythonGo
Base ProviderWisperaCredentialProviderWisperaBaseProviderCredentialProvider
OpenAI Agents SDKYesYesYes
Google A2A ProtocolYesYesYes
SlackYesYesYes
LangChainYesYes (existing)N/A
CrewAIN/AYes (existing)N/A
All providers support in-memory credential caching, audit logging, and platform filtering. See the Framework integrations guide for full details.

Next steps