Skip to content

Python: [Bug]: strict field does not exist in JSON schema in Foundry when using with Create Agent API for Azure V2 #3229

Closed

Description

Description

When an agent is created using the Create API in the new Foundry V2 update, the JSON schema details of the newly created agent do not include the "strict: true" field. I also tried using Pydantic's "ConfigDict(extra="forbid")" setting, but it didn't work.

Image

Code Sample

import asyncio
import os

from agent_framework.azure import AzureAIProjectAgentProvider
from azure.ai.projects.aio import AIProjectClient
from azure.core.exceptions import ResourceNotFoundError
from azure.identity import InteractiveBrowserCredential
from pydantic import BaseModel


class TestSchema(BaseModel):
    subject: str
    summary: str


async def main():
    credential = InteractiveBrowserCredential()
    async with AIProjectClient(
        endpoint=os.environ["AZURE_AI_FOUNDRY_PROJECT_ENDPOINT"],
        credential=credential,
    ) as project_client:
        provider = AzureAIProjectAgentProvider(project_client=project_client)
        agent_name = "summarizer-agent"
        try:
            agent = await provider.get_agent(name=agent_name)
            print(f"Agent found: {agent.name}")
        except ResourceNotFoundError:
            agent = await provider.create_agent(
                name=agent_name,
                model="gpt-5.2",
                instructions="You are responsible for writing a brief summary of a few sentences on the given subject.",
                description="An agent that summarizes a given subject.",
                response_format=TestSchema,
            )
            print(f"Agent created: {agent.name}")

        response = await agent.run(subject="Artificial Intelligence")
        print("===== Agent Response =====")
        print(response)


if __name__ == "__main__":
    asyncio.run(main())

Error Messages / Stack Traces

Package Versions

1.0.0b260114

Python Version

3.13

Additional Context

No response

Activity

  1. added
    bugUsage: [Issues], Target: all issues (Legacy, prefer issue type: bug)
    on Jan 15, 2026
  2. changed the title [-]Python: [Bug]: strict field is not exist in JSON schema in Foundry when using with Create Agent API for Azure V2[/-] [+]Python: [Bug]: strict field does not exist in JSON schema in Foundry when using with Create Agent API for Azure V2[/+] on Jan 15, 2026
  3. added and removed
    triageUsage: [Issues], Target: All issues that still need to be triaged
    on Jan 15, 2026
  4. moved this from In Review to Done in Agent Frameworkon Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugUsage: [Issues], Target: all issues (Legacy, prefer issue type: bug)pythonUsage: [Issues, PRs], Target: Python

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions