Trust elements

Field reference for the Trust Check and Trust Recorder canvas elements: TRQP verification queries against trust registries, and writing agent-registration records into trust registries.

Two canvas elements operate on trust registries. Trust Check runs Trust Registry Query Protocol (TRQP) queries against a registry at request time and exposes the results to OPA policies. Trust Recorder writes agent-registration records into registries as requests pass through the surface.

For conceptual background, see Trust Checks, Trust Recorder, and Trust registries.

Trust Check

Drop a Trust Check element on a surface edge to run a TRQP query against a trust registry at request time. The Trust Check stage runs all configured queries in parallel and writes results into input.trust_check_results for OPA evaluation.

Three placements are available, each checking a different agent:

PlacementAgent checkedAvailability
Access Point → Managed Agent edge (caller leg)The inbound caller.All protocols.
Managed Agent → Transit Point edge (Transit Point target leg)Each query’s Checks setting picks the agent: the agent at that Transit Point’s destination, or this surface’s managed agent calling out through it. Runs only for requests the managed agent sends through that Transit Point.Destination checks on A2A Transit Points. From version 1.0.10, managed-agent checks on every Transit Point, MCP included.
Managed Agent → External Target edge, from the Managed Agent to its A2A proxy or gateway node (Managed Agent target leg)The managed agent’s own target.Only when the Managed Agent’s Endpoint Type is via A2A Proxy or via Gateway Connection.

Caller-leg results are written to input.trust_check_results.caller. Destination results from either target leg are written to input.trust_check_results.target. Results of queries that check the managed agent are written to input.trust_check_results.managed_agent.

Each Transit Point has its own Trust Check, and a request sees only the results of the Transit Point it goes through. A Transit Point with no Trust Check runs no target-leg check: the gateway does not fetch the destination’s agent card for trust, verify its identity, or query a trust registry for it. Trust Check audit records for these requests name the Transit Point by its alias.

A Trust Check on the Managed Agent’s own target leg runs only for an A2A proxy or gateway target. On a Direct URL target, its panel shows This Trust Check blocks Save on a URL target: remove it, switch the target, or move the checks to a Transit Point edge.

For the OPA fields these results populate, see OPA policies reference.

Trust Checks copied to Transit Points

Each Transit Point runs only its own Trust Checks. When a gateway moved to version 1.0.2 or later, its earlier surface-wide target-leg Trust Check was copied onto every Transit Point of the surface, so traffic is checked as before until you review each copy. Open each surface that shows a Transit Points need Trust Check review banner, then keep or remove each copy. See Check agents against a trust registry.

A surface with copied Trust Checks shows a banner above the canvas that counts the Transit Points to review, for example 2 Transit Points need Trust Check review. When some of them belong to other variants, the banner says so, and you switch to each variant to review it. Each copied Trust Check carries a warning badge on the canvas, and its panel and fullscreen editor show Review this migrated Trust Check with a Keep button.

ActionEffect
KeepClears the review flag. The Transit Point keeps running the copied queries. Editing the queries and saving them in the fullscreen editor also clears the flag.
Remove Trust CheckRemoves the copy. The Transit Point then runs no target-leg Trust Check.

Save the surface to apply either action.

On an MCP Transit Point, a copied Trust Check is read-only while it holds a destination query. Its panel shows “Trust Checks can’t be changed on an MCP Transit Point; keep or remove this migrated copy.”, and its button opens the queries as View Queries…. From version 1.0.10, you can add a Trust Check to an MCP Transit Point, and its queries check this surface’s managed agent. See Checks.

Removing a copy stops that Transit Point’s checks, so a policy that denied on their results now allows its traffic. A rule that only looks for failed results also allows a request when no checks ran. To require that checks ran, see Require target-leg checks in policy.

Surface Builder canvas with a 2 Transit Points need Trust Check review banner, warning badges on the Trust Checks of an A2A and an MCP Transit Point, and the A2A Trust Check panel showing Review this migrated Trust Check with a Keep button

Panel

