Official agent skill

M365 Agents Py

by microsoft in microsoft/skills

Microsoft 365 Agents SDK for Python. An agent skill from microsoft/skills.

OfficialMITAuto-check: notesDocuments & Office

Install M365 Agents Py

skills CLI
$ npx skills add microsoft/skills --skill m365-agents-py -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/skills m365-agents-py --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/plugins/azure-sdk-python/skills/m365-agents-py .claude/skills/m365-agents-py && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
m365-agents-py
GitHub stars
3.1k
Used in
6 other repos
Token cost
~3.5k tokens
SKILL.md length
332 words
Files
2 (incl. references)
Skills in repo
150
Repo updated
First seen
Licence
MIT

At a glance

Microsoft 365 Agents SDK for Python. An agent skill from microsoft/skills.

  • Works in 10 steps: This SDK is async-first — use async def… → Always use context managers for clients… → Use microsoft_agents import prefix… → …
  • Tasks that involve Cloud office suites
  • SKILL.md covers Before implementation, Important Notice - Import…, Installation and Environment Variables (.env), plus 9 more sections
  • Calls pip; reaches cognitiveservices.azure.com and schema.org; needs AZURE_OPENAI_API_KEY

What it does

M365 Agents Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Microsoft 365 Agents SDK for Python. Build multichannel agents for Teams/M365/Copilot Studio with aiohttp hosting, AgentApplication routing, streaming responses, and MSAL-based auth. Triggers: "Microsoft 365 Agents SDK", "microsoftagents", "AgentApplication", "startagentprocess", "TurnContext", "Copilot Studio client", "CloudAdapter".

