Record visibility configuration evaluation
When a caller discovers records in a registry that has a record visibility configuration, AWS Agent Registry authorizes the request first and then evaluates the configuration. This page explains when a statement matches, which statements decide whether a record is visible, and what the caller receives when a record is hidden.
Record visibility configurations within authorization
A record visibility configuration works inside the authorization that a discovery request already has. It can narrow what an authorized caller receives, but it can’t authorize a request. An Allow statement grants no API permission.
AWS Agent Registry handles each discovery request in the following order:
-
Authorization – On a registry that uses AWS Identity and Access Management (IAM) authorization, IAM policies decide whether the caller can call the API. Any applicable resource policy and virtual private cloud (VPC) endpoint policy also apply. On a registry that uses JSON Web Token (JWT) authorization, the registry’s JWT authorizer validates the bearer token. The authorizer’s rules for allowed clients, audiences, scopes, and custom claims are a separate, earlier check. A caller whose token meets those rules can still discover only some records, or none.
-
Record selection – Among the approved records that the request is authorized to read, the record visibility configuration chooses the ones that the caller receives.
-
Request processing – The query, request filters,
maxResults, and pagination still apply. A record is returned only when it satisfies both the request and the configuration.
Without a record visibility configuration, a caller receives every approved record that its permissions allow, except quarantined records. Quarantine hides a record whether or not the registry has a record visibility configuration, and a matching Allow statement doesn’t make a quarantined record discoverable. For how each authorization type applies, see Authorization scope. On an IAM registry, Search and List authorize the registry, while BatchGet also checks each requested record. For those IAM checks, see Record-level permissions and the discovery APIs.
A registry has one record visibility configuration, and it applies to every discovery caller. That includes callers in the owner account and callers in accounts that you share the registry with through AWS Resource Access Manager (AWS RAM). The configuration evaluates each caller’s own attributes. An IAM caller in another account first needs IAM permissions and a share that admits its account. The share doesn’t exempt it from the configuration. For sharing setup, see Sharing a registry across accounts with AWS RAM.
Owning a registry doesn’t add an implicit Allow. If no Allow applies to a caller in the owner account, that caller discovers no records. To keep discovery access for the owner account, include its callers in an Allow.
A record visibility configuration filters only Search, List, BatchGet, and their MCP tools. For the read paths that it doesn’t filter, see Restrict the read paths that a record visibility configuration doesn’t filter.
Does a statement match?
A statement holds caller tests in principal and record tests in resource. It matches a record for a caller when every field test on both sides matches. Within a field test, every operator must hold. A side that is "*" has no tests, so it matches every authorized caller or every approved record.
The caller tests decide whether the statement applies to the caller. The record tests then decide which records it matches, based on each record’s approved revision. A statement that doesn’t apply contributes nothing: an Allow grants nothing, and a Deny hides nothing. The configuration’s other statements still apply.
Missing and multivalued attributes follow the rules in the following table.
| Situation | Result |
|---|---|
|
A positive caller test, such as |
The test doesn’t match, so the statement doesn’t apply to that caller. This holds in an |
|
In a |
The test matches, so the |
|
A scalar caller test, |
Neither test matches, because the array is a set, not a single value. This holds in an |
|
A caller-value reference names a field that the caller doesn’t have. |
The whole statement doesn’t apply, including a |
|
A positive record test, such as |
That record doesn’t match. The statement can still match other records. |
|
A |
The test matches. You can use it in an |
For each operator’s results, see Condition operators and Missing record labels. For references, see Missing referenced values. For the claim shapes that supply a set, see Supported caller values.
Which statements decide visibility?
When a registry has a record visibility configuration, the statements that match a record for the caller decide whether the caller receives it. The following rules apply:
-
A record is visible when at least one
Allowmatches it and noDenymatches it. -
Allowstatements combine with OR. One matchingAllowis enough, and the caller receives a record once, even when severalAllowstatements match it. -
A matching
Denyoverrides everyAllowin the configuration, not only the one written beside it. That includes anAllowthat you add later. -
A record that no
Allowmatches is hidden, even when noDenymatches it. -
The order of statements doesn’t change the result.
A configuration must contain at least one Allow, so the service rejects a configuration that has only Deny statements. To hide every record on purpose, see Hide every record on purpose.
Worked example
This example applies one configuration to several callers and records. The registry uses IAM authorization and is in the READY state. Its custom metadata schema declares department as a Text field and restricted as a Boolean field. The callers are IAM roles in the owner account, 111122223333, and each one has permission to discover records.
The registry has the following approved records:
| Record | Record type | Custom metadata |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
None |
The registry has the following configuration:
{ "version": "1", "statements": [ { "sid": "same-department-mcp", "effect": "Allow", "principal": { "iam:principalTag/department": { "Exists": true } }, "resource": { "recordType": { "StringEquals": "MCP" }, "customMetadata/department": { "StringEquals": { "ref": "iam:principalTag/department" } } } }, { "sid": "platform-all", "effect": "Allow", "principal": { "iam:principalTag/team": { "StringEquals": "platform" } }, "resource": "*" }, { "sid": "exclude-restricted", "effect": "Deny", "principal": "*", "resource": { "customMetadata/restricted": { "Bool": true } } } ] }
The configuration has the following statements:
-
same-department-mcpallows each caller with adepartmentprincipal tag to discover MCP records labeled with the same department. -
platform-allallows callers whoseteamprincipal tag isplatformto discover every record. -
exclude-restrictedhides records labeledrestricted=truefrom every caller, whatever anAllowgrants.
The following table shows the result for four callers: FinanceReader, tagged department=finance; LegalReader, tagged department=legal; PlatformEngineer, tagged team=platform; and RegistryAdmin, with neither tag.
| Caller | Record | Returned | Why |
|---|---|---|---|
|
|
|
Yes |
|
|
|
|
No |
Values compare exactly, so the label |
|
|
|
No |
The record has no |
|
|
|
No |
|
|
|
|
No |
|
|
|
|
Yes |
|
|
|
|
No |
|
|
|
|
No |
Neither |
As a result, FinanceReader discovers only finance-mcp, and LegalReader discovers no records. PlatformEngineer discovers every record except restricted-finance-mcp. RegistryAdmin discovers no records until an Allow applies to it.
This configuration is only as reliable as the principal tags that it tests. To control who can set them, see Prevent callers from setting their own principal tags. To decide how a configuration treats unlabeled records, see Unlabeled records and new values.
What the caller receives
A hidden record looks different from a failed request. The following list summarizes what a caller receives. The page for each interface describes its full response format.
-
Hidden records are omitted. Search and List return only the records that the configuration allows, so a successful response can contain no records. A response can also contain fewer records than
maxResults. For details, see Search results under a record visibility configuration. -
BatchGet reports hidden records as not found. Each hidden record that IAM authorizes appears in
errorswithRESOURCE_NOT_FOUND, the same code as a missing or unapproved record. Don’t treat this code as proof that someone deleted the record. A record that IAM denies appears withACCESS_DENIEDinstead. If IAM denies every record in a directBatchGetDiscoverableRegistryRecordcall, the request fails with HTTP 403. The MCP batch-get tool reports that case as a tool error, withisErrorset totrue. For details, see the BatchGetDiscoverableRegistryRecord response. -
A page with a continuation token isn’t the end. A List page can be short or empty and still contain a
nextToken. Keep paging until a response has nonextToken. For details, see Response ordering and pagination. -
MCP tools apply the same visibility rules as the matching APIs. A tool error arrives as a result with
isErrorset totrue. For details, see Tool results and errors. -
Exclusion never bypasses validation or authorization. An invalid or unauthorized request fails, even if the configuration hides every record from the caller.
-
An unreadable configuration or unreadable evaluation data fails the whole request. The service doesn’t fall back to discovery without a configuration, and it doesn’t skip records. For recovery, see An InternalServerException on Search, List, or BatchGet.
For other request failures and how to recover from them, see Troubleshooting record visibility configurations.