The sidebar panel lists the configured queries as Query 1, Query 2 and so on, each with its record type. A query that checks the managed agent shows Managed agent · before its record type. On a Transit Point the panel notes Applies to this Transit Point only. Open the fullscreen editor to add or edit queries.

From version 1.0.10, a Trust Check takes any number of queries, and each query any number of Authorities. Each listed Authority adds one TRQP query to the trust registry on every request, so keep the list to the Authorities your policy needs.

Query fields

Each query in the fullscreen editor has these fields.

FieldRequiredDescription
ChecksYes (Transit Point only)Shown only on a Transit Point’s Trust Check. Destination agent: “The agent this Transit Point calls, from its agent card.” This surface’s managed agent: “The agent calling out through this Transit Point, by the DID it calls out under.” On a Transit Point other than A2A, only This surface’s managed agent is offered. See Checks.
Trust RegistryYesTrust registry to query. Selected from your configured trust registries.
Record TypeYesAuthorization: is this entity authorised to perform this action on this resource? Recognition: does this authority recognise this entity?
Authority IDYes (target leg). Auto on caller leg.One or more Issuers or Authorities, picked from a list with the placeholder Select Issuers or Authorities…. The list groups them under Issuers and Authorities when the gateway has both. On the caller leg it also offers Agent identity credential issuer (default) and Sending gateway DID (fabric-inbound). With nothing picked, the caller leg uses the default, which your first pick replaces. Tick the default again to keep it beside other picks. On the target leg, at least one pick is required. From version 1.0.10, a query can list several Authorities. See Several Authorities in one query.
Entity IDNoNamed-subject dropdown. On the caller leg: The caller’s agent DID (default, {{ input.agent.did }}), The gateway’s managed-identity DID ({{ input.extension_identity.did }}), or The caller’s verified identity credential issuer DID ({{ input.agent.identity_issuer_did }}). On the target leg: The target’s agent DID (default, {{ input.agent.did }}). A query that checks the managed agent shows no dropdown: it asks about “The DID the managed agent calls out under, from this Transit Point’s own identity or the surface’s.”
ActionYes (Authorization only)TRQP action string. Required for Authorization queries. Optional for Recognition queries, where a blank value means is.
ResourceYes (Authorization only)TRQP resource string. Required for Authorization queries. Optional for Recognition queries, where a blank value means ownedAgent.

The id field is auto-generated for each query and used by OPA to address results in input.trust_check_results.{caller|target|managed_agent}[]. It is not editable in the UI.

Several Authorities in one query

From version 1.0.10, the Authority ID of one query can list several Issuers and Authorities, so a surface can accept an agent that any one of several organisations recognises. The field then shows, for example, “3 Authorities, one result each, in the order picked”, and the query’s card header shows 3 authorities.

  • The gateway queries every listed Authority at the same time and waits up to 5 seconds for each one.
  • Policy gets one result per Authority. Each result carries the query’s id and that Authority’s authority_id, in the order picked.
  • An Authority that doesn’t answer in time fails only its own result, with QUERY_TIMEOUT. A listed Authority that was deleted fails only its own result, with AUTHORITY_NOT_FOUND.
  • A Trust Check passes or fails nothing by itself, so your policy decides whether one recognising Authority is enough. See Accept any one Authority.

Checks

From version 1.0.10, each query of a Transit Point’s Trust Check has a Checks select that decides which agent it asks about.

  • Destination agent asks about the agent the Transit Point calls, from its agent card. It works only on A2A Transit Points, because only their destinations serve an agent card to check. Results go to input.trust_check_results.target.
  • This surface’s managed agent asks whether the trust registry still recognises your own agent, by the DID it calls out under. It works on every Transit Point, MCP included. Results go to input.trust_check_results.managed_agent. A Transit Point policy can then refuse outbound calls from an agent whose recognition was turned off.

On a Transit Point other than A2A, the field notes “This Transit Point’s destination serves no agent card to check, so it can only check its managed agent.”

A managed-agent query needs a DID to ask about. Give the Transit Point one by adding an Identity element on its Managed Agent → Transit Point edge. Until the Transit Point presents a managed agent identity, the editor warns: “This Transit Point presents no managed agent identity, so this query reports MANAGED_AGENT_IDENTITY_UNAVAILABLE. Give it a managed identity or turn on VP injection.”

