重要
本文中的某些信息与预发行的产品有关,该产品在商业发布之前可能有重大修改。 Microsoft 对此处所提供的信息不作任何明示或默示的保证。
开发Security Copilot代理及其工具 (技能) 需要 YAML 或 JSON 格式的清单文件, (例如 manifest.yaml) 。 此文件定义有关工具集 (插件) 的元数据,并指定应如何调用每个工具。
代理清单包括三个顶级密钥,如下所示:
每个键都包含自己的子项/值对集,其中一些是必需/可选字段,具体取决于工具格式。
此参考指南概述了可用于创作Security Copilot代理的清单字段。
代理 YAML
这是示例 manifest.yaml 文件的示例。
Descriptor:
Name: Contoso.SecurityOperations.Samples-090925
Description: DCA URL Geolocation Agent
DisplayName: DCA URL Geolocation Agent
SkillGroups:
- Format: AGENT
Skills:
- Name: URL_Location_DCA_Agent_Entrypoint-090925
Description: The entrypoint into the URL Location Agent
Interfaces:
- Agent
Inputs:
- Required: true
Name: URL
Description: A URL the agent should investigate
Settings:
Model: gpt-4.1
Instructions: |
<|im_start|>system
You are an AI agent that helps a security analyst understand the hosting situation of a URL (the input).
You'll do this by following a three-step process:
1) Use ExtractHostname to find the hostname from the URL provided as input
2) Use GetDnsResolutionsByIndicators to extract IP Addresses that the hostname has been observed resolving to. This may produce a list of IP Addresses.
3) One-at-a time, use lookupIpAddressGeolocation to look up the geolocation of an IP address.
Produce a simply formatted response telling the security analyst which locations that URL is being served from.
If you encounter an error share that.
Always return something the user knows that something happened.
<|im_end|>
<|im_start|>user
{{URL}}
<|im_end|>
ChildSkills:
- lookupIpAddressGeolocation
- ExtractHostname_DCA-090925
- GetDnsResolutionsByIndicators
- Format: GPT
Skills:
- Name: ExtractHostname_DCA-090925
DisplayName: ExtractHostname_DCA-090925
Description: ExtractHostname_DCA-090925
Inputs:
- Name: URL
Description: A URL string
Required: true
Settings:
ModelName: gpt-4.1
Template: |-
<|im_start|>system
Return the hostname component of the URL provided as input. For example:
- If the input is 'https://www.mlb.com/', return 'www.mlb.com'
- If the input is 'http://dev.mycompany.co.uk/sign-up/blah?a=12&b=12&c=32#23', return 'dev.mycompany.co.uk'
- If the input is 'ftp:/x.espon.com', return 'x.espon.com'
<|im_end|>
<|im_start|>user
{{URL}}
<|im_end|>
- Format: KQL
Skills:
- Name: RecentUrlClicks_DCA-090925
Description: Returns 10 recently clicked URLs
Settings:
Target: Defender
Template: UrlClickEvents | sort by TimeGenerated desc | limit 10 | project Url
AgentDefinitions:
- Name: URLLocationAgent-090925
DisplayName: URLLocationAgent
Description: An agent to help an analyst understand URL hosting
Publisher: Contoso
Product: SecurityOperations
RequiredSkillsets:
- Contoso.SecurityOperations.Samples-090925
- ThreatIntelligence.DTI
- DCA_SampleAPIPlugin
AgentSingleInstanceConstraint: None
Settings:
- Name: LookbackWindowMinutes
Label: Max Lookback Window in minutes
Description: The maximum number of minutes to find clicked URLs
HintText: You should probably enter 5
SettingType: String
Required: true
Triggers:
- Name: Default
DefaultPeriodSeconds: 300
FetchSkill: Contoso.SecurityOperations.Samples-090925.RecentUrlClicks_DCA-090925
ProcessSkill: Contoso.SecurityOperations.Samples-090925.URL_Location_DCA_Agent_Entrypoint-090925
代理遵循一个三步过程来调用子技能:
ExtractHostname:使用 GPT 工具ExtractHostname_DCA-090925分析 URL 中的主机名。GetDnsResolutionsByIndicators:使用 Microsoft威胁情报 技能集检索与主机名关联的 IP 地址。 必须在“管理源 > ”“自定义”下启用插件。 确保RequiredSkillsets: ThreatIntelligence.DTI必须添加,而不调用哪个GetDnsResolutionsByIndicators工具。lookupIpAddressGeolocation:OpenAPIoperationId规范中的 ,在 API 插件DCA_SampleAPIPlugin中引用它来查找每个 IP 地址的地理位置数据。 有关参考,请参阅 生成 API 示例。
示例
请参阅 示例集合的完整列表。
有关交互式代理上的代理示例,请参阅 交互式代理。
清单 YAML 语法
下面是三个顶级键及其子项的代理清单参数 (字段) :
描述符字段摘要
| 字段 | 类型 | 说明 | 约束 | 必需 |
|---|---|---|---|---|
Name |
string | 技能集的内部名称。 必须是工作区中的唯一名称。 | 不允许 / , \ ? # @;不能包含空格。 |
是 |
DisplayName |
string | 技能集的用户可读名称。 | 不* | |
Description |
string | 技能集的可读说明。 | 不能为 null 或空。 | 是 |
Authorization |
object | 设置授权值。 有关详细信息,请参阅 身份验证 。 | 不;API 工具必需,且 SupportedAuthTypes 不等于 None。 |
|
SupportedAuthTypes |
数组 | 技能集支持的身份验证类型列表。 有关详细信息,请参阅 身份验证 。 | 不;API 工具需要 |
(* 表示建议但不需要)
AgentDefinitions 字段摘要
| 字段 | 类型 | 说明 | 约束 | 必需 |
|---|---|---|---|---|
Name |
string | 用于安装代理的名称; | 不能包含空格、句点 (.) ,不能为 null 或空。 | 是 |
DisplayName |
string | UI 显示的用户友好名称。 | 是 | |
Description |
string | 代理用途和功能的可读摘要。 | 是 | |
Publisher |
string | 代理发布者的名称。 | 是 | |
Product |
string | 与代理关联的源产品。 在枚举代理定义时用于筛选。 | 是 | |
RequiredSkillsets |
string | 代理正常运行所需的技能集。 | 是 | |
AgentSingleInstanceConstraint |
string | 定义代理的部署位置。 可以设置为 None、 Workspace或 Tenant。 - None:无限制。 - Workspace:每个工作区一个实例。 - Tenant:每个租户一个实例。 |
否 | |
Settings |
object | 仅适用于 FetchSkill 调用。 | 否 | |
Triggers |
object | 定义触发代理的方式和时间。 至少需要一个触发器。 Name:触发器的描述性名称。 DefaultPeriodSeconds:计划执行的间隔(以秒为单位)。 触发器不会阻止并发执行。 若要禁用计划执行,请将此值设置为 0。 FetchSkill:如果已设置,触发器将首先 (工具) 调用此技能。 触发器需要一个对象数组。 对于每个 对象,它使用 对象的值作为 的ProcessSkill输入来调用 ProcessSkill 。 一种常见模式是具有 ListAlerts FetchSkill 和 InvestigateAlertAgent ProcessSkill。 有关触发器的详细信息,请参阅 代理组件。 |
Name:不能包含空格 |
是的; Name 和 ProcessSkill。 |
PromptSkill |
object | 启用与代理的交互性或聊天体验。 | 是的;仅适用于交互式代理。 |
SkillGroups 字段摘要
由技能组的列表组成,包括 Format、Settings 和 Skills。
| 字段 | 类型 | 说明 | 约束 | 必需 |
|---|---|---|---|---|
Format |
string | 有关可用选项,请参阅“格式”部分。 | 是 | |
Skills |
object | 请参阅对象结构的“技能”部分。 | 是的;格式为: GPT、 API、 KQL、、 AGENT |
|
Settings |
object | 请参阅对象结构的“设置”部分。 | 是的;格式为: API、 GPT、 KQL、、 AGENT |
格式 (SkillGroups 字段)
字段 Format 的选项:
技能 (SkillGroups 字段)
字段的对象 Skills 结构:
| 字段 | 类型 | 说明 | 约束 | 必需 |
|---|---|---|---|---|
Name |
string | 此工具的内部名称 (技能) | 不能包含空格和句点 (.) | 是 |
DisplayName |
string | 此工具的用户可读名称。 | 建议 | |
Description |
string | 此工具的可读说明 | 不能为 null 或空。 | 建议 |
Inputs |
object | 用于用户输入工具的名称、说明和必需对象或可选对象的列表。 | 否 | |
Settings |
object | 基于技能 格式 的自定义设置。 | 是 | |
ChildSkills |
array of strings | 代理在执行期间依赖或调用的工具名称列表。 这些工具执行特定任务,并由代理调用以达到其目标。 允许链接或组合多个工具,以生成更复杂的代理行为。 | 不;但是,仅适用于技能,并且是必需的 FORMAT: AGENT 。 |
|
Interfaces |
object | 生成交互式代理时, InteractiveAgent 将 设置为 。 |
是 | |
SuggestedPrompts |
object | Prompt:如果初学者提示) 或用作生成建议提示的模板, (向用户显示的实际提示。 Title:提示的标题。 Personas:提示符所指向的角色类型。 IsStarterAgent:对于初学者提示,设置为 true。 建议:将 Starter 和建议提示设置为最多两个句子。 |
是的;仅适用于交互式代理。
Title 和 Personas 仅) 初学者提示所需的 (。 |
设置 (SkillGroups 字段)
支持的“格式”字段 Settings 的对象结构如下所示。 有关技能 (工具) 示例,请参阅 工具示例。
API
| 设置名称 | 类型 | 说明 | 约束 | 必需 |
|---|---|---|---|---|
OpenApiSpecUrl |
string | 公共 OpenAPI 规范的 URL。 | 是 | |
EndpointUrl |
string | 公共终结点的 URL。 | 不;仅当不想使用 OpenAPI 规范中列出的 API 服务器时指定。 | |
EndpointUrlSettingName |
string | 用于在插件设置期间请求公共终结点 URL 的可自定义设置。 | 不;仅当希望 API 终结点可配置时指定。 | |
EnableSkillContextApi |
布尔值 | 仅当 API 工具需要访问 SkillContext API 时,才设置此值。 | 否 |
GPT
| 设置名称 | 类型 | 说明 | 约束 | 必需 |
|---|---|---|---|---|
ModelName |
string | 选择要使用的 GPT 模型。 | 必须是 gpt-4.1 | 是 |
Template |
string | GPT 提示模板。 | 最多支持 80,000 个字符 | 是 |
代理
| 设置名称 | 类型 | 说明 | 约束 | 必需 |
|---|---|---|---|---|
Instructions |
string | 定义代理行为和任务的指南或明确指示。 该指南用于指导代理的响应,并确保它与预期的用例保持一致。 | 通常用自然语言编写,包括 markdown 或注释等格式设置。 | 是 |
KQL
| 设置名称 | 类型 | 说明 | 约束 | 必需 |
|---|---|---|---|---|
Target |
string | 选择执行该工具的系统或平台。 请参阅 目标特定设置。 | 是 | |
Template |
string | KQL 提示模板。 | 最多支持 80,000 个字符。 | 如果未 TemplateUrl 指定 ,则为 “是”。 |
TemplateUrl |
string | 用于下载 KQL 提示模板的公共 URL (最多 80,000 个字符) 。 | 是。 指定 TemplatUrl 或 Template ,但不能同时指定两者。 |
|
PackageUrl |
string | 包含 KQL 提示模板的 zip 文件的公共 URL。 注意:在 SkillGroup 级别指定。 | 如果未 Template 指定 或 TemplateUrl ,则为 是。 |
|
TemplateFile |
string | KQL 提示模板的相对路径 (zip 文件中最多) PackageUrl 80,000 个字符。 |
如果指定 ,则 PackageUrl 为 “是”。 |
LogicApp
| 设置名称 | 类型 | 说明 | 必需 |
|---|---|---|---|
SubscriptionId |
string | Microsoft逻辑应用中Azure订阅 ID。 订阅必须与Security Copilot用户租户位于同一租户中。 | 是 |
ResourceGroup |
string | Microsoft Azure创建资源的逻辑应用中的资源组。 | 是 |
WorkflowName |
string | 逻辑应用资源的名称。 | 是 |
TriggerName |
string | 在逻辑应用中创建的触发器的名称。 | 是 |
特定于目标的设置
Microsoft Defender
无其他设置。
Microsoft Sentinel
这些设置对目标Microsoft Sentinel的 KQL 工具有效。
Settings:
Target: Sentinel
# The ID of the AAD Organization that the Sentinel workspace is in.
TenantId: '{{TenantId}}'
# The id of the Azure Subscription that the Sentinel workspace is in.
SubscriptionId: '{{SubscriptionId}}'
# The name of the Resource Group that the Sentinel workspace is in.
ResourceGroupName: '{{ResourceGroupName}}'
# The name of the Sentinel workspace.
WorkspaceName: '{{WorkspaceName}}'
Kusto
这些设置对目标为 Kusto 的 KQL 工具有效。
Settings:
# The Kusto cluster URL.
Cluster:
# The Kusto database name.
Database:
身份验证
Security Copilot支持多种用于对工具进行身份验证的方案。 请参阅 身份验证类型。 有关不同身份验证类型的示例,请参阅 API 插件。
| 方案 | 说明 | Copilot 清单支持 | OpenAI 支持 + |
|---|---|---|---|
None |
无身份验证 | 是 | 是 |
Basic |
基本身份验证 | 是 | 否 |
ApiKey |
基于 ApiKey 的身份验证。 ApiKey 在自定义标头或查询参数中传递。 | 是 | 是* |
ServiceHttp |
基于提供的令牌进行身份验证。 | 是 | 是 |
OAuthAuthorizationCodeFlow |
OAuth 2.0 授权代码流是一种更安全、更复杂的身份验证方法,用于在不共享用户凭据的情况下授予对第三方应用程序的访问权限。 | 是 | 是 |
OAuthClientCredentialsFlow |
类似于基本身份验证,但用于服务器到服务器通信,或者在访问不需要用户特定权限的公共数据时使用。 | 是 | 否 |
OAuthPasswordGrantFlow |
使用 OAuth 2.0 密码授予类型将用户凭据交换为访问令牌的旧方法。 不再建议这样做。 | 是 | 否 |
AAD |
Microsoft Entra仅限应用程序的访问权限。 | 是 | 是* |
AADDelegated |
用户 + Microsoft Entra仅限应用程序的访问权限。 | 是 | 是* |
+此字段用于指示Security Copilot中支持的两种不同类型的上传。*这些表示的身份验证方法超出了 OpenAI 最初支持的范围。
身份验证类型
下表显示了每种身份验证类型的支持设置。
| 身份验证类型 | Setting | 说明 |
|---|---|---|
AAD 或 AADDelegated |
EntraScopes |
要请求的Microsoft Entra范围的逗号分隔列表。 |
Basic 或 OAuthPasswordGrantFlow |
Username |
用于基本身份验证的用户名。 |
Password |
用于基本身份验证的密码。 | |
ApiKey |
Key |
标头/查询参数的名称。 默认值为 Authorization,但可以是自定义值。 例如,X-ApiKey。 |
AuthScheme |
在标头中使用时,在 Value 前面附加的身份验证方案的名称。 可接受的选项是空字符串、持有者或基本。 | |
Location |
API 密钥的位置(标头或 QueryParams)。 默认值为 Header。 | |
Value |
要使用的密钥/令牌。 | |
ServiceHttp |
AccessToken |
要使用的密钥/令牌。 持有者 AuthScheme 位于授权请求标头中的令牌前面。 |
OAuthAuthorizationCodeFlow 或 OAuthClientCredentialsFlow 或 OAuthPasswordGrantFlow |
TokenEndpoint |
要从中请求令牌的终结点。 |
Scopes |
要请求的范围的可选逗号分隔列表。 | |
ClientId |
请求令牌时要使用的客户端 ID。 可选。OAuthPasswordGrantFlow |
|
ClientSecret |
请求令牌时使用的客户端密码。 可选。OAuthPasswordGrantFlow |
|
AuthorizationContentType |
发送令牌请求时使用的内容类型。 默认值为 application/x-www-form-urlencoded。 | |
OAuthAuthorizationCodeFlow |
AuthorizationEndpoint |
要从中请求授权代码的终结点。 |