All Products
Search
Document Center

AgentLoop:Restrict RAM permissions for a specific AgentSpace

Last Updated:Aug 17, 2026

An AgentSpace is the smallest unit of resource isolation and permission management in AgentLoop. Use the RAM policy templates in this topic to grant full management permissions on AgentLoop to a RAM user or RAM user group, or to restrict that user or group to a single AgentSpace together with the Simple Log Service, Cloud Monitor, and Microservices Engine resources that are associated with it. Scoped templates keep multiple AgentSpaces that belong to the same Alibaba Cloud account isolated from each other.

How permissions on an AgentSpace map to cloud resources

Each AgentSpace in AgentLoop is associated with a set of resources in other Alibaba Cloud services:

  • Simple Log Service (SLS) — The SLS Project and the SLS Trace Project that are associated with the AgentSpace.

  • Cloud Monitor (CMS) — The CMS Workspace that is associated with the AgentSpace.

  • Microservices Engine (MSE) and AI Registry — The MSE Namespace that is associated with the AgentSpace. In RAM, the namespace is addressed under the airegistry resource prefix, which covers assets such as prompts and skills. The airegistry resource path uses the MSE Namespace ID in the form saas/${MSENamespaceId}.

Restricting permissions on a specific AgentSpace therefore means scoping the agentloop, log, cms, and airegistry resources within a single policy.

Choose a policy template

The following table maps each scenario to a template and indicates whether the console home page policy must be attached as well.

Scenario

Template

Console home page policy

Grant a RAM user or RAM user group full management permissions on AgentLoop and all of its associated resources

AgentLoopFullAccess

Not required. The template allows agentloop:* on all resources, which covers agentloop:ListAgentSpaces.

Restrict a RAM user or RAM user group to a single AgentSpace and allow only a defined set of operations

Scoped template with an explicit operation allowlist (Recommended)

Required, in addition to the scoped template.

Restrict a RAM user or RAM user group to a single AgentSpace without maintaining an operation list

Scoped template with wildcarded operations

Required, in addition to the scoped template.

The two scoped templates are alternatives to each other: attach one of them, not both.

Important

Attach either the AgentLoopFullAccess template or one scoped template to the same RAM user or RAM user group, never both. AgentLoopFullAccess allows agentloop:* on all resources, so the resulting permissions are not limited to a single AgentSpace.

Collect the required resource values

The scoped templates address the target AgentSpace and its associated resources by their actual values. Collect the following values from the Alibaba Cloud Management Console before you create the policy.

Placeholder

Value

Where to find it

${AgentSpace}

AgentSpace name

In the AgentLoop console, open the AgentSpace list and then the details page of the target AgentSpace.

${CMSWorkspace}

CMS Workspace name

In the Cloud Monitor 2.0 console, open the Workspace list and select the workspace that is associated with the AgentSpace.

${MSENamespaceId}

MSE Namespace ID

In the MSE console, open the Namespace list, select the namespace that is associated with the AgentSpace, and copy its Namespace ID.

${SLSProject}

SLS Project

In the Simple Log Service console, open the Project list and select the project that is associated with the AgentSpace.

${SLSTraceProject}

SLS Trace Project

In the Simple Log Service console, open the Project list and select the trace project that is associated with the AgentSpace.

Important

Replace every placeholder with the value that you collected before you attach a scoped policy. A policy that still contains placeholders matches no resource, and access is denied.

Policy templates

All templates in this topic are RAM permission policies. Create a custom policy in the RAM console from the template that you choose, and then attach the policy to a RAM user or a user group.

Grant full management permissions (AgentLoopFullAccess)

The AgentLoopFullAccess template grants full management permissions on AgentLoop and all of its associated resources. Attach it to a RAM user or RAM user group that manages every AgentSpace in the Alibaba Cloud account.

Important

This template does not scope permissions to a single AgentSpace. It allows agentloop:* on all AgentLoop resources in the account, and allows the listed SLS, CMS, and AI Registry operations on all resources of those services.

Create a custom policy that contains the following statements:

{
    "Version": "1",
    "Statement": [
        {
            "Action": "agentloop:*",
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "log:GetLogStoreLogs", "log:GetLogStoreHistogram", "log:GetIndex", "log:GetLogStore",
                "log:CreateIndex", "log:ListLogStores", "log:GetProject", "log:ListProject",
                "log:CreateLogStore", "log:UpdateIndex", "log:UpdateLogStore", "log:ListScheduledSQLs",
                "log:CreateScheduledSQL", "log:EnableScheduledSQL", "log:GetScheduledSQL",
                "log:UpdateScheduledSQL", "log:DisableScheduledSQL", "log:ListDashboard", "log:GetDashboard",
                "log:CreateDashboard", "log:UpdateDashboard", "log:DeleteDashboard", "log:ListTagResources",
                "log:TagResources", "log:UntagResources", "log:ListDashboardSharing",
                "log:CreateDashboardSharing", "log:AccessDashboardSharing", "log:UpdateDashboardSharing",
                "log:DeleteDashboardSharing"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "airegistry:ListNamespaces", "airegistry:GetNamespace", "airegistry:GetPrompt",
                "airegistry:CreatePrompt", "airegistry:ListPrompts", "airegistry:UpdatePrompt",
                "airegistry:DeletePrompt", "airegistry:ListPromptVersions", "airegistry:GetPromptVersion",
                "airegistry:GetPromptVersionDetail", "airegistry:CreatePromptVersion",
                "airegistry:UpdatePromptVersion", "airegistry:SubmitPromptVersion",
                "airegistry:DeletePromptVersion", "airegistry:GetPromptGovernance",
                "airegistry:CreateSkillDraft", "airegistry:UpdateSkillDraft", "airegistry:DeleteSkillDraft",
                "airegistry:SubmitSkillVersion", "airegistry:PublishSkillVersion",
                "airegistry:ForcePublishSkillVersion", "airegistry:UpdateSkillBizTags",
                "airegistry:UpdateSkillLabels", "airegistry:OnlineSkill", "airegistry:OfflineSkill",
                "airegistry:UpdateSkillScope", "airegistry:GetSkillDetail",
                "airegistry:GetSkillVersionDetail", "airegistry:DownloadSkillVersion",
                "airegistry:ListSkills", "airegistry:DeleteSkill", "airegistry:UploadSkill",
                "airegistry:UploadSkillViaOss", "airegistry:DownloadSkillVersionViaOss"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "cms:ListWorkspaces", "cms:GetWorkspace", "cms:GetEntityStoreData", "cms:GetEntityStore",
                "cms:GetServiceObservability", "cms:DescribeIntranetRegions",
                "cms:DescribeVpcForIntranetSynthetic", "cms:DescribeVswitchForIntranetSynthetic",
                "cms:DescribeSecurityGroupForIntranetSynthetic", "cms:ListServices", "cms:CreateService",
                "cms:GetUmodelCommonSchemaRef", "cms:GetUmodel", "cms:UpsertUmodelCommonSchemaRef",
                "cms:UpsertUmodelData", "cms:ListAddons", "cms:GetAddon", "cms:GetAddonSchema",
                "cms:GetAddonCodeTemplate", "cms:GetAddonMetrics", "cms:GetAddonAlertTemplates",
                "cms:GetPrometheusUserSetting", "cms:GetCmsService", "cms:ListIntegrationPolicies",
                "cms:CreateIntegrationPolicy", "cms:CreateAddonRelease", "cms:GetAddonRelease",
                "cms:ListAddonReleases", "cms:ListIntegrationPolicyResources",
                "cms:ListIntegrationPolicyCollectors", "cms:ListPrometheusInstances",
                "cms:GetCloudResource", "cms:CreateCloudResource", "cms:GetCloudResourceData",
                "cms:ProxyApiForMemberAccount", "cms:CreateServiceObservability"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": ["resourcecenter:GetResourceCenterServiceStatus"],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": "ram:CreateServiceLinkedRole",
            "Resource": "*",
            "Effect": "Allow",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": ["agentloop.aliyuncs.com"]
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": "ram:PassRole",
            "Resource": "acs:ram::*:role/aliyunlogetlrole"
        }
    ]
}

Scope permissions to a single AgentSpace with an explicit operation allowlist (Recommended)

This template scopes every AgentLoop, SLS, CMS, and AI Registry statement to the target AgentSpace and its associated resources, and allows only the operations that are listed for each service. Use it when you need fine-grained control over the set of allowed operations.

