Manage AgentSpace resource tags
Resource tags consist of a tag key and a tag value and are used to identify and classify AgentSpaces. This topic describes how to add, modify, and delete resource tags for an AgentSpace, and how to query AgentSpaces by tag.
Prerequisites
An AgentSpace is created and in the available state.
Your account has access to the target AgentSpace. If you use a RAM user or RAM role, grant the required tag operation permissions. For more information, see RAM permission policy reference.
Operation
Required permission
View space details and query the space list
agentloop:GetAgentSpace,agentloop:ListAgentSpacesQuery resource tag bindings
agentloop:ListTagResourcesAdd tags and modify tag values
agentloop:TagResourcesUnbind tags
agentloop:UntagResources
Usage limits
Item | Limit |
Supported resource | AgentSpace only. Tags are bound to a specific AgentSpace. |
Resource scope | The target must be an AgentSpace that is created and available in the requested region under the current account. All resources in a single batch request must be in the same region. |
Tags per resource | Up to 20 user-defined tags. |
Tag key length | 1 to 128 Unicode characters. The key cannot be empty. |
Tag value length | 0 to 256 Unicode characters. An empty string is allowed. |
Tag key uniqueness | Tag keys within an AgentSpace must be unique. If you set a new value for an existing key, the value is updated and other tags remain unchanged. |
Case sensitivity | Tag keys and tag values are case-sensitive. For example, |
Reserved prefix | Tag keys cannot start with |
URL strings | Tag keys and tag values cannot contain |
Character range | Unicode letters, digits, spaces, and other separators are supported, along with the special characters listed below. Line breaks, tabs, emoji, and other unsupported characters are not allowed. |
Resources per API request | A single bind, unbind, or query-by-resource request can specify up to 50 AgentSpaces. Resource names must be unique. |
Tag parameters per API request | A single bind request can contain up to 20 tags. A single unbind-by-key request can contain up to 20 tag keys. A single query request can contain up to 20 tag filter conditions. Tag keys in the same request must be unique. |
The following special characters are supported. Each character can be used on its own:
-.!@#$%\^&*)(+={}[]/",'<>~·`?:;|_。?!,、;:“”‘’()《》〈〉【】『』「」﹃﹄〔〕…—~﹏¥Different AgentSpaces can use the same tag keys and values independently. For example, multiple spaces can be tagged with
env=prod.Resource tags on an AgentSpace are managed separately from the tags on its associated SLS project, CloudMonitor 2.0 workspace, and MSE namespace. Adding a resource tag does not automatically add the same tag to these associated resources.
The resource tags described in this topic are managed separately from features such as prompt version tags and attribution tags.
Manage resource tags
Log on to the AgentLoop console, select the target AgentSpace, and go to System Management > Space Management. In the Tags section, click the edit icon.
Add a tag
Add a tag key and a tag value. You can set tags by environment, business, or team, as shown in the following example.
Tag key
Tag value
Purpose
envprodIdentifies the production environment.
businesscustomer-serviceIdentifies the customer service business.
teamsearchIdentifies the team.
Add more tags as needed. A tag value can be empty, but a tag key cannot.
Submit the tag configuration, and check the tag list of the target AgentSpace to confirm that the tag is added.
Modify a tag
Click the edit icon and find the tag key to modify.
Change the tag value. For example, change the value of
envfromtesttoprod.Submit the change and confirm that the tag list shows the new value.
Changing a tag value affects only the corresponding tag on the current AgentSpace. To change a tag key, unbind the existing tag first and then add the new key-value pair.
Delete a tag
Click the edit icon and select the tag to delete.
Remove the tag and submit the change.
Check the tag list to confirm that the tag is unbound from the current AgentSpace.
Deleting a tag only removes the association between the tag and the current AgentSpace. It does not delete the AgentSpace or tags with the same name on other resources. If the AgentSpace is deleted, the system removes its tag associations.
Query AgentSpaces by tag
You can call ListAgentSpaces and use the tag parameter to filter AgentSpaces. Use the service endpoint of the region where the target resources reside.
Query | tag parameter example | Description |
Query spaces in the production environment |
| Exactly matches |
Query spaces that have an environment tag |
| Matches spaces that have the |
Query spaces whose environment tag value is empty |
| Matches only spaces whose |
Query production spaces of a team |
| Multiple conditions are combined with AND. All conditions must be met. |
When you specify tag filter conditions,
keyis required. Omittingvaluehas a different meaning from passing an empty string.nullis not supported as a wildcard value.When you filter by tag, only AgentSpaces available in the current region are returned. An empty
tagarray is equivalent to no tag filter.ListAgentSpacesreturns space information and all its tags, whereasListTagResourcesreturns tag bindings. To view only all tags of an AgentSpace, callListTagResourceswith the resource name of the space and do not specify tag filter conditions.tags: []in the response indicates that the space has no tags. If thetagsfield is omitted from the response, it does not mean that the space has no tags. For tag return rules in cross-region lists, see the API reference.
Related APIs
When you call the three tag APIs, set resourceType to agentspace (case-insensitive) and resourceId to the AgentSpace name. The region is determined by the service endpoint. You do not need to pass regionId in the business request parameters of these three APIs.
API | Description |
Binds tags to one or more AgentSpaces, or updates the value of an existing tag key. | |
Unbinds specified tags or all user-defined tags from one or more AgentSpaces. | |
Queries resource tag bindings by resource name or tag conditions. | |
Queries the details and tags of a specified AgentSpace. | |
Queries the AgentSpace list and supports filtering by tag. |