A discovery read through the Transit Point, such as a fetch of the destination’s agent card, runs no managed-agent query, so it carries no managed_agent results. To record the managed agent the query asks about, add a Trust Recorder on the same edge.

Validation constraints

  • Authority ID on the target leg must be at least one Issuer or Authority picked from the list. A blank value or a {{ … }} template blocks the save.
  • On the caller leg, a stored {{ … }} template other than Agent identity credential issuer (default) or Sending gateway DID (fabric-inbound) is invalid. Replace it with an explicit Issuer or Authority selection.
  • Action and Resource are required for Authorization queries and must not be blank.
  • Query id values are auto-generated and must be unique within a Trust Check.

Template syntax

The query fields accept {{ }} templates resolved against the input.* JSON the gateway builds for the same request, except Authority ID on the target leg, which takes only picked Issuers or Authorities. Templates follow the OPA input namespace, so a value from the policy input is available using the same path you would use in a Rego rule.

{{ input.agent.provider_did }}         → resolved DID of the agent's department/provider
{{ input.agent.did }}                  → effective caller DID
{{ input.source_auth.claims.sub }}     → JWT subject claim (jwt_bearer auth only)
{{ input.http.path }}                  → request path

A || fallback operator is supported for fields that may be absent:

{{ input.extension_identity.did || input.agent.did }}

The right-hand side is used only when the left-hand side is missing or null. A non-scalar value (array, object) or a malformed template fails the query with TEMPLATE_RESOLUTION_FAILED at once, without trying the right-hand side.

When a template fails to resolve, the element produces ok = false with error.code = TEMPLATE_RESOLUTION_FAILED and no TRQP network call is made. From version 1.0.10, the same applies when an Authority ID template resolves to a blank value.

Result fields

Each element in input.trust_check_results.caller, input.trust_check_results.target and input.trust_check_results.managed_agent has this shape. A query that lists several Authorities gives one element per Authority, all with the query’s id.

{
  "id": "tc-caller-1",
  "trust_registry_id": "tr-main",
  "query_type": "recognition",
  "ok": true,
  "error": null,
  "name": "Verify caller department",
  "authority_id": "did:web:authority.example.com",
  "entity_id": "did:web:caller.example.com",
  "action": "is",
  "resource": "ownedAgent",
  "query_resolved": true
}
FieldTypeDescription
idstringThe query’s auto-generated ID. Use it to address the result in Rego.
trust_registry_idstringThe registry the query ran against.
query_typestring"recognition" or "authorization".
okbooleantrue when the trust registry allowed the request. false for both clean denials (NOT_RECOGNIZED, NOT_AUTHORIZED) and stage failures.
errorobject or nullnull only when ok is true. Present for all other outcomes: clean denials (NOT_RECOGNIZED, NOT_AUTHORIZED) and stage failures alike.
error.codestringOne of the error codes below.
error.messagestringHuman-readable detail. For TRUST_REGISTRY_PROBLEM_REPORT, the problem report code the registry sent, in square brackets, followed by its message: [<code>] <message>. Match it with startswith.
namestringThe query’s name, when set. Absent otherwise.
authority_idstringThe TRQP authority DID as sent. With templates filled in when query_resolved is true, and the raw template string on TEMPLATE_RESOLUTION_FAILED. Absent for AGENT_CARD_UNAVAILABLE, TRUST_REGISTRY_METADATA_UNAVAILABLE, IDENTITY_VP_VERIFICATION_FAILED, TARGET_AGENT_IDENTITY_UNAVAILABLE and MANAGED_AGENT_IDENTITY_UNAVAILABLE, because the gateway could not build the query.
entity_idstringThe TRQP entity DID as sent. Absent on the same five codes as authority_id.
actionstringThe TRQP action as sent. For a recognition query with no value set, "is". Always present.
resourcestringThe TRQP resource as sent. For a recognition query with no value set, "ownedAgent". Always present.
query_resolvedbooleantrue when the gateway built the query and sent it to the trust registry. false when it sent no query, for every stage failure that stops it before the registry: TEMPLATE_RESOLUTION_FAILED, AGENT_CARD_UNAVAILABLE, TRUST_REGISTRY_METADATA_UNAVAILABLE, IDENTITY_VP_VERIFICATION_FAILED, TARGET_AGENT_IDENTITY_UNAVAILABLE, MANAGED_AGENT_IDENTITY_UNAVAILABLE and AUTHORITY_NOT_FOUND. Always present.

