All Products
Search
Document Center

Agent Sandbox:Authorize RAM users to access the console

Last Updated:Oct 13, 2026

Enable console logon for a Resource Access Management (RAM) user, create and grant a RAM permission policy, and verify the authorization result in Agent Sandbox.

Before a RAM user can access the Agent Sandbox console, you must enable console logon for the user and grant the permissions required to manage the corresponding resources. A custom RAM permission policy limits the resources that the user can manage, such as Teams, API Keys, Templates, Sandboxes, and Volumes.

You must also grant the corresponding RAM permissions when you call public operations by using Alibaba Cloud OpenAPI, SDKs, or the command line interface (CLI).

Prerequisites

  • Agent Sandbox is activated for the Alibaba Cloud account.

  • The target RAM user is created. For more information, see Quick start: Create a RAM user and grant permissions.

  • The operator is an Alibaba Cloud account (root account) or a RAM identity. The RAM identity must have the permissions to manage RAM user logon settings, create permission policies, and grant permissions to RAM users.

Step 1: Enable console logon

Skip this step if console logon is already enabled for the user. For more information, see Manage RAM user logon settings.

  1. Log on to the RAM console, and choose Identities > Users, and click the name of the target RAM user.

  2. On the Authentication tab, in the Login Profile section, click Enable Console Logon.

  3. Turn on Console Access, set a logon password, configure password reset at first logon and multi-factor authentication (MFA) if your enterprise requires them, and then click OK.

Step 2: Create a permission policy

Select a policy based on the scope of the user's work, and retain only the permissions that are required:

Work that the user needs to perform

Authorization scope

Manage all Agent Sandbox resources in the account centrally.

All Agent Sandbox operations and resources.

Manage a specific project or environment.

The specified Team and its sub-resources.

Perform only specific operations.

The operations and resources that correspond to the required API.

Action specifies the operations that are allowed; Resource specifies the resources on which operations can be performed; Condition specifies the conditions under which the policy takes effect, such as a region or a resource group.

In the following examples, <region> is the region in which the resource resides. <account-id> is the unique identifier (UID) of the Alibaba Cloud account to which the resource belongs. <team-id> is the ID of the target Team. Replace the placeholders with actual values before you use the policy.

Manage all Agent Sandbox resources

This policy applies to platform administrators who are responsible for all Agent Sandbox resources in the account. The following policy grants permissions on all Agent Sandbox operations in all regions of the account:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "sandbox:*",
      "Resource": "*"
    }
  ]
}

To limit the region, change Resource to acs:sandbox:<region>:<account-id>:*. This policy grants only Agent Sandbox permissions. Access to other cloud services requires separate authorization.

Manage a specified Team

This policy applies to personnel who manage a specific project or environment. The following policy allows operations on the specified Team and the resources under it:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "sandbox:*",
      "Resource": [
        "acs:sandbox:<region>:<account-id>:teams/<team-id>",
        "acs:sandbox:<region>:<account-id>:teams/<team-id>/*"
      ]
    }
  ]
}

The first Alibaba Cloud Resource Name (ARN) matches the Team itself, and the second matches the sub-resources under the Team. This policy includes permissions to modify and delete the specified Team, but does not grant permissions to create other Teams.

Querying the Team list and account information in the console requires additional query permissions, which the preceding Team-specific policy does not include. See the RAM Action list at the end of this topic to grant the required query permissions. If you grant Team list queries by resource group, the user can view the Teams in that resource group. You must still grant permissions on other Teams separately.

Grant fine-grained permissions by operation

Based on the operations that the user needs to perform, select the required permissions from the RAM Action list at the end of this topic. Limit the scope of operations by using resource ARNs. Action and Resource must match at the same time. An API name may differ from the RAM Action. Use the Action values in the list as the reference.

Limit permissions by resource group

A resource group is not part of the ARN path. To limit permissions to a resource group, add the Condition element to the permission policy and specify the acs:ResourceGroupId condition key. The resource group of a Team determines the resource group of the resources under it, such as Templates, Sandboxes, API Keys, and Volumes.

The following example builds on Team-level authorization and uses the Condition element to limit permissions to the specified resource group:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "sandbox:GetTeam",
      "Resource": "acs:sandbox:<region>:<account-id>:teams/<team-id>",
      "Condition": {
        "StringEquals": {
          "acs:ResourceGroupId": "<resource-group-id>"
        }
      }
    }
  ]
}

If an insufficient-permission error occurs, check the Action required for the operation, the ARN of the target resource, and the region and resource group conditions in the policy.

