Trust registries

How the Agent Gateway connects to an external trust registry over DIDComm, and how it injects and verifies trust metadata on inbound requests.

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, or did: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:

Connecting
→
Awaiting Approval
→
Connected
↔
Disconnected

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.

StatusMeaning
ConnectingThe handshake is in progress.
Awaiting ApprovalSetup has been sent and the registry’s administrator must approve.
ConnectedFully established; identity lookups and authorisation checks can flow.
DisconnectedPreviously connected but now offline; reconnection is available.
FailedThe registry rejected the gateway, or the first connection attempt failed, and the connection needs attention.
Trust Registries list under Connections, showing a registry connection with a FAILED status badge

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:

FieldDescription
authority_idThe DID of the organisation (authority) that grants permission.
entity_idThe DID of the entity being checked.
actionThe action the entity is requesting permission to perform.
resourceThe 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_id recognises entity_id as belonging to its trust network. When action and resource are 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_id is authorised to perform action on resource. 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.

FieldDescription
trust_registry_didThe DID of the trust registry to query. Surfaces as input.agent.trust_registry_did in OPA policy input.
agent_didThe DID of the agent making the request. Surfaces as input.agent.did and maps to entity_id in Trust Check queries.
provider_didThe 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_didAn optional additional authority DID. Surfaces as input.agent.authority_did.

For a complete field reference, see Trust registry reference.

How it is used

Inbound request
→
Extract metadata
→
TRQP query
→
Trust registry
→
OPA policy

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.

Authority DIDyour gateway's DID, by defaultIssuerthe team that owns the agentsManaged agentDID from the surface's Identity elementRecords 1 and 2is · registeredDepartmentregister · agentsWritten when you register the IssuerRecord 3is · ownedAgentWritten by the Trust Recorder on each responseA partner's Trust Check asks for record 3Authority ID: your Issuer · Entity ID: the agent
RecordAuthorityEntityAction and resourceWritten when
Issuer registrationThe Issuer’s Authority DID, your gateway’s DID by defaultThe Issueris registeredDepartment, by defaultYou add an Issuer with a trust registry selected, or select Retry TR Registration.
Right to register agentsThe Issuer’s Authority DIDThe Issuerregister agentsTogether with the Issuer registration.
Agent ownershipThe Trust Recorder entry’s Authority, usually the surface’s IssuerThe managed agentis ownedAgentThe 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.