Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fe0461b
Fix doc template sample
rogerbarreto Jul 31, 2025
be499e8
Merge pull request #614 from MicrosoftDocs/issues/12343-learn-doc-update
rogerbarreto Jul 31, 2025
259af9a
Initialize Docs repository: https://github.com/MicrosoftDocs/semantic…
huypub Aug 27, 2025
1c780b9
Initialize Docs repository: https://github.com/MicrosoftDocs/semantic…
huypub Aug 27, 2025
2407c37
Initialize Docs repository: https://github.com/MicrosoftDocs/semantic…
huypub Aug 27, 2025
9e3b6f2
Initialize Docs repository: https://github.com/MicrosoftDocs/semantic…
huypub Aug 27, 2025
ed00e1f
Merge pull request #618 from MicrosoftDocs/live
huypub Aug 27, 2025
89de4fc
Merge pull request #617 from MicrosoftDocs/repo_sync_working_branch
westey-m Sep 2, 2025
022a276
Merge pull request #620 from MicrosoftDocs/main
westey-m Sep 2, 2025
000fcd2
Merge pull request #626 from MicrosoftDocs/repo_sync_working_branch
westey-m Sep 11, 2025
be6ec2c
Merge pull request #627 from MicrosoftDocs/main
westey-m Sep 11, 2025
708b57e
Merge pull request #628 from MicrosoftDocs/repo_sync_working_branch
westey-m Sep 11, 2025
4a4ddc9
Merge pull request #629 from MicrosoftDocs/main
westey-m Sep 11, 2025
63305c4
Update MCP plugin support details in documentation (#630)
geabdluca Sep 11, 2025
f9eeb5f
Merge pull request #631 from MicrosoftDocs/main
moonbox3 Sep 11, 2025
8a9e3eb
Add run agent tutorial
westey-m Sep 15, 2025
dc1a428
Address PR comments.
westey-m Sep 15, 2025
85a0eeb
Merge pull request #634 from westey-m/add-run-agent-tutorial
westey-m Sep 15, 2025
3dc4079
Merge pull request #644 from MicrosoftDocs/repo_sync_working_branch
westey-m Sep 19, 2025
9a47c30
Merge pull request #645 from MicrosoftDocs/main
westey-m Sep 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .openpublishing.publish.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"docsets_to_publish": [
{
"docset_name": "agent-framework",
"build_source_folder": "agent-framework",
"build_output_subfolder": "agent-framework",
"locale": "en-us",
"monikers": [],
"open_to_public_contributors": false,
"type_mapping": {
"Conceptual": "Content"
},
"build_entry_point": "docs"
},
{
"docset_name": "semantic-kernel",
"build_source_folder": "semantic-kernel",
Expand Down
41 changes: 41 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.8 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).

If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
4 changes: 4 additions & 0 deletions agent-framework/TOC.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Index
href: index.md
- name: Tutorials
href: tutorials/TOC.yml
3 changes: 3 additions & 0 deletions agent-framework/breadcrumb/agent-framework/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- name: '<please enter product name here>'
tocHref: /
topicHref: /
48 changes: 48 additions & 0 deletions agent-framework/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"build": {
"content": [
{
"files": [
"**/*.md",
"**/*.yml"
],
"exclude": [
"**/obj/**",
"**/includes/**",
"_themes/**",
"**/docfx.json",
"_repo.en-us/**",
"README.md",
"LICENSE",
"LICENSE-CODE",
"ThirdPartyNotices.md",
"SECURITY.md"
]
}
],
"resource": [
{
"files": [
"**/*.png",
"**/*.jpg"
],
"exclude": [
"**/obj/**",
"**/includes/**",
"_themes/**",
"**/docfx.json",
"_repo.en-us/**"
]
}
],
"overwrite": [],
"externalReference": [],
"globalMetadata": {
"breadcrumb_path": "~/breadcrumb/agent-framework/toc.yml",
"feedback_system": "Standard",
"permissioned-type": "public"
},
"fileMetadata": {},
"template": []
}
}
1 change: 1 addition & 0 deletions agent-framework/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Welcome to agent-framework!
4 changes: 4 additions & 0 deletions agent-framework/tutorials/TOC.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Index
href: index.md
- name: Create and run a simple agent
href: run-agent.md
15 changes: 15 additions & 0 deletions agent-framework/tutorials/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Agent Framework Tutorials
description: Agent Framework Tutorials
author: westey-m
ms.topic: tutorial
ms.author: westey-m
ms.date: 09/15/2025
ms.service: agent-framework
---

# Agent Framework Tutorials

## Single Agent Tutorials

- [Create and run a simple agent](./run-agent.md)
108 changes: 108 additions & 0 deletions agent-framework/tutorials/run-agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: Create and run a simple agent
description: Create and run a simple agent
zone_pivot_groups: programming-languages
author: westey-m
ms.topic: tutorial
ms.author: westey
ms.date: 09/15/2025
ms.service: agent-framework
---

# Create and run a simple agent

::: zone pivot="programming-language-csharp"

This tutorial shows you how to create and run a simple agent, based on the Azure OpenAI Chat Completion service.

> [!IMPORTANT]
> The agent framework supports many different types of agents. This tutorial uses an agent based on a Chat Completion service, but all other agent types are run in the same way. See the [Agent Framework user guide](../user-guide/index.md) for more information on other agent types and how to construct them.

## Prerequisites

Before you begin, ensure you have the following prerequisites:

- [.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
- [Azure OpenAI service endpoint and deployment configured](https://learn.microsoft.com/azure/ai-foundry/openai/how-to/create-resource)
- [Azure CLI installed](https://learn.microsoft.com/cli/azure/install-azure-cli) and [authenticated (for Azure credential authentication)](https://learn.microsoft.com/cli/azure/authenticate-azure-cli)
- [User has the `Cognitive Services OpenAI User` or `Cognitive Services OpenAI Contributor` roles, depending on need, for the Azure OpenAI resource.](https://learn.microsoft.com/azure/ai-foundry/openai/how-to/role-based-access-control)

> [!IMPORTANT]
> For this tutorial we are using Azure OpenAI for the Chat Completion service, but you can use any inference service that is compatible with [Microsoft.Extensions.AI.IChatClient](https://learn.microsoft.com/dotnet/api/microsoft.extensions.ai.ichatclient).

## Installing Nuget packages

To use the AgentFramework with Azure OpenAI, you need to install the following NuGet packages:

```powershell
dotnet add package Azure.Identity
dotnet add package Azure.AI.OpenAI
dotnet add package Microsoft.Extensions.AI.OpenAI
dotnet add package Microsoft.Agents.OpenAI
```

## Creating the agent

- First we create create a client for Azure OpenAI, by providing the Azure OpenAI endpoint and using the same login as was used when authenticating with the Azure CLI in the [Prerequisites](#prerequisites) step.
- Then we get a chat client for communicating with the chat completion service, where we also specify the specific model deployment to use. Use one of the deployments that you created in the [Prerequisites](#prerequisites) step.
- Finally we create the agent, providing instructions and a name for the agent.

```csharp
using System;
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Extensions.AI;
using OpenAI;

AIAgent agent = new AzureOpenAIClient(
new Uri("https://<myresource>.openai.azure.com"),
new AzureCliCredential())
.GetChatClient("gpt-4o-mini")
.CreateAIAgent(instructions: "You are good at telling jokes.", name: "Joker");
```

## Running the agent

To run the agent, call the `RunAsync` method on the agent instance, providing the user input.
The agent will return a response object, and calling `.ToString()` or `.Text` on this response object, provides the text result from the agent.

```csharp
Console.WriteLine(await agent.RunAsync("Tell me a joke about a pirate."));
```

## Running the agent with streaming

To run the agent with streaming, call the `RunStreamingAsync` method on the agent instance, providing the user input.
The agent will stream a list of update objects, and calling `.ToString()` or `.Text` on each update object provides the part of the text result contained in that update.

```csharp
await foreach (var update in agent.RunStreamingAsync("Tell me a joke about a pirate."))
{
Console.WriteLine(update);
}
```

## Running the agent with a ChatMessage

Instead of a simple string, you can also provide one or more `ChatMessage` objects to the `RunAsync` and `RunStreamingAsync` methods.

```csharp
ChatMessage message = new(ChatRole.User, [
new TextContent("Tell me a joke about this image?"),
new UriContent("https://samplesite.org/clown.jpg", "image/jpeg")
]);

Console.WriteLine(await agent.RunAsync(message));
```

::: zone-end
::: zone pivot="programming-language-python"

Tutorial coming soon.

::: zone-end

## Next steps

> [!div class="nextstepaction"]
> [Having a multi-turn conversation with an agent](./multi-turn-conversation.md)
10 changes: 10 additions & 0 deletions agent-framework/zone-pivot-groups.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# YamlMime:ZonePivotGroups
groups:
- id: programming-languages
title: Programming languages
prompt: Choose a programming language
pivots:
- id: programming-language-csharp
title: C#
- id: programming-language-python
title: Python
6 changes: 4 additions & 2 deletions semantic-kernel/Frameworks/agent/agent-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ Creating an agent with template parameters provides greater flexibility by allow
// Initialize a Kernel with a chat-completion service
Kernel kernel = ...;

var instructions = "Tell a story about {{$topic}} that is {{$length}} sentences long.";

ChatCompletionAgent agent =
new()
new(templateFactory: new KernelPromptTemplateFactory(),
templateConfig: new(instructions) { TemplateFormat = PromptTemplateConfig.SemanticKernelTemplateFormat })
{
Kernel = kernel,
Name = "StoryTeller",
Instructions = "Tell a story about {{$topic}} that is {{$length}} sentences long.",
Arguments = new KernelArguments()
{
{ "topic", "Dog" },
Expand Down
2 changes: 1 addition & 1 deletion semantic-kernel/concepts/plugins/adding-mcp-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ms.service: semantic-kernel
MCP is the Model Context Protocol, it is an open protocol that is designed to allow additional capabilities to be added to AI applications with ease, see [the documentation](https://modelcontextprotocol.io/introduction) for more info.
Semantic Kernel allows you to add plugins from a MCP Server to your agents. This is useful when you want to use plugins that are made available as a MCP Server.

Semantic Kernel supports both local MCP Servers, through Stdio, or servers that connect through SSE over HTTPS.
Semantic Kernel supports multiple MCP plugin types, including MCPStdioPlugin and MCPStreamableHttpPlugin. These plugins enable connections to both local MCP Servers and servers that connect through SSE over HTTPS.

## Add plugins from a local MCP Server

Expand Down