CreateDigitalEmployee
Creates a digital employee.
Operation description
Creates a digital employee.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
starops:CreateDigitalEmployee |
create |
*DigitalEmployee
|
None |
|
Request syntax
POST /digital-employee HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The digital employee structure. |
|
| defaultRule |
string |
No |
The default rule of the digital employee. |
test |
| description |
string |
No |
The description of the digital employee. |
aaa |
| displayName |
string |
No |
The display name of the digital employee. |
digial-employee-test |
| roleArn |
string |
Yes |
The ARN of the RAM role. |
acs:ram::12345678912:role/testrole |
| name |
string |
Yes |
The name of the digital employee. |
test |
| channel |
string |
No |
The channel type. |
default |
| knowledges |
object |
No |
The list of knowledge bases. |
|
| bailian |
array<object> |
No |
The list of Bailian knowledge bases. |
|
|
object |
No |
The list of Bailian knowledge bases. |
||
| workspaceId |
string |
No |
The ID of the Bailian workspace. |
llm-xxxxx |
| indexId |
string |
No |
The ID of the Bailian index. |
index-xxxx |
| region |
string |
No |
The region of the knowledge base. |
cn-beijing |
| attributes |
string |
No |
The attributes of the knowledge base. |
test |
| sop |
array<object> |
No |
The list of SOP knowledge bases. |
|
|
object |
No |
The SOP knowledge base. |
{ "type": "oss", "basePath": "docs/", "region": "cn-hangzhou", "endpoint": "oss-cn-hangzhou.aliyuncs.com", "bucket": "my-sop-bucket", "description": "sls sop" } |
|
| resourceGroupId |
string |
No |
The ID of the resource group. |
rg-ae******ey |
| tags |
array |
No |
The tags. |
|
| Tag |
No |
The tags. |
||
| attributes |
object |
No |
The attributes of the digital employee. |
|
|
string |
No |
The attribute values of the digital employee. |
{"test":"test"} |
|
| toolPolicy |
object |
No |
The tool policy. |
{"aliyun":{"enable":true,"denyPolicy":["ecs:RunCommand","ecs:Delete*"],"autoPassPolicy":["log:Get*","log:List*"],"statements":[{"decision":"user_ack","product":"Sls","apiVersion":"2020-12-30","actions":["log:GetProject","log:CreateDashboard"]}]}} |
| global |
object |
No |
The global auto-pass rules for tool invocation. |
|
| autoPassPolicy |
array |
No |
The array of auto-pass policies. |
[{"version":"v1.0.0","fullCommand":"starops tool list"},{"version":"v1.0.0","commandPrefix":["starops sls"]}] |
| AutoPassPolicy |
No |
The array of auto-pass policies. |
||
| aliyun |
object |
No |
The security policy configuration for Aliyun CLI tool invocation. |
{"enable":true,"denyPolicy":["ecs:RunCommand","ecs:Delete*"],"autoPassPolicy":["log:Get*","log:List*"],"statements":[{"decision":"user_ack","product":"Sls","apiVersion":"2020-12-30","actions":["log:GetProject","log:CreateDashboard"]}]} |
| enable |
boolean |
No |
Specifies whether to enable the policy. |
true |
statements
deprecated
|
array<object> |
No |
[Deprecated] Use denyPolicy and autoPassPolicy instead. This field is still read during the transition period. Original description: The list of Aliyun OpenAPI tool policy statements. |
[{"decision":"user_ack","product":"Sls","apiVersion":"2020-12-30","actions":["log:GetProject","log:CreateDashboard"]}] |
|
object |
No |
A single Aliyun OpenAPI tool policy statement. |
{"decision":"user_ack","product":"Sls","apiVersion":"2020-12-30","actions":["log:GetProject","log:CreateDashboard"]} |
|
| decision |
string |
No |
The execution policy after the API is matched. Valid values:
|
user_ack |
| product |
string |
No |
The Aliyun OpenAPI product name corresponding to this statement. |
Sls |
apiVersion
deprecated
|
string |
No |
The Aliyun OpenAPI version corresponding to this statement. |
2020-12-30 |
| actions |
array |
No |
The list of Aliyun OpenAPI actions. The format is product:ApiName, product:Prefix*, or product:*. |
["log:GetProject","log:CreateDashboard"] |
|
string |
No |
The RAM action. The format is product:ApiName, product:Prefix*, or product:*. |
log:GetProject |
|
| denyPolicy |
array |
No |
The denied RAM actions. The format is , product:ApiName, or product:Prefix. |
["ecs:RunCommand","ecs:Delete*"] |
|
string |
No |
The denied RAM actions. The format is , product:ApiName, or product:Prefix. |
ecs:Delete* |
|
| autoPassPolicy |
array |
No |
The auto-passed RAM actions. The format is , product:ApiName, or product:Prefix. |
["log:Get*","log:List*"] |
|
string |
No |
The auto-passed RAM actions. The format is , product:ApiName, or product:Prefix. |
log:Get* |
|
| hooks |
array |
No |
The hook configuration. |
|
| Hook |
No |
The hook definition structure. |
||
| sandboxNetworkPolicy |
object |
No |
The sandbox network ACL policy configuration for the digital employee. |
{"allowFqdns":["api.example.com"],"allowCidrs":["1.2.3.0/24","8.8.8.8"],"enableAcl":false} |
| allowFqdns |
array |
No |
The list of allowed FQDNs. |
|
|
string |
No |
The list of allowed FQDNs. |
api.example.com |
|
| allowCidrs |
array |
No |
The list of allowed CIDR blocks or IP addresses. |
|
|
string |
No |
The list of allowed CIDR blocks or IP addresses. |
8.8.8.8 |
|
| enableAcl |
boolean |
No |
Specifies whether to enable the sandbox network ACL. |
false |
Hook configuration
Configure digital employee hooks through toolPolicy.hooks. Each item corresponds to an event and a handler, and is loaded and executed in the order of the array. Hooks with the same name are executed independently. A hook is executed only when enable is set to true and the scope, event, and tool name match. An empty array indicates that no digital employee hooks are loaded.
schemaVersion: The configuration protocol version. Set the value tov1.name: A non-empty name. Only English letters, digits, underscores (_), and hyphens (-) are allowed.scope:all(Chat and Mission),chat, ormission.event:TurnStart,TurnEnd,ToolStart, orToolEnd.match: An array of tool names. This field is only used forToolStartandToolEnd. It performs exact matching based on the actual name and does not support wildcards. An empty array does not restrict tools. This field is ignored for other events.execution.type:prompt,bash,python3, orhint. Forinstruction, enter a prompt, a Bash script, a Python 3 script, or text appended to the context. The value must be non-empty UTF-8 text.execution.timeoutSeconds: 1 to 30 seconds. All attempts and waits share this timeout period.execution.maxRetry: The number of additional attempts after a failure. Valid values: 0 to 3.execution.failResult: If the handler return value is still invalid after retries, the system processes it based onalloworreject.
Global auto-pass policy
Configure command auto-pass rules through toolPolicy.global.autoPassPolicy. Each rule must provide version: "v1.0.0" and use one of the following two matching methods:
fullCommand: An exact match for a non-empty full command.commandPrefix: An array of command prefixes. It must and can only contain one non-empty prefix.
fullCommand and commandPrefix cannot be configured at the same time, nor can they be omitted at the same time. The rules here use the command format, whereas toolPolicy.aliyun.autoPassPolicy uses RAM Action strings. The two formats are different.
The following is a configuration example for these two parts in toolPolicy:
{
"global": {
"autoPassPolicy": [
{
"version": "v1.0.0",
"fullCommand": "starops tool list"
},
{
"version": "v1.0.0",
"commandPrefix": [
"starops sls"
]
}
]
},
"hooks": [
{
"schemaVersion": "v1",
"name": "tool-reminder",
"enable": true,
"scope": "all",
"event": "ToolStart",
"match": [
"Bash"
],
"execution": {
"type": "hint",
"instruction": "Confirm the target resources and parameters before executing the tool.",
"timeoutSeconds": 10,
"maxRetry": 0,
"failResult": "reject"
}
}
]
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The API response data. |
||
| requestId |
string |
The request ID. |
3B311FD9-A60B-55E0-A896-A0C73********* |
| name |
string |
The name of the digital employee. |
test |
Examples
Success response
JSON format
{
"requestId": "3B311FD9-A60B-55E0-A896-A0C73*********\n",
"name": "test"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.