A policy is a collection of rules that controls the behavior of an API key. You can create custom policies and associate them with an API key.
Create a policy
Log on to the AgentBay console.
In the navigation pane on the left, click Policy Management.
On the Policy Management page, click Create Policy.

On the Policy Management page, configure the following parameters and then click Confirm.
Parameter
Description
Basic Information
Policy Name
Enter a custom policy name. The name can contain up to 128 characters.
Connection Settings
Release Inactive Desktop
If enabled, the system automatically releases an inactive desktop when the stop times for both MCP and user interaction are met.
Release Desktop after MCP Interaction Terminates
Enter the time in minutes to wait before releasing the desktop after MCP interaction stops. The value must be between 1 and 1,000.
NoteThe desktop is released only when the stop times for both MCP and user interaction are met.
Release Desktop after User Interaction Terminates
Enter the time in minutes to wait before releasing the desktop after user interaction stops. The value must be between 3 and 1,000.
NoteThe desktop is released only when the stop times for both MCP and user interaction are met.
Max Runtime for a Single Session
Enter the maximum runtime for a single desktop session in minutes. The value must be between 1 and 1,000.
Auto-creation Settings
Max. Cloud Desktops in Pool
Enter the maximum number of cloud desktops that can be created in the pool.
NoteIf the number of automatically created cloud desktops reaches the configured limit, no more desktops will be created. The limit for trial accounts is 10.
Modify a policy
You can modify existing policies as needed.
On the Policy Management page, find the target policy and click Modify Policy in the Actions column.
On the Modify Policy page, modify the parameter values as needed and then click Confirm.
NoteDefault system policies cannot be modified.
View associated API KEYs
View the API keys associated with a policy using one of the following methods:
Method 1:
On the Policy Management page, find the target policy and click Associated API Key in the Actions column.
In the dialog box that appears, view the API Key Name and API Key Value.
Method 2:
On the Policy Management page, click the policy ID of the target policy.
On the Policy Details page, view the associated API KEYs.
Delete a policy
Delete policies that you no longer need.
On the Policy Management page, find the target policy and click Delete in the Actions column.
In the dialog box that appears, click OK.
ImportantDefault system policies or policies that are associated with an API KEY cannot be deleted.