Save the policy in the RAM console

  1. In the RAM console, choose Permissions > Policies, and click Create Policy.

  2. Click the JSON Editor tab, enter the adjusted JSON policy, and then click OK.

  3. In the Create Policy panel, enter a policy name (for example, SandboxTeamAccess) and a description, and then click OK.

For more information, see Create a custom policy.

Step 3: Grant permissions to the RAM user

  1. In the RAM console, choose Identities > Users.

  2. Find the target RAM user, and click Grant Permission in the Actions column.

  3. Set Resource scope to Account level, and confirm that the principal is the target RAM user.

  4. In the permission policy list, select Custom Policy, search for the policy created in the previous step, and then select it.

  5. Click OK to complete the authorization.

Although you select Account level here, the permissions granted by each policy are still limited by its Resource and Condition. For more information, see Manage RAM user permissions.

Step 4: Log on and verify

  1. Log on to the Alibaba Cloud console as the target RAM user, and go to the Agent Sandbox console.

  2. Switch to the region and resource group to which the authorized resources belong, and then select the target Team.

  3. Verify that the required query and management operations are available, and confirm that unauthorized operations or resources are still denied access.

If the logon fails, check the console logon settings. If an insufficient-permission message appears after the logon, check the current identity, region, resource group, and the operations and resource scope in the policy. The permissions that the user obtains from other policies or RAM user groups also take effect during authentication. When you verify fine-grained authorization, check these grants as well.

References

  • To call operations by using Alibaba Cloud SDKs or CLI, see Alibaba Cloud SDK and API Guide.

  • To use Sandboxes by using the E2B SDK, the E2B CLI, or a compatible API, authenticate with an Agent Sandbox API Key. For more information, see Create an API Key.

  • For information about the RAM role and its permissions that a Sandbox requires to access cloud services such as storage, see Configure a RAM role.

RAM Action list

This section lists the resource ARN expressions and the RAM Actions required by resource type. For more information about how to call each operation, see the Sandbox API portal for the public API operations.

Resource ARNs

The basic format of an ARN is as follows:

acs:sandbox:<region>:<account-id>:<resource-path>

<account-id> is the UID of the Alibaba Cloud account to which the resource belongs, not the RAM user ID. <team-id>, <template-id>, and <volume-id> are the IDs of the corresponding resources. In Sandbox authorization, <template-id> is the actual ID of the Template to which the Sandbox belongs. Do not specify the Template alias or the Sandbox ID.

Resource scope

ARN expression

All resources

*

All Agent Sandbox resources in a specified account and region

acs:sandbox:<region>:<account-id>:*

All Agent Sandbox resources in all regions of a specified account

acs:sandbox:*:<account-id>:*

All Teams in the account

acs:sandbox:<region>:<account-id>:teams/*

A specified Team

acs:sandbox:<region>:<account-id>:teams/<team-id>

All sub-resources under a specified Team

acs:sandbox:<region>:<account-id>:teams/<team-id>/*

All Templates in a Team

acs:sandbox:<region>:<account-id>:teams/<team-id>/templates/*

A specified Template

acs:sandbox:<region>:<account-id>:teams/<team-id>/templates/<template-id>

All Sandboxes in a Team

acs:sandbox:<region>:<account-id>:teams/<team-id>/templates/*/*

Sandboxes under a specified Template

