---
title: "Where to look up a key"
description: "Where public keys live, which one to read, and the limits of each."
url: https://app.visacli.sh/docs/keys-and-directories
updated: 2026-11-18
---

# Where to look up a key

> Where public keys live, which one to read, and the limits of each.

Canonical: https://app.visacli.sh/docs/keys-and-directories. Updated: 2026-11-18. Full index: /llms.txt.

To check a signature you need the public key that made it, and several places publish keys. For a decision about a Visa CLI agent, read Visa CLI's [registry](/docs/words-used-here.md#term-registry) by key, at an origin you've pinned in your own config.

## Origins

| Environment | Registry origin | Lists agents? | `Signature-Agent` you'll see |
| --- | --- | --- | --- |
| Production | `https://auth.visacli.sh` | Yes. New agents' keys are registered in the Visa Agent Directory (production); agents connected before 18 November are still in the Visa Agent Directory sandbox | `"https://agenticdirectory.visa.com"` for a key in the Visa Agent Directory (production), `"https://sbx.agenticdirectory.visa.com"` for one still in sandbox |
| Test | You receive it when you get access. See [Before you start](/docs/quickstart.md#before-you-start) | Yes | `"https://sbx.agenticdirectory.visa.com"` |

In words: production's registry origin is `https://auth.visacli.sh`, and it lists agents today. Each listing's `directoryOrigin` names whether the key is registered in the Visa Agent Directory or its sandbox, and the agent sends that origin as `Signature-Agent`. A newly connected agent's key is in the Visa Agent Directory, so it sends `Signature-Agent: "https://agenticdirectory.visa.com"`. An agent connected before 18 November is still in the Visa Agent Directory sandbox and sends `Signature-Agent: "https://sbx.agenticdirectory.visa.com"`. The double quotes are part of the value, because it's a structured-field string. Accept both values unless you only want production agents.

Visa CLI's production registry lists every connected agent, whether its key is in the Visa Agent Directory or its sandbox. A key it doesn't list, such as a test key from these docs, gets a `404` there.

Pin the registry origin in your config. The example verifier never follows a redirect from the registry, which counts as couldn't check, `tap_trust_unavailable` with `503`, and it accepts a plain `http://` registry origin only for the exact loopback origins `localhost`, `127.0.0.1` and `[::1]`, refusing any other at startup.

## Which to read, and why

| Source | Use it for | Limits |
| --- | --- | --- |
| [`GET /v1/tap/registry/keys/{jkt}`](/docs/reference/visa-cli/public-signing-key-lookup.md) | Deciding whether to accept a request. Takes a UUID key ID or a thumbprint | Up to 60 seconds old. `404` covers unknown, revoked, paused and expired alike |
| [`GET /v1/tap/registry/agents/{tapAgentId}`](/docs/reference/visa-cli/public-agent-lookup.md) | Looking up an agent's current key when you hold its ID | Up to 60 seconds old. `404` covers unknown, revoked, paused and expired alike |
| [`GET /.well-known/http-message-signatures-directory`](/docs/reference/visa-cli/web-bot-auth-public-key-directory.md) | Tools that consume Web Bot Auth key lists. Don't use it to decide whether to accept a request | Lists by thumbprint only, so a UUID `keyid` can't be found. Returns `200` with `{"keys":[]}` if its upstream read fails, so an empty list can mean an outage. Cached for 300 seconds |
| [`GET https://agenticdirectory.visa.com/.well-known/jwks/keys/{keyid}`](#enabler-lookup), or `sbx.agenticdirectory.visa.com` in sandbox | Deciding whether to accept a request from an agent registered through an enabler. Takes a UUID key ID only | The Visa Agent Directory, not ours. For a Visa CLI agent, rely on the registry, not this, to reflect that an owner has paused the agent |
| [`GET /keys`](/docs/reference/keys/public-key-retrieval.md) | Nothing you can call. The TAP specification describes it in the abstract | No host, selector or cache policy is published |
| [`GET /v1/trustedAgentProtocol`](/docs/reference/keys/tap-catalog-entry.md) | Nothing you can call yet | An incomplete catalog entry |

The key list at `/.well-known/http-message-signatures-directory` answers `200` with `{"keys":[]}` both when nothing is listed and when its own read upstream has failed, and it caches either answer for 300 seconds. So a verifier mustn't read an empty list as "no agents": decide on the per-key lookup, `GET /v1/tap/registry/keys/{jkt}`, which tells the two apart with a `404` or a `503`.

`/.well-known/agent-jwks.json` returns an empty key set on purpose, and it isn't where agents' TAP keys are listed. Its [`{"keys":[]}`](/docs/reference/visa-cli/agent-artifact-jwks.md) says nothing about any agent, so look keys up in the registry instead.

The sender chooses the `Signature-Agent` header, so compare it to an allowlist and never fetch from it.

Where to read depends on how the agent was registered. For Visa CLI's agents, read Visa CLI's registry, which the example verifier does by default. For agents registered through an enabler, read the Visa Agent Directory, which the example verifier does when you give it `directoryOrigin` in place of `registryOrigin`. [Status](/docs/status.md#where-verifiers-read) says the same.

A few facts hold whichever you read. For a key in the Visa Agent Directory, the key ID is a UUID from VARS: it's the `keyid` in every signature and the lookup key, and never the agent ID or the TRID. A Visa CLI agent whose key has no metadata from the Visa Agent Directory signs with a thumbprint instead, which only Visa CLI's registry resolves: looking a thumbprint up in the Visa Agent Directory answers `404`, so read Visa CLI's registry for those. One TRID covers many agents. In sandbox, every agent from a Basis Theory test tenant shares one TRID, `40010092347`, so there the TRID doesn't identify a company or a wallet. Unknown, revoked, paused and expired keys all answer `404`, and Visa sends no notice when a key is revoked, so look keys up again rather than waiting to be told. A signature proves that a registered key signed this exact request, recently, once. It doesn't prove that a payment settled, who the owner is, or who owns the wallet.

<a id="enabler-lookup"></a>

## The Visa Agent Directory

Agents that an integrator registers through an enabler are listed in the Visa Agent Directory. Look a key up with an unauthenticated `GET`, by the UUID key ID from the signature's `keyid`:

```sh title="Look up a key in the Visa Agent Directory sandbox"
curl https://sbx.agenticdirectory.visa.com/.well-known/jwks/keys/11111111-2222-4333-8444-555555555555
```

In production the origin is `https://agenticdirectory.visa.com`. A key that resolves answers `200`. Here it's trimmed to the fields a verifier reads, with placeholder values:

```json title="200, the key resolves"
{
  "agent": {
    "name": "<agent name>",
    "agentType": "known",
    "tokenRequestorId": "YOUR_TOKEN_REQUESTOR_ID"
  },
  "key": {
    "id": "11111111-2222-4333-8444-555555555555",
    "algorithm": "ed25519",
    "status": "active",
    "expirationDate": "2027-10-29T02:48:00Z",
    "publicKeyJwk": { "kty": "OKP", "crv": "Ed25519", "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo" }
  },
  "message": "Key found"
}
```

An unknown, revoked or expired key answers `404`:

```json title="404, the key doesn't resolve"
{ "message": "The requested key was not found" }
```

In words: use the key only when `key.id` equals the `keyid`, `key.status` is `active`, `algorithm` matches the key in `publicKeyJwk`, and `expirationDate` hasn't passed. For an Ed25519 key, `algorithm` is `ed25519` (it may be written `Ed25519` or `ed25519`, in the Visa Agent Directory or in a signature, so accept both) and `publicKeyJwk` is `{"kty":"OKP","crv":"Ed25519","x":...}`. Agents registered through Basis Theory may have P-256 or Ed25519 keys, as Basis Theory documents. A P-256 key's `publicKeyJwk` is `{"kty":"EC","crv":"P-256","x":...,"y":...}`, and its signatures carry `alg="ecdsa-p256-sha256"`. The Visa Agent Directory sandbox lists a P-256 key's `algorithm` as `ecdsa-p256-sha256` (from Basis Theory's registration guide, 17 November 2026), and the example verifier accepts `ecdsa-p256`, `ecdsa-p256-sha256`, `es256` and `p-256`. Verify with `publicKeyJwk`, using the algorithm the signature's `alg` names, and refuse a signature whose `alg` doesn't match the key. `agentType` is `known` or `trusted`. `trusted` means the agent is registered with Visa as a token requestor itself, and `known` means its TRID belongs to its wallet or enabler, as every Visa CLI agent's does. The level doesn't affect signature verification, and Visa intends it for CDN and merchant access policies, so don't gate on it: the check is that the key resolves. `tokenRequestorId` is the integrator's TRID, which all its agents share, so it doesn't identify one agent. The full answer also carries fields a verifier doesn't need, such as `keyName`, `publicKey`, `publicKeyPem`, `keyFormat`, `createdAt` and `updatedAt`. The example verifier reads this lookup in [its mode for the Visa Agent Directory](/docs/verifier-code.md#enabler-agents), and we checked the live shape on 9 November 2026.

## A real lookup

This lookup targets production with a key it doesn't list, so what you get is the documented not-listed `404`. The production addresses are live: the lookup is `https://auth.visacli.sh/v1/tap/registry/keys/{jkt}`, and the key list is `https://auth.visacli.sh/.well-known/http-message-signatures-directory`, which answers `200` with the listed agents' keys. We ran it again on 17 November 2026: this key answered `404`, and every key in the key list answered `200`. Below, volatile headers are trimmed, and the body is cut to the fields a verifier reads.

```sh title="Look up a key"
keyid='nEArpjG3kYMcxbdzInyGlBEYQUw7RfAfe3Tw1fZvAA0'

curl -i \
  "https://auth.visacli.sh/v1/tap/registry/keys/$keyid"
```

```http title="Response: 404, with cache-control: no-store. Trimmed to the fields a verifier reads"
HTTP/2 404
content-type: application/json; charset=utf-8
cache-control: no-store
x-request-id: 2dd0c562-3c1a-433d-986b-0617b436bcc4

{
  "code": "not_found",
  "detail": "tap_registry_entry",
  "retryable": false,
  "request_id": "2dd0c562-3c1a-433d-986b-0617b436bcc4",
  "retry_after_seconds": null
}
```

Branch on the status and `code`. The full REST body also carries guidance fields, such as `say`, `message`, `fix`, `continuation` and `waiting_on`. Those are worded for Visa CLI's own agent rather than for a verifier, and they can change between releases, so a verifier doesn't read them. The answer is the same for a key that's unknown, unpublished, paused or revoked.

A listed agent answers like this. This sample is illustrative: it's the shape we saw on a test listing, with names, IDs and keys replaced by example values.

```json title="200, with cache-control: public, max-age=60. Illustrative"
{
  "id": "4c1d7f0ab2e94c6d8f13a5b7c9d0e2f41a3b5c7d9e0f12345678abcdef012345",
  "name": "example-agent",
  "domain": "https://agent.example/",
  "isActive": true,
  "createdAt": "2026-10-29T16:59:24.600Z",
  "updatedAt": "2026-10-29T16:59:24.600Z",
  "keys": [
    {
      "id": "11111111-2222-4333-8444-555555555555",
      "directory": {
        "agentDomain": "https://agent.example/",
        "directoryOrigin": "https://sbx.agenticdirectory.visa.com"
      },
      "agentId": "4c1d7f0ab2e94c6d8f13a5b7c9d0e2f41a3b5c7d9e0f12345678abcdef012345",
      "keyName": "EXAMPLE_THUMBPRINT_43_CHARACTERS",
      "status": "active",
      "algorithm": "ed25519",
      "publicKey": "BASE64_OF_THE_PEM_PUBLIC_KEY",
      "jkt": "EXAMPLE_THUMBPRINT_43_CHARACTERS",
      "expirationDate": "2027-10-29T16:59:24.600Z"
    }
  ]
}
```

A malformed key ID, such as `not-a-key`, gets a `400` with `code: "invalid_request"`. The production well-known key list answers `200` with the listed agents' keys, each shaped as `kty`, `crv`, `x`, `kid`, `use` and `alg`. Visa's test record of a key has `agent` (`name`, `agentType`, `tokenRequestorId`) and `key` objects, and every Visa CLI key we looked up there read `agentType: "known"`.

## Read limits and caching

- **Limits.** The published contract for lookups doesn't state a rate limit. If the registry answers `429`, or any status other than `200` and `404`, the example verifier treats it as "couldn't check".
- **Forged signatures cost lookups.** The example fetches a key again when a signature fails, so a stream of bad signatures can use up your limit and turn into `503`s for real agents. Rate-limit callers before the check, and collapse concurrent lookups of one key.
- **Caching.** Keep a `200` for up to 60 seconds, which is what its `cache-control: public, max-age=60` says. In that window, revocation may not have reached you and a key can still verify during a registry outage, so make a fresh lookup before anything consequential, such as a payout.
- **A `503` from a key lookup means couldn't check.** It says nothing about the agent. Try again later, after the `Retry-After` it carries if it has one, and don't cache it, because it comes with `cache-control: no-store`. The example verifier answers your caller `503` with `Retry-After` in turn.
- **Should you cache a `404`?** No. A `404`, like a `400` or `503`, comes with `cache-control: no-store`, so don't keep it: look the key up again on the next request. The example verifier caches only listed, active keys.
- **Don't pin keys as your only source.** The registry is what carries a pause or a revocation.
- **Browsers.** Lookups have no CORS headers, so call them from your server.