Error codes

CodeCategoryMeaning
NOT_RECOGNIZEDClean denialRecognition query returned a negative verdict: the registry answered that it does not recognise the entity. authority_id, entity_id, action, and resource are populated, and query_resolved is true.
NOT_AUTHORIZEDClean denialAuthorization query returned a negative verdict: the registry answered that the entity is not authorised. Same field population as NOT_RECOGNIZED.
TRUST_REGISTRY_UNREACHABLEStage failureOutbound TRQP transport could not be established (registry not found, no DIDComm connection, or stale connection).
QUERY_FAILEDStage failureTransport delivered the exchange but it failed in a way that does not fit a more specific category (for example, a low-level send error). A single-Authority query also reports a registry that doesn’t answer with this code.
TRUST_REGISTRY_PROBLEM_REPORTStage failureRegistry responded with a DIDComm problem report. error.message starts with the code the registry sent, in square brackets, so Rego can branch on it.
TRUST_REGISTRY_PARSE_ERRORStage failureRegistry response was delivered but could not be read as a TRQP response, for example because the registry runs an incompatible version.
QUERY_TIMEOUTStage failureThe query’s time budget elapsed before a response was received. From version 1.0.10, a query that lists several Authorities waits 5 seconds for each Authority and reports this code on the result of each Authority that didn’t answer in time.
TEMPLATE_RESOLUTION_FAILEDStage failureA {{ }} template could not be resolved against the request context. No network call was made. authority_id and entity_id carry the raw template strings, and query_resolved is false.
AGENT_CARD_UNAVAILABLEStage failureTarget agent card could not be fetched. Each configured query gets one failed result. authority_id and entity_id are absent. Target leg only.
TRUST_REGISTRY_METADATA_UNAVAILABLEStage failureThe element’s query template references a trust-registry metadata field the request context doesn’t populate. On the target leg, this is provider_did or trust_registry_did missing from the target’s agent card. On the caller leg, this is did, provider_did, trust_registry_did, or authority_did missing from the caller’s request payload. Fires only for queries whose template references the missing field. Other queries run normally. authority_id and entity_id are absent. Both legs.
IDENTITY_VP_VERIFICATION_FAILEDStage failureTarget agent card was fetched, but the agent-identity-credential/v1 Verifiable Presentation it carries failed cryptographic verification, for example a bad proof or an expired credential, or the gateway could not verify it. input.agent.did is cleared so the unverified DID never reaches OPA. authority_id and entity_id are absent. Target leg only.
TARGET_AGENT_IDENTITY_UNAVAILABLEStage failureTarget agent card was fetched, but it carries no agent-identity-credential/v1 Verifiable Presentation at all. input.agent.did is cleared. authority_id and entity_id are absent. Target leg only.
AUTHORITY_NOT_FOUNDStage failureFrom version 1.0.9. The Authority the element names no longer exists, so the gateway made no query to the trust registry. error.message names the Authority’s DID. In a query that lists several Authorities, only that Authority’s result fails. See Deleted Authorities.
MANAGED_AGENT_IDENTITY_UNAVAILABLEStage failureFrom version 1.0.10. A query that checks this surface’s managed agent found no DID the managed agent calls out under, so the gateway sent no query. authority_id and entity_id are absent. Managed-agent queries only. Add an Identity element on the Managed Agent → Transit Point edge to give the Transit Point a managed identity.

Rego patterns

Address a result by id rather than array index:

# Allow only when the named element passed
allow if {
  some r in input.trust_check_results.caller
  r.id == "tc-caller-1"
  r.ok == true
}

