microsoft/ignite25-LAB516-safeguard-your-agents-with-ai-red-teaming-agent-in-microsoft-foundry
GitHub: microsoft/ignite25-LAB516-safeguard-your-agents-with-ai-red-teaming-agent-in-microsoft-foundry
微软 Ignite 2025 官方实验课程,教授如何使用 Microsoft Foundry 中的 AI Red Teaming Agent 对生成式 AI 系统进行自动化红队测试,在部署前发现安全风险与漏洞。
Stars: 24 | Forks: 97
# [Microsoft Ignite 2025](https://ignite.microsoft.com)
## 🔥 LAB516: 在 Microsoft Foundry 中使用 AI Red Teaming Agent 保护你的 Agent
[](https://aka.ms/MicrosoftFoundry-Ignite25)
[](https://aka.ms/MicrosoftFoundryForum-Ignite25)
### 谁应该参加此实验?
此实验非常适合:
1. 希望提升其应用安全态势的 **AI 开发者**
2. 正在评估 AI 解决方案安全工具与实践的 **云架构师**
3. 希望学习 AI Red Teaming 工具与概念的 **AI 初学者**
**前置条件**:我们假设你对 AI 应用程序开发和 AI Ops 生命周期有基本的了解。本实验使用 GitHub Codespaces、VS Code 和 Python Notebooks —— 熟悉这些工具是理想的。你**必须**拥有一个 GitHub 账户才能开始。
### 环节描述
本次实践研讨会将向参与者介绍使用 Microsoft Foundry 对生成式 AI 系统进行[自动化 AI 红队测试](https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/ai-red-teaming-agent)的基础知识,以发现安全和安保风险。参会者将学习如何应用自动化攻击技术在部署前识别多个风险维度的安全问题和漏洞。参与者将通过动手演练和引导式练习,在现实的开发场景中应用这些概念。
### 🧠 学习成果
在此环节结束时,学习者将能够:
- 描述 AI Red Teaming Agent 的功能及其对 AI 安全的重要性
- 使用多样化的攻击策略识别并测试核心风险类别
- 配置和测试不同的目标类型(回调、模型和应用程序端点)
- 在本地和云端运行 AI Red Teaming Agent 扫描(使用 Azure AI SDKs)
- 在本地和云端分析扫描结果与指标(使用 Microsoft Foundry Portal)
- 针对真实场景比较基线和高级攻击策略
### 💻 使用的技术
1. [Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/overview) - 用于配置基础 AI Agent 应用
2. [Microsoft Foundry Portal](https://learn.microsoft.com/azure/ai-foundry/what-is-azure-ai-foundry) - 用于项目管理和查看扫描结果
3. [Microsoft Foundry SDK](https://learn.microsoft.com/python/api/overview/azure/ai-projects-readme) - 用于基于云的红队测试操作
4. [Azure AI Red Teaming Agent](https://learn.microsoft.com/azure/ai-foundry/concepts/ai-red-teaming-agent) - 用于对 AI 应用进行对抗性测试
5. [Azure AI Evaluation SDK](https://learn.microsoft.com/azure/ai-foundry/how-to/develop/evaluate-sdk) - 用于本地设置和执行扫描
6. [Azure AI Agents](https://learn.microsoft.com/azure/ai-foundry/agents/overview) - 用于创建具有工具和自定义函数的智能 Agent
7. [Azure OpenAI Service](https://learn.microsoft.com/azure/ai-foundry/openai/overview) - 用于访问 GPT-4 和其他语言模型
8. [PyRIT](https://github.com/Azure/PyRIT) - 作为红队测试 Agent 基础的 Python Risk Identification Tool 框架
### 🚀 入门指南
本实验专为讲师引导环节(预先配置的 Skillable 订阅)和自主学习(使用你自己的 Azure 订阅手动配置)设计。在这两种情况下,我们_建议_使用以下方法以便快速开始。
1. **创建仓库的个人副本** 以进行更改。
- 使用你的个人账户登录 GitHub
- [复刻此仓库](https://github.com/microsoft/ignite25-LAB516-safeguard-your-agents-with-ai-red-teaming-agent-in-azure-ai-foundry/fork) 以获取你的个人副本。
- 在新的浏览器标签页中打开该复刻。
2. **启动 GitHub Codespaces** 以获取你的开发环境
- 点击你复刻仓库中的蓝色 "Code" 按钮 —— 选择 "Codespaces" 标签
- 点击 "+" 按钮创建一个新的 codespace —— 它会打开一个新标签页
- 你将在浏览器中看到一个 VS Code 编辑器 —— 等待其加载完成
3. **启动研讨会指南** 以获取基于 Web 的指导指南
- 在上述 IDE 中打开 VS Code 终端 —— 等待提示符处于活动状态
- 输入 `mkdocs serve > /dev/null 2>&1 &` —— 几秒钟后会弹出一个对话框
- 选择 "Open in browser" 选项 —— 基于 Web 的指南将在新标签页中打开
- 点击导航栏中的 **Begin Here** 标签 —— 按照那里的说明操作!
使用基于 Web 的指导指南有三个好处:
1. **高效搜索** —— 快速按需查找命令或章节
2. **快速复制/粘贴** —— 将鼠标悬停在代码区域可看到_复制到剪贴板_选项
3. **切换主题** —— 设置了浅色和深色主题模式以适应你的偏好
_你现在应该有一个打开了三个标签页的浏览器:_
- [X] GitHub Repository 标签页 —— 你从中启动 codespaces 的地方
- [X] GitHub Codespaces 标签页 —— 这是你的开发环境
- [X] 研讨会指南标签页 —— 将提供分步演练
准备好开始工作了吗?让我们出发吧!🚀
### 🔗 环节资源
| 资源 | 链接 | 描述 |
|:-------------------|:----------------------------------|:-------------------|
| 浏览文档| [Microsoft Foundry - AI Red Teaming Agent](https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/develop/run-ai-red-teaming-cloud?view=foundry&tabs=python) | AI Red Teaming 概述及本地和云端扫描入门 |
| PyRIT 文档 | [Python Risk Identification Tool (PyRIT)](https://azure.github.io/PyRIT/?ocid=AITour26_resourcecenter_cnl) | 微软用于 AI 红队测试的开源框架 |
| 红队测试技术博客 | [Assess Agentic Risks with AI Red Teaming Agent](https://devblogs.microsoft.com/foundry/assess-agentic-risks-with-the-ai-red-teaming-agent-in-microsoft-foundry/) | Microsoft Ignite (2025年11月) 的最新功能和特性 |
| 预录制会议视频 | [Model Mondays Replay (Dec 2025)](https://www.youtube.com/watch?v=70OCsYjOsbs) | Minsoo Thigpen (Core AI PM) 的幻灯片和演示演练 |
| Microsoft AI Tour 2026 | [Safeguard Your Agents Theater Session](https://github.com/microsoft/aitour26-LTG156-safeguard-agentic-ai-solutions-with-ai-red-teaming-agent/tree/main) | 带有演示的 15 分钟概述 |
| | |
### 🌟 Microsoft Learn MCP 服务器
[](https://vscode.dev/redirect/mcp/install?name=microsoft.docs.mcp&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flearn.microsoft.com%2Fapi%2Fmcp%22%7D)
Microsoft Learn MCP Server 是一个远程 MCP Server,它使 GitHub Copilot 等 客户端和其他 AI Agent 能够直接从微软官方文档中获取可信且最新的信息。点击上方的一键按钮在 VSCode 中开始使用,或访问本仓库中包含的 [mcp.json](.vscode/mcp.json) 文件。
欲了解更多信息、其他开发客户端的设置说明,以及发表评论和提问,请访问我们的 Learn MCP Server GitHub 仓库:[https://github.com/MicrosoftDocs/MCP](https://github.com/MicrosoftDocs/MCP)。在 [https://mcp.azure.com](https://mcp.azure.com) 寻找其他 MCP Servers 以连接你的 Agent。
*注意:使用 Learn MCP Server 即表示你同意 [Microsoft Learn](https://learn.microsoft.com/en-us/legal/termsofuse) 和 [Microsoft API 使用条款](https://learn.microsoft.com/en-us/legal/microsoft-apis/terms-of-use)。*
### 📚 资源和后续步骤
| 资源 | 链接 | 描述 |
|:-------------------|:----------------------------------|:-------------------|
| Ignite 2025 后续步骤 | [https://aka.ms/Ignite25-Next-Steps](https://aka.ms/Ignite25-Next-Steps?ocid=ignite25_nextsteps_cnl) | Microsoft Ignite 所有会议仓库的链接|
| Microsoft Foundry 社区 Discord | [](https://aka.ms/MicrosoftFoundry-Ignite25)| 与 Microsoft Foundry 社区联系! |
| 在 Ignite 学习 | [https://aka.ms/LearnAtIgnite](https://aka.ms/LearnAtIgnite?ocid=ignite25_nextsteps_github_cnl) | 在 Microsoft Learn 上继续学习 |
## 内容所有者