Trust registries
A Trust Registry is a directory of identities and an authorisation service for a trust network. It publishes and resolves DIDs, and it answers authorisation questions, for example whether a given agent is permitted to perform a particular action on a particular resource.
The Agent Gateway queries trust registries using a standard query protocol during its trust checks. Connecting to a trust registry enables the gateway to:
- Publish its own identity so peers can discover it.
- Resolve peers’ identities and confirm they are genuine.
- Check authorisations as part of deciding whether a request may proceed.
The gateway connects to a trust registry via a DIDComm handshake and queries it using TRQP. The registry responds with a boolean verdict indicating whether the queried entity is recognised or authorised. When two organisations share one registry, each gateway can accept only the agents the other has recorded. Verify agents across organisations →
Connecting a trust registry
A trust registry is added in the same way as a gateway, by accepting an out-of-band invitation. The form asks for:
- Name: Human-readable label for this registry connection.
- Description (optional): Notes on the registry’s purpose or environment.
- OOB URL: The out-of-band invitation URL from the registry.
- DID Method (optional): Preferred DID method for this connection (
did:web,did:webvh, ordid:peer).
On submission the gateway begins a handshake and the connection progresses through its states.
Trust registry connection status
Each trust registry connection has a status that reflects the current handshake and operational state:
A connection becomes Failed when the registry rejects the gateway, or when the first connection from the OOB invitation fails. From version 1.0.4, the gateway retries a dropped connection in the background instead of marking it Failed. A successful Reconnect moves a Failed registry to Connecting, where it waits for the registry to approve the gateway. A registry marked Failed by a dropped connection before the upgrade needs deleting and adding again; see Connection statuses.
| Status | Meaning |
|---|---|
| Connecting | The handshake is in progress. |
| Awaiting Approval | Setup has been sent and the registry’s administrator must approve. |
| Connected | Fully established; identity lookups and authorisation checks can flow. |
| Disconnected | Previously connected but now offline; reconnection is available. |
| Failed | The registry rejected the gateway, or the first connection attempt failed, and the connection needs attention. |