Compared with the AgentLoopFullAccess template, the operation lists are unchanged. Only the Resource field differs: it changes from * to the ARNs of the target AgentSpace and its associated resources. The resourcecenter and ram statements grant the same permissions in both templates.

This template does not allow agentloop:ListAgentSpaces on all AgentSpaces. To let the RAM user open the AgentLoop console home page, also attach the policy in Grant access to the AgentLoop console home page.

Create a custom policy that contains the following statements:

{
    "Version": "1",
    "Statement": [
        {
            "Action": "agentloop:*",
            "Resource": [
                "acs:agentloop:*:*:agentspace/${AgentSpace}",
                "acs:agentloop:*:*:agentspace/${AgentSpace}/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "log:GetLogStoreLogs", "log:GetLogStoreHistogram", "log:GetIndex", "log:GetLogStore",
                "log:CreateIndex", "log:ListLogStores", "log:GetProject", "log:ListProject",
                "log:CreateLogStore", "log:UpdateIndex", "log:UpdateLogStore", "log:ListScheduledSQLs",
                "log:CreateScheduledSQL", "log:EnableScheduledSQL", "log:GetScheduledSQL",
                "log:UpdateScheduledSQL", "log:DisableScheduledSQL", "log:ListDashboard", "log:GetDashboard",
                "log:CreateDashboard", "log:UpdateDashboard", "log:DeleteDashboard", "log:ListTagResources",
                "log:TagResources", "log:UntagResources", "log:ListDashboardSharing",
                "log:CreateDashboardSharing", "log:AccessDashboardSharing", "log:UpdateDashboardSharing",
                "log:DeleteDashboardSharing"
            ],
            "Resource": [
                "acs:log:*:*:project/${SLSProject}",
                "acs:log:*:*:project/${SLSProject}/*",
                "acs:log:*:*:project/${SLSTraceProject}/logstore/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "airegistry:ListNamespaces", "airegistry:GetNamespace", "airegistry:GetPrompt",
                "airegistry:CreatePrompt", "airegistry:ListPrompts", "airegistry:UpdatePrompt",
                "airegistry:DeletePrompt", "airegistry:ListPromptVersions", "airegistry:GetPromptVersion",
                "airegistry:GetPromptVersionDetail", "airegistry:CreatePromptVersion",
                "airegistry:UpdatePromptVersion", "airegistry:SubmitPromptVersion",
                "airegistry:DeletePromptVersion", "airegistry:GetPromptGovernance",
                "airegistry:CreateSkillDraft", "airegistry:UpdateSkillDraft", "airegistry:DeleteSkillDraft",
                "airegistry:SubmitSkillVersion", "airegistry:PublishSkillVersion",
                "airegistry:ForcePublishSkillVersion", "airegistry:UpdateSkillBizTags",
                "airegistry:UpdateSkillLabels", "airegistry:OnlineSkill", "airegistry:OfflineSkill",
                "airegistry:UpdateSkillScope", "airegistry:GetSkillDetail",
                "airegistry:GetSkillVersionDetail", "airegistry:DownloadSkillVersion",
                "airegistry:ListSkills", "airegistry:DeleteSkill", "airegistry:UploadSkill",
                "airegistry:UploadSkillViaOss", "airegistry:DownloadSkillVersionViaOss"
            ],
            "Resource": [
                "acs:airegistry:*:*:instance/saas/${MSENamespaceId}",
                "acs:airegistry:*:*:instance/saas/${MSENamespaceId}/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "cms:ListWorkspaces", "cms:GetWorkspace", "cms:GetEntityStoreData", "cms:GetEntityStore",
                "cms:GetServiceObservability", "cms:DescribeIntranetRegions",
                "cms:DescribeVpcForIntranetSynthetic", "cms:DescribeVswitchForIntranetSynthetic",
                "cms:DescribeSecurityGroupForIntranetSynthetic", "cms:ListServices", "cms:CreateService",
                "cms:GetUmodelCommonSchemaRef", "cms:GetUmodel", "cms:UpsertUmodelCommonSchemaRef",
                "cms:UpsertUmodelData", "cms:ListAddons", "cms:GetAddon", "cms:GetAddonSchema",
                "cms:GetAddonCodeTemplate", "cms:GetAddonMetrics", "cms:GetAddonAlertTemplates",
                "cms:GetPrometheusUserSetting", "cms:GetCmsService", "cms:ListIntegrationPolicies",
                "cms:CreateIntegrationPolicy", "cms:CreateAddonRelease", "cms:GetAddonRelease",
                "cms:ListAddonReleases", "cms:ListIntegrationPolicyResources",
                "cms:ListIntegrationPolicyCollectors", "cms:ListPrometheusInstances",
                "cms:GetCloudResource", "cms:CreateCloudResource", "cms:GetCloudResourceData",
                "cms:ProxyApiForMemberAccount", "cms:CreateServiceObservability"
            ],
            "Resource": [
                "acs:cms:*:*:workspace/${CMSWorkspace}",
                "acs:cms:*:*:workspace/${CMSWorkspace}/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": "resourcecenter:GetResourceCenterServiceStatus",
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": "ram:CreateServiceLinkedRole",
            "Resource": "*",
            "Effect": "Allow",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": ["agentloop.aliyuncs.com"]
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": "ram:PassRole",
            "Resource": "acs:ram::*:role/aliyunlogetlrole"
        }
    ]
}

Scope permissions to a single AgentSpace with wildcarded operations

This template scopes Resource exactly as the explicit allowlist template does, but replaces the SLS, CMS, and AI Registry operation lists with the log:*, cms:*, and airegistry:* wildcards. Use it when you do not need to subdivide operations and prefer simpler policy maintenance.

The wildcards allow every operation of those services within the same resource scope, including operations that the explicit allowlist omits. If your permission model requires least privilege, use the explicit allowlist template instead.

As with the explicit allowlist template, this template does not allow agentloop:ListAgentSpaces on all AgentSpaces. To let the RAM user open the AgentLoop console home page, also attach the policy in Grant access to the AgentLoop console home page.

Create a custom policy that contains the following statements:

{
    "Version": "1",
    "Statement": [
        {
            "Action": "agentloop:*",
            "Resource": [
                "acs:agentloop:*:*:agentspace/${AgentSpace}",
                "acs:agentloop:*:*:agentspace/${AgentSpace}/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": "log:*",
            "Resource": [
                "acs:log:*:*:project/${SLSProject}",
                "acs:log:*:*:project/${SLSProject}/*",
                "acs:log:*:*:project/${SLSTraceProject}/logstore/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": "airegistry:*",
            "Resource": [
                "acs:airegistry:*:*:instance/saas/${MSENamespaceId}",
                "acs:airegistry:*:*:instance/saas/${MSENamespaceId}/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": "cms:*",
            "Resource": [
                "acs:cms:*:*:workspace/${CMSWorkspace}",
                "acs:cms:*:*:workspace/${CMSWorkspace}/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": "resourcecenter:GetResourceCenterServiceStatus",
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": "ram:CreateServiceLinkedRole",
            "Resource": "*",
            "Effect": "Allow",
            "Condition": {
                "StringEquals": {
                    "ram:ServiceName": ["agentloop.aliyuncs.com"]
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": "ram:PassRole",
            "Resource": "acs:ram::*:role/aliyunlogetlrole"
        }
    ]
}

Grant access to the AgentLoop console home page

The AgentLoop console home page calls agentloop:ListAgentSpaces to list all AgentSpaces that belong to the current account. Neither scoped template allows this operation on all AgentSpaces, so attach the following minimum policy in addition to the scoped policy:

{
    "Version": "1",
    "Statement": [
        {
            "Action": "agentloop:ListAgentSpaces",
            "Resource": [
                "acs:agentloop:*:*:agentspace/*"
            ],
            "Effect": "Allow"
        }
    ]
}
Note

The AgentSpaces that a RAM user actually sees are then narrowed by resource group and resource-level authorization.

Considerations

Before you use the templates in this topic to isolate an AgentSpace, consider the following:

  • Account-level statements — Every template includes resourcecenter and ram statements that use "Resource": "*". The scoped templates do not narrow these two statements to a single AgentSpace.

  • SLS Trace Project scope — The scoped templates grant the SLS Project at both the project level and the level below it, and grant the SLS Trace Project at the Logstore level only.