Agents SDK 智能体生产就绪加固
agents-sdk-to-prod
评估、创建、加固、部署或审查 C#/.NET Microsoft 365 Agents SDK 智能体及其直接相关的托管/运维文件的生产就绪性。仅用于 Agents SDK 场景,不适用于无关的应用加固。
- License 许可
- MIT
- 所属仓库
- microsoft/Agents
- 最近更新
- 2026-11-14
- Stars
- ★ 1.1k
- Forks
- 346
01 前言 Front Matter
- name
- agents-sdk-to-prod
- description
- Assess, create, harden, deploy, or review production readiness of C#/.NET Microsoft 365 Agents SDK agents and their direct hosting/operations files. Use only for Agents SDK scenarios, not unrelated application hardening.
02 资源文件 92
- 参考文档copilot-studio/agent.sync.yaml174 B
- 参考文档copilot-studio/behaviors/aibast_constraining-station-identification.mcs.yml2.7 KB
- 参考文档copilot-studio/behaviors/aibast_day-swing-night-production-plan.mcs.yml2.9 KB
- 参考文档copilot-studio/behaviors/aibast_improvement-option-comparison.mcs.yml3.7 KB
- 参考文档copilot-studio/behaviors/aibast_plant-wide-operating-health-review.mcs.yml3.3 KB
- 参考文档copilot-studio/capabilities/knowledge/files/aibast_production-line-synthetic-records.md11.3 KB
- 参考文档copilot-studio/capabilities/knowledge/files/aibast_production-line-synthetic-records.md.mcs.yml190 B
- 参考文档copilot-studio/capabilities/knowledge/files/aibast_production-optimization-rules.md7.4 KB
- 参考文档copilot-studio/capabilities/knowledge/files/aibast_production-optimization-rules.md.mcs.yml182 B
- 参考文档copilot-studio/settings.mcs.yml6.9 KB
- 参考文档deployment.json3.0 KB
- 参考文档EASY-MODE-COPILOT-CHAT.md241 B
- 参考文档EASY-MODE-PERSONLESS.md241 B
- 参考文档EASY-MODE.md2.7 KB
- 参考文档evals/copilot-studio-preview-evidence.json1.5 KB
- 参考文档evals/dataverse-draft-evidence.json1.7 KB
- 参考文档evals/manual-build-evidence.json2.9 KB
- 参考文档evals/onepager-map.json2.7 KB
- 参考文档evals/README.md618 B
- 参考文档evals/transcripts.json15.0 KB
- 参考文档evals/visual-checkpoints.json21.7 KB
- 参考文档evidence-report.html28.3 KB
- 参考文档export-manifest.json45.9 KB
- 资产文件exports/product-line-optimization-copilot-studio-solution.zip23.0 KB
- 参考文档exports/product-line-optimization-deployment-settings.json212 B
- 参考文档exports/product-line-optimization-solution-export.json1.1 KB
- 参考文档exports/README.md1.6 KB
- 参考文档field-guide.html37.9 KB
- 参考文档FIELD-GUIDE.md13.8 KB
- 参考文档FLOW.md1.0 KB
- 参考文档manual-tutorial.html81.4 KB
- 参考文档manual/GLOBAL-INSTRUCTIONS.md5.2 KB
- 参考文档quest.html130.6 KB
- 参考文档README.md4.5 KB
- 参考文档references/readiness-matrix.md7.2 KB
- 资产文件screenshots/assisted/01-review-build.jpg107.1 KB
- 资产文件screenshots/assisted/02-plo-01.jpg141.0 KB
- 资产文件screenshots/assisted/03-plo-02.jpg241.3 KB
- 资产文件screenshots/assisted/04-plo-03.jpg231.4 KB
- 资产文件screenshots/assisted/05-plo-04.jpg171.6 KB
- 资产文件screenshots/assisted/06-confirm-draft.jpg28.8 KB
- 资产文件screenshots/assisted/annotated/01-review-build.png114.3 KB
- 资产文件screenshots/assisted/annotated/02-plo-01.png142.4 KB
- 资产文件screenshots/assisted/annotated/03-plo-02.png225.4 KB
- 资产文件screenshots/assisted/annotated/04-plo-03.png222.5 KB
- 资产文件screenshots/assisted/annotated/05-plo-04.png158.2 KB
- 资产文件screenshots/assisted/annotated/06-confirm-draft.png29.0 KB
- 参考文档screenshots/assisted/browserfilm.json1.3 KB
- 资产文件screenshots/assisted/copilot-assisted-contact-sheet.jpg159.3 KB
- 资产文件screenshots/assisted/copilot-assisted-walkthrough.gif923.2 KB
- 参考文档screenshots/assisted/README.md467 B
- 资产文件screenshots/manual/01-create-blank-agent.jpg57.7 KB
- 资产文件screenshots/manual/02-name-agent.jpg56.1 KB
- 资产文件screenshots/manual/03-enter-instructions.jpg146.3 KB
- 资产文件screenshots/manual/04-save-instructions.jpg138.4 KB
- 资产文件screenshots/manual/05-remove-web-search.jpg145.8 KB
- 资产文件screenshots/manual/06-add-aibast-production-optimization-rules.jpg147.7 KB
- 资产文件screenshots/manual/07-add-aibast-production-line-synthetic-records.jpg150.4 KB
- 资产文件screenshots/manual/08-add-aibast-bottleneck-plo02.jpg154.1 KB
- 资产文件screenshots/manual/09-add-aibast-line-health-plo01.jpg156.7 KB
- 资产文件screenshots/manual/10-add-aibast-shift-plan-plo04.jpg159.0 KB
- 资产文件screenshots/manual/11-add-aibast-throughput-options-plo03.jpg161.5 KB
- 资产文件screenshots/manual/12-review-inventory.jpg161.5 KB
- 资产文件screenshots/manual/13-open-preview.jpg30.8 KB
- 资产文件screenshots/manual/14-plo-01.jpg112.3 KB
- 资产文件screenshots/manual/15-plo-02.jpg267.4 KB
- 资产文件screenshots/manual/16-plo-03.jpg166.7 KB
- 资产文件screenshots/manual/17-plo-04.jpg205.7 KB
- 资产文件screenshots/manual/18-confirm-draft.jpg34.3 KB
- 资产文件screenshots/manual/annotated/01-create-blank-agent.png62.7 KB
- 资产文件screenshots/manual/annotated/02-name-agent.png61.4 KB
- 资产文件screenshots/manual/annotated/03-enter-instructions.png138.3 KB
- 资产文件screenshots/manual/annotated/04-save-instructions.png133.3 KB
- 资产文件screenshots/manual/annotated/05-remove-web-search.png138.7 KB
- 资产文件screenshots/manual/annotated/06-add-aibast-production-optimization-rules.png141.4 KB
- 资产文件screenshots/manual/annotated/07-add-aibast-production-line-synthetic-records.png143.5 KB
- 资产文件screenshots/manual/annotated/08-add-aibast-bottleneck-plo02.png145.2 KB
- 资产文件screenshots/manual/annotated/09-add-aibast-line-health-plo01.png147.3 KB
- 资产文件screenshots/manual/annotated/10-add-aibast-shift-plan-plo04.png149.3 KB
- 资产文件screenshots/manual/annotated/11-add-aibast-throughput-options-plo03.png151.2 KB
- 资产文件screenshots/manual/annotated/12-review-inventory.png154.8 KB
- 资产文件screenshots/manual/annotated/13-open-preview.png29.9 KB
- 资产文件screenshots/manual/annotated/14-plo-01.png113.6 KB
- 资产文件screenshots/manual/annotated/15-plo-02.png252.1 KB
- 资产文件screenshots/manual/annotated/16-plo-03.png163.2 KB
- 资产文件screenshots/manual/annotated/17-plo-04.png196.4 KB
- 资产文件screenshots/manual/annotated/18-confirm-draft.png34.7 KB
- 参考文档screenshots/manual/browserfilm.json3.3 KB
- 资产文件screenshots/manual/manual-build-contact-sheet.jpg651.6 KB
- 资产文件screenshots/manual/manual-build-walkthrough.gif4.2 MB
- 参考文档screenshots/manual/README.md461 B
- 参考文档screenshots/README.md521 B
03 SKILL.md 正文
Move a C#/.NET Agents SDK agent toward production
Use this skill for Microsoft.Agents.Hosting.AspNetCore, Microsoft.Agents.Builder, and related SDK packages. Preserve the selected scenario and change only
files that directly run, host, secure, observe, test, deploy or operate the agent.
An external dependency requiring changes outside that scope needs an explicit
scope decision. A question or review request is read-only.
Sources
- Read Prepare an agent for production on Microsoft Learn first, using the .NET language selection. Treat the article and its linked shared production controls as normative.
- Read the packaged readiness matrix for control IDs, statuses, applicability, dependencies and evidence rules.
- Inspect
samples/dotnet/production-reference/, or the reference. It demonstrates one bounded Web Chat/App Service/Blob profile. - Inspect the target's actual SDK APIs and dependency baseline. The reference uses stable released packages; verify the installed APIs before changing the user's dependency version or selecting production controls.
Workflow
1. Discover
- Determine whether the user wants a new sample, an assessment, or changes to an existing sample. Do not ask when the request or repository already shows the answer.
- Inspect the candidate Agents SDK sample before asking questions. If multiple samples exist, identify the requested sample or ask which one is in scope.
- Identify channel, cloud, host, inbound audiences and issuers, trusted calling applications, downstream identities, outbound hosts, state, external dependencies, data classes, retention, scale, side effects, long-running work, model calls, retrieval, tools, token-bearing downloaders, attachments, transcripts, and proactive messaging.
- State the deployment boundary. Do not broaden channel, host, identity, data, or application scope without user approval.
2. Assess
- Classify every applicable readiness control as
verified,implemented,missing,not applicable, orblockedusing the readiness matrix. - Cite repository evidence for each
verifiedorimplementedresult. Do not infer production evidence from the presence of source code. - For review or question-only requests, stop at guidance and assessment. Do not modify files.
3. Agree
- Recommend the smallest suitable production profile and defaults.
- Ask only for unresolved decisions that materially affect architecture, cost, identity, channel, data handling, or side effects.
- Present the implementation sequence and identify changes that would extend beyond Agents SDK-related code. Obtain approval for that expansion.
4. Implement
- Add required controls first. Add conditional controls only for capabilities present in the selected scenario.
- Preserve the agent's intended behavior. Do not refactor unrelated code as part of production hardening.
- Add or update tests and operations documentation with each control. Keep secrets and sensitive user content out of source, generated files, logs, errors, prompts, and telemetry.
5. Verify
- Run the repository-supported build, lint, unit, and integration checks that apply to the changed Agents SDK code.
- Exercise failed production configuration, authentication rejection, issuer and audience/lifetime rejection, applicable caller authorization, service URL claim and outbound-host validation, payload rejection, safe errors, probes, graceful shutdown, and telemetry shutdown/redaction.
- Validate state recovery and conflict handling only when state exists. Validate conditional controls only for capabilities in scope.
- Separate local verification from deployed evidence. Do not claim that a control is verified when its required environment was not exercised.
6. Handoff
Report:
- The selected deployment boundary and current maturity state.
- Controls verified with file, test, deployment, or operator evidence.
- Controls implemented but not verified in the required environment.
- Missing or blocked controls and their production impact.
- Controls marked not applicable and why.
- The next deployment, smoke-test, rollback, and operations actions.
Keep this assessment current through follow-up discussion. Answer questions without losing the selected boundary, decisions, statuses, or next phase.
Maturity states
- Code-hardened: applicable source controls exist and local checks pass.
- Deployment-ready: infrastructure, production configuration, smoke tests, rollback, and operator documentation exist.
- Production-verified: the deployed environment has passed authentication, state recovery where applicable, telemetry, alert, traffic-protection, smoke, and rollback checks.
Language invariants
- SDK service registration does not authenticate routes. Configure ASP.NET JWT validation and require authorization explicitly on message/protected endpoints. Helpers can vary by installed SDK version; do not layer duplicate pipelines.
- Require signed, unexpired tokens with exact audience and configured issuer,
tenant/cloud policy. Preserve original claim names when authorizing verified
azp/appidfor trusted-app endpoints. Distinguish Bot Service token handling. - Configure outbound authentication scopes for the selected channel. The public
Bot Framework profile uses
https://api.botframework.com/.defaultinConnections:ServiceConnection:Settings:Scopes; inbound token validation does not configure outbound scopes. Verify the installed authentication provider's requirements and use the appropriate scopes for other clouds or downstream APIs. - Inspect the adapter's error path as well as application error handlers. Install
a safe
CloudAdapter.OnTurnErrorhandler when the default can expose exception details. Return a generic message and record only redacted telemetry; verify an actual failing turn through the adapter, not only a direct handler call. - Enable and register
IOutboundHostValidatorexplicitly. Validate exact channel hosts when narrower than suffix rules. Inspect async address-check coverage and apply separate destination/egress controls to arbitrary HttpClient calls. - Register durable
IStorage; preserve Blob ETags and handle conflicts without replaying complete turns or duplicating side effects. The released AgentState writes plain dictionaries; use the reference's conditional Blob provider or an equivalent provider that carries versions per turn. Use explicit managed identity and no production memory fallback. - Let ASP.NET hosting drain requests before telemetry flush/provider disposal. Verify released SDK package versions and resolved build dependencies.
Shared invariants
- Production state that must survive turns/restarts/replicas requires a durable store. Stateless agents do not need a state provider.
- Wildcard connection selection is not authorization. Keep exact audience, verified issuer/caller checks, and outbound policy.
- Validator host entries can allow subdomains. Exact channel middleware and arbitrary-client/network controls remain separate decisions.
- Health endpoints may be anonymous; routes with mutations/downstream access require authentication and applicable authorization.
- Caller-aware edge protection, deployed alerts, recovery and rollback require environment evidence. Do not certify a deployment from sample code.
- Keep secrets, tokens, prompts/messages and unnecessary identity attributes out of errors, logs, generated artifacts and telemetry.
04 同仓库更多 Skills
sync-teams-samples-to-agents-sdk
CI instructions for a bounded Teams SDK to Agents SDK sample synchronization using the selected language profile.
teams-sdk-to-agents-sdk-typescript-migration
Migrate a JavaScript or TypeScript application using the Microsoft Teams SDK App runtime to Microsoft 365 Agents SDK while preserving its Teams behaviors. Use for Teams SDK migrations, including automated sample synchronization; use the separate Bot Framework migration skill for botbuilder applications.
Teams 应用清单创建与审核
teams-app-manifest
为现有的 Microsoft 365 Agents SDK 应用程序创建或审核 Microsoft Teams 应用清单,方法是将声明的意图和源代码证据映射到已发布清单所支持的能力。适用于 manifest.json 缺失、不完整,或需要对照已实现的 Teams 功能进行核查的情况。除非另行要求,否则不配置 Microsoft Entra、Azure Bot、开发者门户(Developer Portal)或部署。
Agents SDK Azure 资源预配
agents-sdk-provision
在为 Microsoft Agents SDK 应用预配 Azure 资源时使用——包括创建 Azure Bot Service 资源、设置 Entra 应用注册、配置身份凭据(UserManagedIdentity、FederatedCredentials 或 ClientSecret)、添加 Teams 频道、运行 Bicep 部署以实现 SSO,或通过 az CLI 设置 OAuth 用户登录连接。即使用户没有说“预配”也应触发——在诸如“在 Azure 上搭建我的机器人”“部署我的机器人”“为我的机器人配置 Azure”“让 Teams SSO 跑起来”等请求时使用。适用于所有语言(dotnet、Node.js、Python)。
Agents SDK 智能体生产加固
agents-sdk-to-prod
评估、创建、加固、部署或审查 Python Microsoft 365 Agents SDK 智能体的生产就绪度,以及其直接的托管/运维文件。仅用于 Agents SDK 场景,不用于无关的应用加固。
Agents SDK Python 可观测性配置
agents-sdk-python-otel
用于为 Python 版 Microsoft 365 Agents SDK 应用添加、配置、验证或排查 OpenTelemetry 可观测性。当用户提及 OpenTelemetry、OTel、遥测、traces、metrics、logs、OTLP、Aspire Dashboard、Application Insights、Azure Monitor、分布式追踪、自定义 tracer 或 meter、span 采样,或观测 microsoft_agents SDK 信号时触发。