The screenshot above shows a Failed connection. A Connected registry would additionally show a heartbeat button in this row, per the description above.
What you can do
For each trust registry you can:
- View its records: the recognition and authorisation entries it holds.
- Reconnect: if it has dropped or failed to re-establish the connection.
- Delete the connection: when the registry is no longer needed.
How the gateway connects to a trust registry
The gateway establishes a live DIDComm connection to each trust registry using an OOB (Out-of-Band) invitation URL. The trust registry administrator provides this URL from the registry’s connection point. When you add a trust registry in the dashboard, the gateway parses the OOB invitation to discover the registry’s DIDComm endpoint and mediator, creates a per-registry identity (a did:web, did:webvh, or did:peer DID specific to this connection), sends a setup message and waits for the registry administrator to approve the connection, then transitions to Connected status once the registry accepts the handshake.
Once the connection status is Connected, the registry is available for use in surface configuration and the gateway can issue TRQP queries to it.
How the registry lookup works
The trust registry holds authoritative records. Each record is identified by the combination of four fields:
| Field | Description |
|---|---|
authority_id | The DID of the organisation (authority) that grants permission. |
entity_id | The DID of the entity being checked. |
action | The action the entity is requesting permission to perform. |
resource | The resource the action applies to. |
The gateway sends a TRQP query containing these four fields to the connected trust registry over DIDComm. The registry evaluates the query and responds with a boolean verdict: recognized: true/false for a recognition query, or authorized: true/false for an authorisation query. The gateway writes the result into input.trust_check_results for OPA evaluation; OPA then decides whether the request may proceed.
The gateway supports two TRQP query types:
- Recognition: asks whether
authority_idrecognisesentity_idas belonging to its trust network. Whenactionandresourceare not configured on the element, the gateway fills in wire defaults ("is"and"ownedAgent") so 4-tuple-indexed registries still match the record. - Authorization: asks whether
entity_idis authorised to performactiononresource. Both fields must be set explicitly on the element, because the gateway supplies no defaults for authorisation queries.
A query can fail before it reaches the registry at all. The most common cause is missing trust-registry metadata: when the caller’s request payload or the target’s agent card doesn’t populate the fields a query template references, the result carries TRUST_REGISTRY_METADATA_UNAVAILABLE instead of a verdict. See Trust elements reference for the complete list of stage-failure codes.
Trust extension fields in the message
When an agent sends a message that carries trust registry metadata, the trust extension is identified by the URI https://fabric.affinidi.io/extensions/trust-registry. The extension includes four fields that identify the parties involved.
| Field | Description |
|---|---|
trust_registry_did | The DID of the trust registry to query. Surfaces as input.agent.trust_registry_did in OPA policy input. |
agent_did | The DID of the agent making the request. Surfaces as input.agent.did and maps to entity_id in Trust Check queries. |
provider_did | The DID of the organisation that authorises the agent. Surfaces as input.agent.provider_did. The dashboard does not offer it as a Trust Check Authority on either leg. The caller-leg Authority defaults to the verified issuer of the caller’s agent identity credential, or you pick the sending gateway’s DID, an Issuer, or an Authority. See Which DID goes in which field. |
authority_did | An optional additional authority DID. Surfaces as input.agent.authority_did. |
For a complete field reference, see Trust registry reference.
How it is used
When a message arrives at an access point of the managed agent with Trust Check elements configured, the gateway follows this sequence:
Extract
The gateway builds request context from the incoming message body. When the caller includes a trust-registry extension, it populates input.agent.provider_did, input.agent.trust_registry_did, and input.agent.did. These values are then available for template resolution in the Trust Check element’s configured query parameters.
Query
The gateway resolves the configured query templates against the request context and sends a TRQP query to the named trust registry over the established DIDComm connection, using the resolved authority_id, entity_id, action, and resource values. All configured Trust Check elements fire in parallel.
Evaluate
The registry responds with a boolean verdict (recognized or authorized). The gateway writes each result into input.trust_check_results and emits a structured audit event. OPA then evaluates the policy with those results in scope. OPA decides whether to allow or reject the request, and the Trust Check stage supplies the results it decides on.
How the trust chain is recorded
A Trust Check gets a positive answer only when the registry holds a matching record. Three records link an organisation to one of its agents, through an Issuer: a gateway entity with its own DID that stands for the part of your organisation that owns the agents. The gateway writes all three records itself.
| Record | Authority | Entity | Action and resource | Written when |
|---|---|---|---|---|
| Issuer registration | The Issuer’s Authority DID, your gateway’s DID by default | The Issuer | is registeredDepartment, by default | You add an Issuer with a trust registry selected, or select Retry TR Registration. |
| Right to register agents | The Issuer’s Authority DID | The Issuer | register agents | Together with the Issuer registration. |
| Agent ownership | The Trust Recorder entry’s Authority, usually the surface’s Issuer | The managed agent | is ownedAgent | The managed agent responds through a surface with a Trust Recorder. |
The first two records place the Issuer under the organisation that vouches for it. By default, the resource is registeredDepartment, kept from an earlier name for Issuers so that records already in registries still match. A gateway can be set to use registeredIssuer instead, for registries that have been updated to it. The Authority DID is fixed when you create the Issuer, so ask the registry’s administrator which DID they expect before you save it.
The third record is the one a partner’s Trust Check usually asks about. A Recognition query with default Action and Resource asks whether its Authority ID owns the agent with is ownedAgent. When the partner uses your Issuer’s DID as that Authority, the record must name your Issuer as its Authority. A Trust Recorder entry does that when its Authority is Use surface Issuer, with the surface’s Issuer set, or Explicit DID with your Issuer selected. The entry’s own Issuer field only fills the Entity of custom records whose Entity Target is Issuer DID.
If registration fails, for example because the registry’s administrator has not yet allowed your gateway to write records, the Issuer shows Failed until you select Retry TR Registration. To set up the chain, see Record your agents in a trust registry.
Where it appears in the dashboard
Trust registry configuration touches these areas of the dashboard:
- Trust Registries section: Add and manage trust registry connections. Each entry shows the connection status badge and a heartbeat button (when connected).
- Identities → Issuers: Create Issuers, link them to a connected trust registry, and check their TR Registration Status.
- Surface canvas → Surface element: Assign an Issuer to the surface.
- Surface canvas → Trust Check element: Configure verification queries against a connected trust registry, on the caller leg, on a Transit Point, or on the Managed Agent’s own target leg.
- Surface canvas → Trust Recorder element: Configure a Trust Registry, an Issuer, and an Authority to register the surface’s agent identity in that registry. Its Last outcome row shows the most recent recording attempt.
- Identities → Agent Identities: The Recorder column shows whether each managed agent was recorded, for surfaces with a Trust Recorder.
Trust registry results feed the policy input, and the Identities page shows each identity the same way whatever those results are. The VERIFIED badge there marks an external caller whose identity presentation the gateway verified.
How names reach the trust registry
Alongside DIDs, the gateway publishes human-readable names to trust registries as reference fields, so a registry can show a name next to each DID:
- Issuers: the Issuer’s name, together with the name of its Authority, when you create, edit, or retry registration for the Issuer.
- Authorities: the Authority’s name when you edit it, sent to every registry that one of its Issuers uses.
- Managed agents: the surface name, sent by the Trust Recorder and again when you rename the surface. The gateway publishes this name only for a DID managed on a single surface.
The Trust Recorder also names the authority of each record it writes, using the matching Authority or Issuer. When the DID is managed on a single surface, the Trust Recorder attaches that managed agent’s display name to each new record as context. Publishing runs in the background, so requests and record creation proceed independently of it.
Which agent each Trust Check verifies
A Trust Check verifies a different agent depending on where it sits on the surface.
Caller-leg verification validates the incoming agent. The gateway reads the caller’s identity and trust registry metadata from the request and queries the registry about that caller.
Target-leg verification validates the agent the request is going to. The gateway fetches that agent’s card, verifies the identity credential it carries, and queries the registry about that agent. Target-leg checks run in two places:
- On a Transit Point: each Transit Point has its own checks, which run only for requests the managed agent sends through it. A Transit Point without checks runs none.
- On the Managed Agent’s own target: these run only when the managed agent is reached through an A2A proxy or another gateway.
Both target-leg placements write their results to input.trust_check_results.target, so a policy reads them the same way. Because a Transit Point without checks produces no results, a policy that depends on them also requires that they ran. See Trust elements reference.
Related
- Limit surface access by agent identity: Add an Identity element that derives a stable DID for each agent, which trust registries can verify.
- Add a trust registry: What you need before you start, and the steps to connect a registry with an OOB invitation.
- Verify agents across organisations with a trust registry: One organisation records its agents, and the other accepts only those agents.
- Record your agents in a trust registry: Add a Trust Recorder that writes the agent ownership record.
- Agent identity and DIDs: How agent DIDs are assigned and verified.
Glad to hear it. Thanks for letting us know.
Sorry to hear that. Thanks for letting us know.
Still stuck? Ask the community on Discord or contact us.