Why Declarative Agents Belong Inside Microsoft 365 Copilot
Agents built natively in Microsoft 365 Copilot get automatic placement in the immersive agent store, making them discoverable to every user in an organization without a separate distribution layer. They surface wherever Copilot does (Word, PowerPoint, Excel), and software companies can monetize them through the Agent Center. Developers also inherit Copilot’s existing data protections and management controls, which means enterprise security requirements don’t have to be rebuilt from scratch for each agent.
“Copilot is the UI for AI.” (Sebastien Levert)
TypeSpec as a Language Abstraction for Agent Development
TypeSpec for Microsoft 365 Copilot replaces the JSON config files developers previously juggled. Seven or ten APIs meant dozens of disconnected files. Now one TypeSpec file, or several logically linked ones, covers all of it with real-time IDE validation: missing imports, wrong types, and misconfigured actions surface immediately. The typespec/http and typespec/openapi packages generate OpenAPI specs on the fly, so there’s no separate spec-maintenance step. Actions shared across projects ship as packages, so tuning a complex API call for one agent carries over to the next.
“we’re making the inner loop for developers way smoother.” (Sebastien Levert)
Scaffolding and Grounding an Agent with Web Search
From the Agents Toolkit sidebar in VS Code, selecting “create a new declarative agent” and choosing the TypeSpec template scaffolds a project in seconds, including a README with every setup step. One click on the provision button deploys the agent directly to Microsoft 365 Copilot. Adding a web search capability takes three lines in the main.tsp file. Scoping it to specific URLs, up to four, is one more decorator. The result: asking “how can I label a GitHub issue?” returns cited answers drawn only from the GitHub documentation URLs declared in code. See the grounded web-search answer for GitHub issues (15:46).
Connecting to a Live API and Controlling Output Format
Connecting to the GitHub search-issues endpoint means uncommenting scaffolded placeholder lines in main.tsp, pointing a service reference at the GitHub API, and setting a default repo filter. One instruction line tells Copilot to render results as a markdown table with number, title, and assignee columns. For richer detail, an adaptive card defined in a cards/issues.json file and attached via the @card decorator gives each result a clickable “view issue” button. See the live GitHub API table with adaptive cards (26:36). Typing -developer on in chat enables a debug card showing every endpoint hit, response code, latency, and raw payload.
“Now I just unlocked the power of my API directly inside my agent.” (Sebastien Levert)
Adding Write Actions and OAuth Authentication
Adding a write operation means defining a updateIssue model in TypeSpec with only the fields you want Copilot to touch. State changes are deliberately excluded, so users can’t alter issue state from chat. Authentication goes in one block: OAuth auth-code flow with authorization URL, token URL, refresh URL, and scopes, stored centrally in the Microsoft developer portal, never embedded in the app. A single @useAuth decorator applies those credentials to every endpoint. See the authenticated PATCH to assign a GitHub issue (34:44). The debug card confirmed the flow: a 403 on the first call, then a 200 after the OAuth redirect completed.
Notable Quotes
Copilot is the UI for AI. Sebastien Levert · ▶ 0:50
we’re making the inner loop for developers way smoother. Sebastien Levert · ▶ 6:19
Now I just unlocked the power of my API directly inside my agent. Sebastien Levert · ▶ 18:58
Key Takeaways
- TypeSpec replaces disconnected JSON config files with a single typed file that IDE tooling validates in real time.
- Agents provision directly to Microsoft 365 Copilot in seconds from VS Code using the Agents Toolkit button.
- A @useAuth decorator and an OAuth reference ID are all that separate an anonymous agent from a fully authenticated one.