Deny when any caller-leg query failed or was denied. The gateway decides on allow alone and reads deny_reason only to explain a deny, so write the condition into an allow rule:

caller_check_failed if {
  some r in input.trust_check_results.caller
  r.error != null
}

allow if {
  input.trust_check_results.caller
  not caller_check_failed
}

Branch on a registry-level problem report code, here to give a denied request its own reason. Replace <code> with the problem report code your trust registry sends:

deny_reason := "Trust registry refused the query" if {
  some r in input.trust_check_results.caller
  r.error.code == "TRUST_REGISTRY_PROBLEM_REPORT"
  startswith(r.error.message, "[<code>]")
}

Require target-leg checks in policy

Attach the policy below with a Policy element on the Managed Agent → Transit Point edge. Inbound requests carry no Transit Point results, so the same rule on the Access Point denies every inbound request. A request through a Transit Point with no Trust Check carries no target-leg results. A rule such as every r in input.trust_check_results.target { r.ok } is true when that list is empty, so it doesn’t show that the Transit Point’s checks ran. When a policy depends on target-leg checks, also require that they ran:

allow if {
  count(input.trust_check_results.target) > 0
  every r in input.trust_check_results.target { r.ok }
}

To depend on one specific check, address its result by id, as in the first pattern above.

Accept any one Authority

A query that lists several Authorities gives one result per Authority, all with the query’s id. A rule such as every r in input.trust_check_results.caller { r.ok } then requires every listed Authority to recognise the agent. To accept a query when any one of its Authorities recognises the agent, compare the query ids that ran with the ones that passed:

caller_checks contains r.id if {
  some r in input.trust_check_results.caller
}

caller_checks_passed contains r.id if {
  some r in input.trust_check_results.caller
  r.ok
}

allow if {
  count(caller_checks) > 0
  count(caller_checks - caller_checks_passed) == 0
}

The rule allows a request when at least one query ran and each query passed for at least one of its Authorities. For target-leg results, the All trust checks pass policy template applies the same rule to input.trust_check_results.target.

Require the managed agent to be recognised

Attach the policy below with a Policy element on the Managed Agent → Transit Point edge whose Trust Check checks this surface’s managed agent:

managed_agent_checks contains r.id if {
  some r in input.trust_check_results.managed_agent
}

managed_agent_checks_passed contains r.id if {
  some r in input.trust_check_results.managed_agent
  r.ok
}

allow if {
  count(managed_agent_checks - managed_agent_checks_passed) == 0
}

The rule refuses a request when any managed-agent query failed for all of its Authorities, including MANAGED_AGENT_IDENTITY_UNAVAILABLE. It allows a discovery read, which carries no managed-agent results.

Trust Recorder

The Trust Recorder element writes agent-registration records into one or more trust registries. On the Managed Agent → Access Point edge (the response leg), it runs after the managed agent responds, so the agent’s DID from the reply is available to record. From version 1.0.10, a Trust Recorder can also sit on a Managed Agent → Transit Point edge. See Trust Recorder on a Transit Point. Each entry targets one registry and names the Authority that acts as the trust anchor for its records. For the steps to set one up, see Record your agents in a trust registry.

The Trust Recorder’s fullscreen editor has a collapsed How do Issuer, Authority and Entity relate? panel that summarises the fields below:

  • Authority: the trust anchor that asserts every record the entry writes.
  • Entity: who a record is about, either the agent’s DID or the entry’s Issuer.
  • Issuer (this entry): the DID recorded as the Entity of custom records whose Entity Target is Issuer DID. It does not sign records or set the Authority.
  • Surface Issuer: the Issuer selected in the Surface node’s Issuer setting. It matters only for entries whose Authority is Use surface Issuer.

Entry fields

Each row in the entry list configures one registry target.

