
Foundry Agent Service builds an agent from a definition or from your code, runs it on a managed runtime, and controls what it can reach. Microsoft's earlier documentation calls it the Azure AI Agent Service. You build a prompt agent from instructions, a model and tools, and Foundry runs it for you. A hosted agent is your own code, packaged in a container. Foundry runs each exchange as a response against a conversation that keeps the history, and calls tools along the way. Each agent gets its own Microsoft Entra identity, which starts with no access until you grant it. The agent reaches only the systems someone has approved (Microsoft Learn, Foundry Agent Service overview).
Microsoft Learn now documents the service as Foundry Agent Service inside Microsoft Foundry. Its release notes for the classic version still use the Azure AI Agent Service name. Agents built on that classic version are deprecated. They retire on March 31, 2027, so a new build should start on the current agents this post describes.
Microsoft lists three agent types and one way to use Foundry without an agent resource (Microsoft Learn). A prompt agent is configuration only. You set its instructions, choose a model from the Foundry Models catalog, such as GPT-4o, Llama or DeepSeek, and attach tools. You can do this in the Foundry portal or through the SDKs and REST API. With the SDKs or REST API, the definition can live in source control and ship through your CI/CD pipeline. A voice-based prompt agent applies the same definition to spoken conversations, and Voice Live handles the speech. A hosted agent is your own code, shipped as a container image or as a .zip file that Foundry builds into one. You can write it with Microsoft Agent Framework, LangGraph, the OpenAI Agents SDK, the Anthropic Agent SDK or your own stack. Microsoft calls the fourth path an ephemeral agent. Its definition stays in your application, which calls the Responses API directly.
What Foundry runs for you differs by path. A prompt agent runs with no code or infrastructure for you to manage. It suits a fast start, and production agents that need no custom orchestration. A hosted agent runs as your container, with a managed endpoint, automatic scaling and its own Entra identity. It suits agents that call into your own code. The Responses API gives you model inference and tools, with no agent resource to manage. It suits agent logic that ships with your app. For a first agent, Microsoft's overview recommends starting with a prompt agent.
| Prompt agent | Hosted agent | Responses API | |
|---|---|---|---|
| You build | instructions, a model and tools | shipped as a container image or as a .zip file | the definition stays in your application |
| Foundry runs | no code or infrastructure to manage | your container, with a managed endpoint, automatic scaling and its own Entra identity | model inference and tools, with no agent resource to manage |
| Suits | a fast start and production agents without custom orchestration | agents that call into your own code | agent logic that ships with your app |
Tools let an agent act. Foundry offers built-in tools such as web search, file search, Code Interpreter and memory. You add your own through functions, OpenAPI specs and MCP servers, which connect an agent to other systems over the Model Context Protocol. A Foundry Toolbox groups tools behind one managed MCP endpoint, so you manage their authentication and versions in one place. Foundry stores each agent as a named asset with versions. You create it through the SDKs for Python, C#, JavaScript and Java or the REST API (Microsoft Learn, runtime components). Foundry saves a new version each time you change the agent, so you can compare versions or roll back.
Every exchange runs on three runtime components. The agent supplies the model, instructions and tools. A conversation keeps the input and output items across turns. A response runs the agent against that input and produces output, calling a tool when the agent decides it needs one (Microsoft Learn, runtime components). Your application selects the agent, creates a conversation and adds the user's question. A response runs the agent against the conversation and adds its output to it. The next response uses the same conversation, so the agent answers a follow-up in context.
A tool that writes data can wait for a person. Set an MCP tool's require_approval option to always, and the response stops with an approval request. The request names the server, the tool and its arguments. The agent continues once someone sends the approval back in the same conversation (Microsoft Learn, MCP tool). Microsoft advises requiring approval for high-risk operations, especially tools that write data or change resources. It also advises limiting each MCP server to a list of allowed tools, and logging approvals and tool calls for auditing.
Code the agent writes runs in a sandbox, an isolated environment of its own. Code Interpreter runs Python in a sandbox that Microsoft manages. Each session sits behind its own Hyper-V boundary in your project's Azure region, with no outbound network access. A session stays active for up to one hour and has a 30-minute idle timeout (Microsoft Learn, Code Interpreter). A hosted agent gets a sandbox for each session, isolated at the virtual machine (VM) level. When an idle session resumes, the files the agent wrote are restored (Microsoft Learn, hosted agents).
You can trace every step. Foundry's agent tracing shows each model call, tool call and decision. Application Insights integration, evaluations and service metrics cover monitoring. Foundry's content filters help mitigate prompt injection, where hidden instructions try to redirect the agent. That includes cross-prompt injection, where the instructions sit in a document or email the agent reads (Microsoft Learn). Where data must stay in your own resources, you can bring your own storage, Azure AI Search and Azure Cosmos DB for conversation state. You can also run prompt agents inside your Azure virtual network.
Each agent gets its own Microsoft Entra identity. When you create an agent, Foundry sets up an agent identity blueprint and the identity for the agent's default instance. That identity starts without resource permissions. Foundry assigns it no Azure RBAC role, so you or your administrator grant what it needs in each target service (Microsoft Learn, agent identity). RBAC, role-based access control, is how Azure decides who may do what. When the agent calls a tool, Foundry Agent Service exchanges the blueprint's credential for a token scoped to that service. The service checks the agent identity's role assignments before it grants or denies access. No secret sits in a prompt, the code or a connection string.
Whose access a tool call uses depends on its access model. Under application-only access, the agent acts under its own authority, with no signed-in user. It reaches what its own roles allow. An agent that writes to Azure Storage needs a suitable Azure RBAC role on the storage resource. One that queries Azure Cosmos DB needs a Cosmos DB data-plane role instead, which is not an Azure RBAC role assignment. Under delegated access, the agent acts on behalf of the signed-in user. The agent then needs the delegated permission, and the user needs access to the resource. Delegated access is in preview and works with the tools Microsoft lists, such as Work IQ SharePoint, Fabric IQ, Azure DevOps MCP and Microsoft Dataverse. An agent built before per-agent identities shares the project's identity. To move it to its own identity, you assign its roles again, because existing role assignments do not transfer (Microsoft Learn, agent identity).
Give each identity only the access its tools need, the principle known as least privilege. Where it meets the agent's needs, grant access on one resource or resource group rather than the whole subscription. Agent identities appear in the Microsoft Entra admin center next to those from Copilot Studio. Conditional Access and identity protection apply to them there. The Entra sign-in logs show which agent identity obtained a token for which resource, and on behalf of which user. Azure RBAC sets who may create, run and manage agents, through roles Microsoft recently renamed Foundry User, Foundry Owner and Foundry Project Manager (Microsoft Learn, agent identity).
Your security team will ask what the agent could see, what it did and who approved it. Ovidius builds agentic workflows on Microsoft Foundry inside your Azure tenant and answers all three questions before the agent goes live. Access runs through your own Entra ID roles, and your team reviews and approves the agent's work on screens we build for it.
The Azure AI Agent Service is the name Microsoft's earlier documentation uses for Foundry Agent Service. That is Microsoft's managed platform for building, deploying and scaling AI agents in Microsoft Foundry. You define an agent as instructions, a model and tools, or package your own code as a hosted agent. Foundry runs it with conversations, tools, tracing and an Entra identity for each agent. Agents on the classic version retire on March 31, 2027, as Microsoft's release notes state.
A prompt agent is defined entirely by configuration: its instructions, model and tools. Foundry runs it with no code or infrastructure for you to manage. A hosted agent is your own code, built with a framework such as Microsoft Agent Framework or LangGraph and shipped as a container. Foundry runs it with a managed endpoint, automatic scaling and its own Entra identity. A hosted agent suits an agent that calls into your own code.
Yes, when a tool uses delegated access, which is in preview for the tools Microsoft lists. The agent then acts on behalf of the user, and the user needs access to the resource too. Under application-only access, the agent acts under its own Entra identity, with no signed-in user. It reaches what its own roles allow. A new agent identity starts without resource permissions, so you grant each one what its tools need.
Yes. Set an MCP tool's require_approval option to always, and each call stops with an approval request. The request names the server, the tool and its arguments. The agent continues once a person sends the approval back in the same conversation. Microsoft advises requiring approval for tools that write data or change resources, and logging approvals and tool calls for auditing.
Foundry runs it in a sandbox. Code Interpreter runs Python in a sandbox that Microsoft manages. Each session is isolated by a Hyper-V boundary in the same Azure region as your project, with no outbound network access. A session stays active for up to one hour and has a 30-minute idle timeout (Microsoft Learn). Hosted agents run your own code in a sandbox for each session, isolated at the virtual machine level.
Turn on tracing. Foundry's agent tracing records each model call, tool call and decision in the Application Insights resource connected to your project. The Microsoft Entra sign-in logs show which agent identity obtained a token for which resource. For delegated access, they also show on behalf of which user. Together they show what the agent did and whose access it used.
Planning an agent on Microsoft Foundry?
Contact Ovidius about the workflow you want to run. A senior partner runs the call and tells you whether Foundry is the right platform for the job before anything is scoped.