Credential Access
This guide explains how to securely retrieve card credentials (PAN, CVV, expiration) using the attestation model.Attestation Model
LedgerOS uses an attestation-before-access model. Before retrieving card credentials, your agent must attest what it intends to do with the card. This creates an audit trail and enables automatic policy enforcement.Exposure Modes
When creating a card, you specify how credentials can be accessed:| Mode | Risk Level | Use Case |
|---|---|---|
never | Lowest | Hosted checkout only |
extensionOnly | Medium | Browser automation with extension |
rawPan | Highest | Direct API access (testing, trusted environments) |
Extension Only (Default)
Returns a short-lived token that only the browser extension can redeem:Raw PAN
Returns credentials directly in the response. Requires explicit acknowledgment:Attestation Payload
The attestation payload describes the intended use:| Field | Type | Required | Description |
|---|---|---|---|
summary | string | Yes | Human-readable description of intent |
expectedAmount | number | No | Expected transaction amount in cents |
expectedCurrency | string | No | Currency code (default: USD) |
merchantText | string | No | Expected merchant name |
reason | string | No | one-time, subscription, preauth |
clientContext | object | No | Custom metadata for your records |
Transaction Correlation
When a transaction occurs, it’s automatically correlated with recent credential access events:| Status | Meaning |
|---|---|
attested | Credential access found within the attestation window |
unattested | No recent credential access found |
stale | Credential access found but outside the window |
attestationWindowMinutes when creating the card (1-60 minutes).
Rate Limits
- Maximum 10 credential retrievals per hour per card
- Tokens expire after 120 seconds
Using the Browser Extension
ForextensionOnly mode, use the Ledger browser extension:
Best Practices
Always provide detailed attestations
Always provide detailed attestations
Include expected amount, merchant, and reason. This helps with audit trails and fraud detection.
Use extensionOnly in production
Use extensionOnly in production
Keep PAN out of your application code. The extension handles credentials securely.
Handle token expiration
Handle token expiration
Tokens expire in 120 seconds. Request a new token if the checkout takes longer.
Monitor unattested transactions
Monitor unattested transactions
Set up webhook handlers for
spend.unattested events to detect anomalies.