{"title":"Coding agents in AL (preview)","url":"https://jonas-paprotka.de/docs/dev-itpro/ai/ai-agent-sdk-overview/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/ai/ai-agent-sdk-overview, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/ai/ai-agent-sdk-overview","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Learn about the development tools for building AI agents in Dynamics 365 Business Central.","date":"2026-10-02","meta":{"topic":"concept-article"},"outline":[{"level":1,"title":"Coding agents in AL (preview)","slug":"coding-agents-in-al-preview","at":0,"chars":4701},{"level":2,"title":"Quick-start","slug":"quick-start","at":1313,"chars":334},{"level":2,"title":"Core interfaces","slug":"core-interfaces","at":1647,"chars":673},{"level":2,"title":"Setup and configuration","slug":"setup-and-configuration","at":2320,"chars":523},{"level":2,"title":"Managing agent tasks programmatically","slug":"managing-agent-tasks-programmatically","at":2843,"chars":571},{"level":2,"title":"Related information","slug":"related-information","at":3414,"chars":1287}],"text":"# Coding agents in AL (preview)\n[This article is prerelease documentation and is subject to change.]\n> IMPORTANT\n > This is a preview feature. Preview features might have restricted functionality and are subject to supplemental terms of use<https://www.microsoft.com/en-us/business-applications/legal/supp-powerplatform-preview/>.\n > The AI development toolkit is available in sandbox environments only. The Agent SDK for AL is available in sandbox environments and, starting from version 28.1, also in production environments.\n > This article is primarily intended for product owners, domain experts, consultants, and developers who want to experiment with AI capabilities in Business Central.\nIn AL, you find interfaces and codeunits designed for building custom AI agents in Business Central. This article provides an overview of these tools and links to detailed documentation for each area.\n> IMPORTANT\n> This capability is available for sandbox environments for evaluation purposes from 27.4. Starting from version 28.1, production environments are also supported.\n> IMPORTANT\n> Before deploying agents to a production environment, it's highly recommended to define and run thorough tests in a sandbox environment. See Best practices for designing an agent (preview)<ai-development-toolkit-best-practices>.\n## Quick-start\nTo quickly get started with a template agent that, you can customize to your needs; press Ctrl+Shift+P and start typing `AL: New Project` command in Visual Studio Code to choose the Agent template. This provides you with a skeleton of an implementation, which covers most of the topics discussed in this documentation.\n## Core interfaces\nTo define an agent in AL, you need to extend the enum that defines the available types of agents and implement three core interfaces:\nInterface|Purpose\nIAgentFactory|Defines how agent instances are created and configured, including default settings, setup pages, and creation rules.\nIAgentMetadata|Provides runtime metadata for individual agent instances, such as initials, setup pages, summary pages, and annotations.\nIAgentTaskExecution|Controls how agents process and execute tasks, including message analysis, user intervention suggestions, and page context.\nSee Define and register an agent programmatically (preview)<ai-agent-sdk-define-register>.\n## Setup and configuration\nOnce you've defined your agent type, you need to create setup pages and configure agent instances:\n Setup pages: Create configuration dialogs using the ConfigurationDialog page type\n Agent Setup codeunit: Use helper methods for UI-based agent configuration\n Agent configuration: Set display names, profiles, localization, permissions, and access controls\n Instructions: Define static or dynamic instructions for your agent\nSee Agent setup and configuration (preview)<ai-agent-sdk-configuration>.\n## Managing agent tasks programmatically\nThe API for building agents provides codeunits to trigger and manage agent tasks programmatically:\n Agent Task Builder API: Create tasks from page actions, business events, or email triggers\n Attachments: Add documents for agents to process\n Task lifecycle: Monitor and control running tasks\n Agent sessions: Detect agent sessions and bind events for task duration\n Cross-agent operations: Create public APIs to allow other apps to interact with your agent\nSee Managing agent tasks programmatically (preview)<ai-agent-sdk-tasks>.\n## Related information\nDefine and register an agent programmatically (preview)<ai-agent-sdk-define-register>\nAgent setup and configuration (preview)<ai-agent-sdk-configuration>\nManaging agent tasks programmatically (preview)<ai-agent-sdk-tasks>\nOverview (preview)<https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/ai-development-toolkit-landing-page>\nDesigning and coding agents (preview)<ai-development-toolkit-overview>\nIntegrate with the Tasks AL API (preview)<ai-development-toolkit-tasks-api>\nCreate and activate (preview)<ai-development-toolkit-agent-create>\nWrite effective instructions (preview)<ai-development-toolkit-instructions>\nInstruction keywords (preview)<ai-development-toolkit-instruction-keywords>\nSet up permissions and profiles (preview)<ai-development-toolkit-permissions-profiles>\nRun an agent (preview)<ai-development-toolkit-run-agent>\nIterate and manage (preview)<ai-development-toolkit-iterate>\nFrequently asked questions (preview)<ai-development-toolkit-faq>\nBest practices for designing an agent (preview)<ai-development-toolkit-best-practices>\nCreate a Sales Validation Agent (preview)<ai-development-toolkit-sales-validation>\nTransparency note: Business Central AI development toolkit (preview)<transparency-note-ai-development-toolkit>"}