Its SKILL.md is about 3.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/capabilities.md`).

It sits in Documents & Office, covering Cloud office suites and LLM API integration. It works with Microsoft 365, Microsoft Copilot Studio and Python. The repository describes itself as: Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents. The licence is MIT.

When your agent uses it

  • Tasks that involve Cloud office suites
  • Tasks that involve LLM API integration

Example prompts

  • “Microsoft 365 Agents SDK”
  • “microsoftagents”
  • “AgentApplication”
  • “/m365-agents-py”

Requirements

  • Python 3
  • A credential in AZURE_OPENAI_API_KEY

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. This SDK is async-first — use async def handlers and async with throughout.
  2. Always use context managers for clients and async credentials. Wrap every client in with Client(...) as client: (sync) or async with…
  3. Use microsoft_agents import prefix (underscores, not dots).
  4. Use MemoryStorage only for development; use BlobStorage or CosmosDB in production.
  5. Always use load_configuration_from_env(environ) to load SDK configuration.
  6. Include jwt_authorization_middleware in aiohttp Application middlewares.
  7. Use MsalConnectionManager for MSAL-based authentication.
  8. Call end_stream() in finally blocks when using streaming responses.
  9. Use auth_handlers parameter on message decorators for OAuth-protected routes.
  10. Keep secrets in environment variables, not in source code.

What it can do on your machine

Read from SKILL.md and the folder at commit 354361d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • cognitiveservices.azure.com
    • schema.org
    • graph.microsoft.com
    • login.microsoftonline.com
    • api.powerplatform.com

    Also links to:

    • learn.microsoft.com
    • github.com
    • pypi.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • AZURE_OPENAI_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

M365 Agents Py loads about 3.5k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 89 tokens; SKILL.md has 332 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~3.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:36
    ## Environment Variables (.env)

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/skills at commit 354361d, republished under its MIT licence (© microsoft). 332 words, ~3,461 tokens.

Download SKILL.mdSave it as .claude/skills/m365-agents-py/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
m365-agents-py
description
Microsoft 365 Agents SDK for Python. Build multichannel agents for Teams/M365/Copilot Studio with aiohttp hosting, AgentApplication routing, streaming responses, and MSAL-based auth. Triggers: "Microsoft 365 Agents SDK", "microsoft_agents", "AgentApplication", "start_agent_process", "TurnContext", "Copilot Studio client", "CloudAdapter".
license
MIT
metadata.author
Microsoft
metadata.version
1.0.0
metadata.package
microsoft-agents-hosting-core, microsoft-agents-hosting-aiohttp, microsoft-agents-activity, microsoft-agents-authentication-msal…

Microsoft 365 Agents SDK (Python)

Build enterprise agents for Microsoft 365, Teams, and Copilot Studio using the Microsoft Agents SDK with aiohttp hosting, AgentApplication routing, streaming responses, and MSAL-based authentication.

Before implementation

  • Use the microsoft-docs MCP to verify the latest API signatures for AgentApplication, start_agent_process, and authentication options.
  • Confirm package versions on PyPI for the microsoft-agents-* packages you plan to use.

Important Notice - Import Changes

⚠️ Breaking Change: Recent updates have changed the Python import structure from microsoft.agents to microsoft_agents (using underscores instead of dots).

Installation

bash
pip install microsoft-agents-hosting-core
pip install microsoft-agents-hosting-aiohttp
pip install microsoft-agents-activity
pip install microsoft-agents-authentication-msal
pip install microsoft-agents-copilotstudio-client
pip install python-dotenv aiohttp

Environment Variables (.env)

bash
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID=<client-id>
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET=<client-secret>
CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID=<tenant-id>

# Optional: OAuth handlers for auto sign-in
AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__GRAPH__SETTINGS__AZUREBOTOAUTHCONNECTIONNAME=<connection-name>

# Optional: Azure OpenAI for streaming (AAD auth via DefaultAzureCredential)
AZURE_OPENAI_ENDPOINT=<endpoint>
AZURE_OPENAI_API_VERSION=<version>

# Optional: Copilot Studio client
COPILOTSTUDIOAGENT__ENVIRONMENTID=<environment-id>
COPILOTSTUDIOAGENT__SCHEMANAME=<schema-name>
COPILOTSTUDIOAGENT__TENANTID=<tenant-id>
COPILOTSTUDIOAGENT__AGENTAPPID=<app-id>

Authentication & Lifecycle

🔑 Two rules apply to every code sample below:

  1. This SDK is async-first — use async def handlers and async with throughout.
  2. Use explicit auth managers and context-managed network resources. Use MsalConnectionManager for agent auth, and wrap per-request HTTP resources in async with (for example, aiohttp.ClientSession).

Snippets may abbreviate this setup, but production code should always follow both rules.

Core Workflow: aiohttp-hosted AgentApplication

python
import logging
from os import environ

from dotenv import load_dotenv
from aiohttp.web import Request, Response, Application, run_app

from microsoft_agents.activity import load_configuration_from_env
from microsoft_agents.hosting.core import (
    Authorization,
    AgentApplication,
    TurnState,
    TurnContext,
    MemoryStorage,
)
from microsoft_agents.hosting.aiohttp import (
    CloudAdapter,
    start_agent_process,
    jwt_authorization_middleware,
)
from microsoft_agents.authentication.msal import MsalConnectionManager

# Enable logging
ms_agents_logger = logging.getLogger("microsoft_agents")
ms_agents_logger.addHandler(logging.StreamHandler())
ms_agents_logger.setLevel(logging.INFO)

# Load configuration
load_dotenv()
agents_sdk_config = load_configuration_from_env(environ)

# Create storage and connection manager
STORAGE = MemoryStorage()
CONNECTION_MANAGER = MsalConnectionManager(**agents_sdk_config)
ADAPTER = CloudAdapter(connection_manager=CONNECTION_MANAGER)
AUTHORIZATION = Authorization(STORAGE, CONNECTION_MANAGER, **agents_sdk_config)

# Create AgentApplication
AGENT_APP = AgentApplication[TurnState](
    storage=STORAGE, adapter=ADAPTER, authorization=AUTHORIZATION, **agents_sdk_config
)


@AGENT_APP.conversation_update("membersAdded")
async def on_members_added(context: TurnContext, _state: TurnState):
    await context.send_activity("Welcome to the agent!")


@AGENT_APP.activity("message")
async def on_message(context: TurnContext, _state: TurnState):
    await context.send_activity(f"You said: {context.activity.text}")


@AGENT_APP.error
async def on_error(context: TurnContext, error: Exception):
    await context.send_activity("The agent encountered an error.")


# Server setup
async def entry_point(req: Request) -> Response:
    agent: AgentApplication = req.app["agent_app"]
    adapter: CloudAdapter = req.app["adapter"]
    return await start_agent_process(req, agent, adapter)


APP = Application(middlewares=[jwt_authorization_middleware])
APP.router.add_post("/api/messages", entry_point)
APP["agent_configuration"] = CONNECTION_MANAGER.get_default_connection_configuration()
APP["agent_app"] = AGENT_APP
APP["adapter"] = AGENT_APP.adapter

if __name__ == "__main__":
    run_app(APP, host="localhost", port=environ.get("PORT", 3978))

AgentApplication Routing

python
import re
from microsoft_agents.hosting.core import (
    AgentApplication, TurnState, TurnContext, MessageFactory
)
from microsoft_agents.activity import ActivityTypes

AGENT_APP = AgentApplication[TurnState](
    storage=STORAGE, adapter=ADAPTER, authorization=AUTHORIZATION, **agents_sdk_config
)

# Welcome handler
@AGENT_APP.conversation_update("membersAdded")
async def on_members_added(context: TurnContext, _state: TurnState):
    await context.send_activity("Welcome!")

# Regex-based message handler
@AGENT_APP.message(re.compile(r"^hello$", re.IGNORECASE))
async def on_hello(context: TurnContext, _state: TurnState):
    await context.send_activity("Hello!")

# Simple string message handler
@AGENT_APP.message("/status")
async def on_status(context: TurnContext, _state: TurnState):
    await context.send_activity("Status: OK")

# Auth-protected message handler
@AGENT_APP.message("/me", auth_handlers=["GRAPH"])
async def on_profile(context: TurnContext, state: TurnState):
    token_response = await AGENT_APP.auth.get_token(context, "GRAPH")
    if token_response and token_response.token:
        # Use token to call Graph API
        await context.send_activity("Profile retrieved")

# Invoke activity handler
@AGENT_APP.activity(ActivityTypes.invoke)
async def on_invoke(context: TurnContext, _state: TurnState):
    invoke_response = Activity(
        type=ActivityTypes.invoke_response, value={"status": 200}
    )
    await context.send_activity(invoke_response)

# Fallback message handler
@AGENT_APP.activity("message")
async def on_message(context: TurnContext, _state: TurnState):
    await context.send_activity(f"Echo: {context.activity.text}")

# Error handler
@AGENT_APP.error
async def on_error(context: TurnContext, error: Exception):
    await context.send_activity("An error occurred.")

Streaming Responses with Azure OpenAI

python
from openai import AsyncAzureOpenAI
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
from microsoft_agents.activity import SensitivityUsageInfo

# AAD token provider (preferred over AZURE_OPENAI_API_KEY)
token_provider = get_bearer_token_provider(
    DefaultAzureCredential(),
    "https://cognitiveservices.azure.com/.default",
)

# Module-level singleton: client lives for the agent app lifetime.
CLIENT = AsyncAzureOpenAI(
    api_version=environ["AZURE_OPENAI_API_VERSION"],
    azure_endpoint=environ["AZURE_OPENAI_ENDPOINT"],
    azure_ad_token_provider=token_provider,
)

@AGENT_APP.message("poem")
async def on_poem_message(context: TurnContext, _state: TurnState):
    # Configure streaming response
    context.streaming_response.set_feedback_loop(True)
    context.streaming_response.set_generated_by_ai_label(True)
    context.streaming_response.set_sensitivity_label(
        SensitivityUsageInfo(
            type="https://schema.org/Message",
            schema_type="CreativeWork",
            name="Internal",
        )
    )
    context.streaming_response.queue_informative_update("Starting a poem...\n")

    # Stream from Azure OpenAI
    streamed_response = await CLIENT.chat.completions.create(
        model="gpt-4o",
        messages=[
            {"role": "system", "content": "You are a creative assistant."},
            {"role": "user", "content": "Write a poem about Python."}
        ],
        stream=True,
    )

    try:
        async for chunk in streamed_response:
            if chunk.choices and chunk.choices[0].delta.content:
                context.streaming_response.queue_text_chunk(
                    chunk.choices[0].delta.content
                )
    finally:
        await context.streaming_response.end_stream()

OAuth / Auto Sign-In

python
@AGENT_APP.message("/logout")
async def logout(context: TurnContext, state: TurnState):
    await AGENT_APP.auth.sign_out(context, "GRAPH")
    await context.send_activity(MessageFactory.text("You have been logged out."))


@AGENT_APP.message("/me", auth_handlers=["GRAPH"])
async def profile_request(context: TurnContext, state: TurnState):
    user_token_response = await AGENT_APP.auth.get_token(context, "GRAPH")
    if user_token_response and user_token_response.token:
        # Use token to call Microsoft Graph
        async with aiohttp.ClientSession() as session:
            headers = {
                "Authorization": f"Bearer {user_token_response.token}",
                "Content-Type": "application/json",
            }
            async with session.get(
                "https://graph.microsoft.com/v1.0/me", headers=headers
            ) as response:
                if response.status == 200:
                    user_info = await response.json()
                    await context.send_activity(f"Hello, {user_info['displayName']}!")

Copilot Studio Client (Direct to Engine)

python
import asyncio
from msal import PublicClientApplication
from microsoft_agents.activity import ActivityTypes, load_configuration_from_env
from microsoft_agents.copilotstudio.client import (
    ConnectionSettings,
    CopilotClient,
)

# Token cache (local file for interactive flows)
class LocalTokenCache:
    # See samples for full implementation
    pass

def acquire_token(settings, app_client_id, tenant_id):
    pca = PublicClientApplication(
        client_id=app_client_id,
        authority=f"https://login.microsoftonline.com/{tenant_id}",
    )

    token_request = {"scopes": ["https://api.powerplatform.com/.default"]}
    accounts = pca.get_accounts()

    if accounts:
        response = pca.acquire_token_silent(token_request["scopes"], account=accounts[0])
        return response.get("access_token")
    else:
        response = pca.acquire_token_interactive(**token_request)
        return response.get("access_token")


async def main():
    settings = ConnectionSettings(
        environment_id=environ.get("COPILOTSTUDIOAGENT__ENVIRONMENTID"),
        agent_identifier=environ.get("COPILOTSTUDIOAGENT__SCHEMANAME"),
    )

    token = acquire_token(
        settings,
        app_client_id=environ.get("COPILOTSTUDIOAGENT__AGENTAPPID"),
        tenant_id=environ.get("COPILOTSTUDIOAGENT__TENANTID"),
    )

    # CopilotClient does not implement the context manager protocol.
    copilot_client = CopilotClient(settings, token)

    # Start conversation
    act = copilot_client.start_conversation(True)
    async for action in act:
        if action.text:
            print(action.text)

    # Ask question
    replies = copilot_client.ask_question("Hello!", action.conversation.id)
    async for reply in replies:
        if reply.type == ActivityTypes.message:
            print(reply.text)


asyncio.run(main())

Best Practices

  1. This SDK is async-first — use async def handlers and async with throughout.
  2. Always use context managers for clients and async credentials. Wrap every client in with Client(...) as client: (sync) or async with Client(...) as client: (async). For async DefaultAzureCredential from azure.identity.aio, also use async with credential: so tokens and transports are cleaned up.
  3. Use microsoft_agents import prefix (underscores, not dots).
  4. Use MemoryStorage only for development; use BlobStorage or CosmosDB in production.
  5. Always use load_configuration_from_env(environ) to load SDK configuration.
  6. Include jwt_authorization_middleware in aiohttp Application middlewares.
  7. Use MsalConnectionManager for MSAL-based authentication.
  8. Call end_stream() in finally blocks when using streaming responses.
  9. Use auth_handlers parameter on message decorators for OAuth-protected routes.
  10. Keep secrets in environment variables, not in source code.

Reference Files

FileContents
references/capabilities.mdAdditional non-hero capabilities, operation-group coverage, and production checklists.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .github/plugins/azure-sdk-python/skills/m365-agents-py of microsoft/skills.

  • SKILL.md
  • references/capabilities.md

Open the folder on GitHubat commit 354361d

Used in 6 other repositories

We found 17 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 6 other GitHub owners. This page covers the copy in microsoft/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

M365 Agents Py next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

M365 Agents Py compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
M365 Agents Py this skillmicrosoft/skills3.1k6 repos~3.5kAutomated safety check: NotesMIT
AI Agent PostureSCStelz/security-investigator249—~21kAutomated safety check: PassMIT
Msgraph SDKgithub/awesome-copilot40k—~2.1kAutomated safety check: PassMIT
Purview Dspm AIvinayaklatthe/microsoft-security-skills175—~1.5kAutomated safety check: PassMIT
Detecting Email Account Compromisemukul975/Anthropic-Cybersecurity-Skills34k—~823Automated safety check: PassApache-2.0
Google WorkspaceNousResearch/hermes-agent252k3 repos~3.5kAutomated safety check: PassMIT

Similar skills

  • AI Agent Posture

    SCStelz/security-investigator

    Audit or report on AI agent security posture across Copilot Studio, Microsoft 365 Copilot, Microsoft Foundry, and third-party agents.

    249 GitHub stars~21k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Msgraph SDK

    github/awesome-copilot

    Official

    Integrate Microsoft Graph SDK into any project — .NET, TypeScript/JavaScript, or Python.

    40k GitHub stars~2.1k tokensUpdated today
    Documents & OfficeAuto-check passed
  • Purview Dspm AI

    vinayaklatthe/microsoft-security-skills

    Guidance for Microsoft Purview Data Security Posture Management for AI (DSPM for AI) - discovering, monitoring, and protecting sensitive data interactions with generative AI apps like Microsoft 365…

    175 GitHub stars~1.5k tokensUpdated 3 mo ago
    Documents & OfficeAuto-check passed
  • Detecting Email Account Compromise

    mukul975/Anthropic-Cybersecurity-Skills

    Detect compromised O365 and Google Workspace email accounts by analyzing Unified Audit Logs and Azure AD sign-in logs for impossible travel, inbox rule creation/deletion (Set-InboxRule…

    34k GitHub stars~823 tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Google Workspace

    NousResearch/hermes-agent

    Gmail, Calendar, Drive, Docs, Sheets via gws CLI or Python. An agent skill from NousResearch/hermes-agent.

    252k GitHub starsUsed in 3 repos~3.5k tokens
    Documents & OfficeAuto-check passed
  • CLI Microsoft365

    pnp/cli-microsoft365-mcp-server

    Use CLI for Microsoft 365 to manage Microsoft 365 tenants from the terminal.

    131 GitHub stars~3.5k tokensUpdated 3 days ago
    Documents & OfficeAuto-check passed

More from microsoft/skills

All 150 skills in this repo
  • Official

    Reference for building on Microsoft Foundry with the azure-ai-projects Python SDK: project clients, versioned agents, evaluations, connections, datasets and indexes.

    3.1k GitHub starsUsed in 6 repos~2.8k tokens
    Auto-check passed
  • Official

    Python guidance for the Azure AI Search SDK covering vector, hybrid and semantic search, index management and indexers, with Entra ID authentication preferred over keys.

    3.1k GitHub starsUsed in 6 repos~4.4k tokens
    Auto-check passed
  • Official

    Covers producer, consumer, and checkpoint-store setup for Azure Event Hubs streaming in Python, with Entra ID auth and partition targeting.

    3.1k GitHub starsUsed in 1 repo~2.3k tokens
    Auto-check passed
  • Pydantic Models Py

    microsoft/skills

    Official

    Create Pydantic models following the multi-model pattern with Base, Create, Update, Response, and InDB variants.

    3.1k GitHub starsUsed in 6 repos~496 tokens
    Auto-check passed
  • DebugView CLI

    microsoft/skills

    Official

    Captures and filters Windows user-mode and kernel debug output from the command line with the Sysinternals DebugView CLI, including bounded runs suited to agents.

    3.1k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Frontend UI Dark TS

    microsoft/skills

    Official

    Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations.

    3.1k GitHub starsUsed in 5 repos~3.6k tokens
    Auto-check passed

Questions about M365 Agents Py

What does M365 Agents Py do?

Microsoft 365 Agents SDK for Python. An agent skill from microsoft/skills. M365 Agents Py is an agent skill from microsoft/skills, published by the product's own GitHub organization. Microsoft 365 Agents SDK for Python.

When should I use M365 Agents Py?

M365 Agents Py fits situations like: tasks that involve Cloud office suites; tasks that involve LLM API integration.

How do I install M365 Agents Py in Claude Code?

Run `npx skills add microsoft/skills --skill m365-agents-py -a claude-code`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/m365-agents-py in microsoft/skills) into .claude/skills/m365-agents-py in your project. Claude Code loads it when a task matches its description.

How do I install M365 Agents Py in Codex?

Run `npx skills add microsoft/skills --skill m365-agents-py -a codex`. Or copy the skill folder (.github/plugins/azure-sdk-python/skills/m365-agents-py in microsoft/skills) into .agents/skills/m365-agents-py in your project. Codex loads it when a task matches its description.

Can I use M365 Agents Py in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/skills --skill m365-agents-py -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/m365-agents-py, .gemini/skills/m365-agents-py, .github/skills/m365-agents-py and .opencode/skills/m365-agents-py in your project.

What does M365 Agents Py need to run?

Going by SKILL.md and its folder, M365 Agents Py needs the command-line tools its instructions call (pip) and credentials named AZURE_OPENAI_API_KEY. Our summary lists: Python 3; A credential in AZURE_OPENAI_API_KEY.

Does M365 Agents Py access the network?

SKILL.md names 8 domains. In commands or code: cognitiveservices.azure.com, schema.org, graph.microsoft.com, login.microsoftonline.com and api.powerplatform.com; the agent is likely to contact these when it follows the instructions. As links in the text: learn.microsoft.com, github.com and pypi.org. This is read from the text; nothing was executed.

Is M365 Agents Py safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does M365 Agents Py use?

M365 Agents Py is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does M365 Agents Py use?

About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 707 tokens, read only when the agent opens those files.

What are the alternatives to M365 Agents Py?

Skills that share tags, products or a category with M365 Agents Py: AI Agent Posture (SCStelz/security-investigator, 249 stars), Msgraph SDK (github/awesome-copilot, 40k stars), Purview Dspm AI (vinayaklatthe/microsoft-security-skills, 175 stars) and Detecting Email Account Compromise (mukul975/Anthropic-Cybersecurity-Skills, 34k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains M365 Agents Py?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/skills, which has 3,091 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 6, 2026.

Source: microsoft/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.