FieldRequiredDefaultDescription
Trust RegistryYes—Trust registry to write records into. Selected from your configured trust registries.
IssuerYes—Recorded as the Entity of custom records whose Entity Target is Issuer DID. It does not sign records or set the Authority. Selected from your configured Issuers.
AuthorityYesExplicit DIDTrust anchor asserting these records. Explicit DID: select one of your configured Authorities or Issuers. An Issuer acts as the authority under its own DID. Use surface Issuer: records are written with the surface’s Issuer DID, resolved at write time. The entry is skipped, and writes no records, when the surface has no Issuer selected or its Issuer has been deleted. In that case the Trust Recorder panel and the entry show a warning that points to the Surface node’s Issuer setting. A stored DID that matches no configured Authority or Issuer shows as Custom (from JSON API) until you select one.
Built-in tripleNoOnCheckbox. When on, the gateway writes an ownedAgent record: [Authority] Agent DID is ownedAgent. The agent DID is auto-filled: from the response on the response leg, and from the outbound call on a Transit Point.

Records written for a managed agent carry the agent’s display name, taken from the surface name, as context. The gateway also publishes Authority and Issuer names to the registry. See How names reach the trust registry.

Custom resources

Each entry can include additional custom records. Custom resources extend the standard owned-agent record with operator-defined registrations.

FieldRequiredDefaultDescription
ActionYes—The action the record authorises or recognises (for example is, invoke).
ResourceYes—The resource URI or identifier the action applies to (for example ownedAgent, paymentAgent).
Entity TargetNoAgent DIDWhich DID is written as the entity_id on the record. Options: Agent DID, Issuer DID.
Record TypeNorecognitionType of trust registry record. Options: recognition, authorization.

Trust Recorder on a Transit Point

From version 1.0.10, you can drop a Trust Recorder on a Managed Agent → Transit Point edge, on any Transit Point. It has the same entries and fields as the one on the response leg. Its panel reads: “Writes records to every configured Trust Registry on the request leg (Managed Agent → Transit Point), in the background, for the DID the managed agent calls out under.”

It records the DID that the managed agent calls out under through that Transit Point, so a managed-agent Trust Check on the same edge can find it. It writes on every request through the Transit Point except a discovery read. Its status shows in the Version History of the managed agent’s entry on the Identities page.

Last outcome

On a saved surface, the Trust Recorder panel and its fullscreen editor show a Last outcome row: the most recent recording attempt among the surface’s managed agents. It shows the status, the reason when one applies, how long ago the attempt ran, and the record counts across all entries (created, already existed, failed). Before the first attempt it shows No attempt yet.

StatusMeaning
RecordedAt least one record was written or already existed, and none failed.
Partly recordedSome records were written or already existed, and others failed or were skipped.
FailedNo record was written. The reason is No response from the registry, Registry rejected the record, or Registry error.
SkippedThe entry was not written. The reason is Trust registry not found, Trust registry not connected, Surface has no Issuer, Authority not found, or Registry error.
Not attempted yetThe surface has a Trust Recorder and no outcome is stored yet.

The status is the recorder’s last known outcome, not a live check of the trust registry. The gateway keeps one status per surface and managed agent. Deleting the surface, or adding, removing, or changing its Trust Recorder entries, clears the status until the next response. The Identities page shows the same status for each managed agent. See How identities are named and listed.

Deleted Authorities

From version 1.0.9, an Authority that a Trust Check or Trust Recorder entry uses can’t be deleted from the Authorities tab. See Deleting an Authority that is in use. An element can still name an Authority that is gone, for example one deleted before the upgrade:

  • A Trust Check query fails with AUTHORITY_NOT_FOUND without querying the trust registry, so a policy that requires it to pass refuses the request.
  • A Trust Recorder entry writes no records, and its Last outcome is Skipped with Authority not found.
  • On the canvas, the node shows Authority deleted. In the panel, the Authority picker shows Deleted Authority, and a Configuration required banner names the stored DID. For a Trust Check it reads “The Authority this Trust Check uses no longer exists, so the check fails with AUTHORITY_NOT_FOUND until this is fixed. Pick another Authority, add an Authority with the same DID, or remove the Trust Check.” For a Trust Recorder entry it reads “The Authority this entry uses no longer exists, so the entry writes no records until this is fixed. Pick another Authority, add an Authority with the same DID, or remove the entry.”

The surface can’t be saved until each such query and entry is fixed in one of those three ways.