acs:sandbox:<region>:<account-id>:teams/<team-id>/templates/<template-id>/*

All API Keys in a Team

acs:sandbox:<region>:<account-id>:teams/<team-id>/apikeys/*

All Volumes in a Team

acs:sandbox:<region>:<account-id>:teams/<team-id>/volumes/*

A specified Volume

acs:sandbox:<region>:<account-id>:teams/<team-id>/volumes/<volume-id>

All Quotas in a Team

acs:sandbox:<region>:<account-id>:teams/<team-id>/quotas/*

All Template Caches in a Team

acs:sandbox:<region>:<account-id>:teams/<team-id>/template-caches/*

A specified Template Cache

acs:sandbox:<region>:<account-id>:teams/<team-id>/template-caches/<template-id>

The following table lists the ARNs that match all resources of a specific type in the account. To determine whether an operation supports cross-Team queries, refer to the request parameter description of that operation in the Sandbox API portal. If an operation requires the teamID parameter, you must still specify it. Account-level ARN authorization cannot replace a required parameter. If you need to manage only a specific Team, prefer the Team-level scopes in the preceding table.

Resource scope

ARN expression

All Templates in the account

acs:sandbox:<region>:<account-id>:teams/*/templates/*

All Sandboxes in the account

acs:sandbox:<region>:<account-id>:teams/*/templates/*/*

All API Keys in the account

acs:sandbox:<region>:<account-id>:teams/*/apikeys/*

All Volumes in the account

acs:sandbox:<region>:<account-id>:teams/*/volumes/*

All Quotas in the account

acs:sandbox:<region>:<account-id>:teams/*/quotas/*

All Template Caches in the account

acs:sandbox:<region>:<account-id>:teams/*/template-caches/*

An account-level ARN and a resource-specific ARN correspond to different request scopes. The permission to query a single resource does not allow you to list all resources of that type in the account. The following tables list the RAM Actions and their purposes by resource type. For operations that support the teamID parameter, specify the ID of the target Team if you have only Team-level permissions.

Team management

RAM Action

Purpose

sandbox:CreateTeam

Creates a Team.

sandbox:ListTeams

Queries the Team list.

sandbox:GetTeam

Queries the details of a Team.

sandbox:UpdateTeam

Updates the configurations of a Team.

sandbox:DeleteTeam

Deletes a Team.

sandbox:ListTeams uses the ARN of all Teams in the account. You cannot grant list query permissions through a single Team ARN. To limit a query to a resource group, specify the corresponding resourceGroupID. In a sandbox:UpdateTeam request, the resourceGroupID parameter changes the resource group to which the Team belongs. This operation checks the permissions on both of the source and the destination resource groups.

API Key management

RAM Action

Purpose

sandbox:CreateApiKey

Creates an API Key.

sandbox:ListApiKeys

Queries the API Key list.

sandbox:DescribeApiKey

Queries the details of an API Key.

sandbox:UpdateApiKey

Updates the configurations of an API Key.

sandbox:ResetApiKey

Resets an API Key.

sandbox:DeleteApiKey

Deletes an API Key.

The RAM authorization granularity of an API Key is the Team. Even if you query, update, or delete a specific API Key, use apikeys/*. If an update request contains permissionPolicy or expectedPolicyVersion, you must have both of the sandbox:UpdateApiKey and sandbox:CreateApiKey permissions.

Template management

RAM Action

Purpose

sandbox:CreateTemplate

Creates a Template and submits a build.

sandbox:ListTemplates

Queries the Templates under a Team.

sandbox:GetTemplate

Queries the details of a Template.

sandbox:UpdateTemplate

Updates the configurations of a Template.

sandbox:DeleteTemplate

Deletes a Template.

Template Cache management

RAM Action

Purpose

sandbox:CreateTemplateCache

Creates a Template Cache.

sandbox:ListTemplateCache

Queries the Template Cache list.

sandbox:DescribeTemplateCache

Queries the details of a Template Cache.

sandbox:DeleteTemplateCache

Deletes a Template Cache.

The last segment of the ARN of a Template Cache, which caches template images, uses <template-id>. Template Cache and Template use different resource paths and Actions. You cannot use Template permissions in place of Template Cache permissions.

Sandbox management

RAM Action

Purpose

sandbox:CreateSandboxInner

Creates a Sandbox.

sandbox:ListSandboxesInner

Queries the Sandbox list.

sandbox:GetSandboxInner

Queries the details of a Sandbox.

sandbox:PauseSandboxInner

Pauses a Sandbox.

sandbox:ResumeSandboxInner

Resumes a Sandbox.

sandbox:DeleteSandboxInner

Releases a Sandbox.

sandbox:UpdateSandboxTimeoutInner

Updates the timeout period of a Sandbox.

Sandbox permissions are granted based on the Template to which the Sandbox belongs. The resource path is teams/<team-id>/templates/<template-id>/*. You cannot limit permissions to a single Sandbox ID.

Volume management

RAM Action

Purpose

sandbox:CreateVolume

Creates a Volume.

sandbox:ListVolumes

Queries the Volume list.

sandbox:GetVolume

Queries the details of a Volume.

sandbox:UpdateVolume

Updates the configurations of a Volume.

sandbox:DeleteVolume

Deletes a Volume.

The ARN of a specified Volume uses <volume-id>, not the Volume name that is referenced when the Volume is mounted. Create operations and list queries typically use the ARN of all Volumes in a Team. Queries, updates, and deletions by ID use the ARN of the specified Volume.

Quota management

RAM Action

Purpose

sandbox:ListQuotas

Queries the Quota list of the Alibaba Cloud account (root account).

sandbox:DescribeQuota

Queries the Quota of a specified Team.

sandbox:UpdateQuota

Updates the Quota of a specified Team.

sandbox:DeleteQuota

Deletes the Quota of a specified Team.

Account feature configurations

RAM Action

Purpose

sandbox:GetFeatureConfigInner

Queries the feature configurations of an account.