默认订阅可能在未得到明确范围选择时被扫描并将拓扑保存到项目中
原文依据:4 处当 insights 文件不存在时,流程要求选择扫描范围;若用户不回复,会默认使用当前订阅,并通过 insights_get 子代理处理环境摘要。结果随后保存为项目内的 JSON。
Azure 资源、关系、配置及资源 ID 可能被 MCP 工具和子代理处理,并长期留在工作区;能够读取项目的人或流程可据此了解云环境拓扑。
流程会先询问范围,但若用户不回复便默认使用当前订阅;随后由子代理调用环境洞察工具,并把返回的 JSON 保存进项目。若其中包含资源清单或拓扑,项目文件及接触该项目的人可能获得这些信息。用户可要求作者取消静默默认、明确列出采集字段,并在调用前取得范围确认;也可限制 Azure 读取权限及 `.azure/insights.json` 的共享。
1. Check whether insights already exist at `<project-root>/.azure/insights.json`. If they do, reuse the existing entries and skip the scan in steps 2–6. In referenced mode, still execute step 7 before completing the gate; in greenfield mode, proceed to the gate.2. If no insights file exists, check whether the `insights_get` tool is available. If it is not, initialize the file with `[]`, then continue to step 7 in referenced mode or proceed to the gate in greenfield mode.3. Ask the user which scope to use for generating insights. Present these three options: a. "Subscription-scoped (default subscription)" — use this as the default if the user does not respond. b. "Subscription-scoped (choose a subscription)" — if selected, ask the user to provide a subscription name or ID. c. "Tenant-scoped (slower)"4. Ask the user whether there are specific areas they want the insights to focus on. Present these options:查看另外 3 个位置
f. "Other" — this should be a custom input field.5. Run the `insights_get` tool using a general-purpose subagent. Pass a one-line summary via the `--query` option that describes the user's infrastructure and the types of insights to prioritise. Do not pass the `--nocache` flag unless the user has explicitly asked for it. Begin Phase 2 while this tool runs.6. Once the tool finishes, save the resulting JSON to `<project-root>/.azure/insights.json`. Do not include tool call metadata. If the tool errors or returns no insights, write an empty array `[]` to the file instead.7. In referenced mode, merge one insight entry for every existing resource into the current insights array. Set `existingResource.id`, `type`, `name`, `role`, `must_not_recreate: true`, and `integrationPoints` using the normalized inventory. Preserve full ARM IDs for actual-state resources and do not duplicate an entry already identified by the same resource ID. Do this even when the resource produces no broader insight.In referenced mode:- Include exactly one entry for every inventoried existing resource, uniquely identified by `existingResource.id`.- Preserve the full ARM ID in `existingResource.id` for actual-state resources.- Use an empty `integrationPoints` array when the resource has no integration points.- A resource-only entry may omit `pattern` and `implication`; when recording a broader insight, include both.2. If no insights file exists, check whether the `insights_get` tool is available. If it is not, initialize the file with `[]`, then continue to step 7 in referenced mode or proceed to the gate in greenfield mode.3. Ask the user which scope to use for generating insights. Present these three options: a. "Subscription-scoped (default subscription)" — use this as the default if the user does not respond. b. "Subscription-scoped (choose a subscription)" — if selected, ask the user to provide a subscription name or ID. c. "Tenant-scoped (slower)"4. Ask the user whether there are specific areas they want the insights to focus on. Present these options: