Create a run strategy

Create a running policy configuration for reference by the agent.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/runtime-policy-profiles

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and target workspace ID that can access the target workspace.

Request body

Replace $WORKSPACE_ID, $CLOUDSIGMA_API_KEY in the example with actual values.

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/runtime-policy-profiles" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "默认运行限制",
  "budgets": {
    "max_steps": 20
  }
}'

Parameter

Type

Required

Description

workspace_id

string

Yes

The current workspace ID must be consistent with X-Workspace-ID.

Request body

Field

Type

Required

Description

id

string

No

logo.

name

string

Yes

Policy name.

description

string

No

Strategy description.

status

string

No

Policy status.

scope_type

string

No

Policy scope type.

scope_ref

string

When not in workspace

Required when in non-workspace scope, provide non-null reference.

admission

object

No

Admission conditions.

budgets

object

No

Budget constraints.

retry

object

No

Retry strategy.

data_policy

object

No

Data strategy.

artifact_policy

object

No

Product strategy.

provider_constraints

object

No

Run provider constraints.

labels

object

No

Tag key-value pairs.

annotations

object

No

Annotation key-value pairs.

metadata

object

No

Extended metadata.

scope_type supports workspace, role, agent and provider_profile, and the default is workspace. When selecting other scopes, non-empty scope_ref must be filled in. When saving, only the reference format is verified and the existence of the resource is not checked.

status supports draft, active, disabled and archived.

id can be specified by yourself, and will be generated by the service when omitted or empty. status defaults to draft, scope_type defaults to workspace. workspace_id and user_id in the request are not used to specify the workspace or operator to which they belong.

The values labels and annotations only support strings or null. Other configuration objects can contain legal JSON extension fields. When created, the configuration object cannot be null.

When updating, omit the field or fill in null to retain the original value, and clear the object when filling in {}. An empty update will also increment the version. This interface does not check whether old versions have changed.

Successful response

JSON
{
  "code": 0,
  "data": {
    "id": "policy_01",
    "workspace_id": "ws_01",
    "name": "默认运行限制",
    "status": "active",
    "scope_type": "workspace",
    "budgets": {
      "max_steps": 20
    },
    "version": 1,
    "created_at": "2026-08-21T07:00:00Z",
    "updated_at": "2026-08-21T07:00:00Z"
  }
}

Field

Type

Description

data.id

string

Run policy ID.

data.workspace_id

string

The workspace ID to which it belongs.

data.name

string

Policy name and status.

data.description

string

Description.

data.status

string

Policy name and status. Values: draft, active, disabled, archived.

data.scope_type

string

Scope types and references. References are only returned if they have a value. Values: workspace, role, agent, provider_profile.

data.scope_ref

string

Scope types and references. References are only returned if they have a value.

data.admission

object

Admission, budgeting, and retry configuration. Only returned if there is a value.

data.budgets

object

Admission, budgeting, and retry configuration. Only returned if there is a value.

data.retry

object

Admission, budgeting, and retry configuration. Only returned if there is a value.

data.data_policy

object

Data, Product and Provider Restrictions. Only returned if there is a value.

data.artifact_policy

object

Data, Product and Provider Restrictions. Only returned if there is a value.

data.provider_constraints

object

Data, Product and Provider Restrictions. Only returned if there is a value.

data.version

integer

Strategy version.

data.labels

object

Tag mapping.

data.annotations

object

Annotation mapping.

data.metadata

object

Extended metadata.

data.created_by

string

Creator.

data.updated_by

string

Last updated by.

data.created_at

string

Creation and update time. RFC 3339 time.

data.updated_at

string

Creation and update time. RFC 3339 time.

Error response

JSON
{
  "code": 2,
  "message": "运行策略参数无效"
}

Field

Type

Description

code

integer

error code.

message

string

Error message for the caller.

Last updated on