Skip to content

Add Azure Resiliency Agent tools - #3845

Open
Saswata Pandit (psaswata) wants to merge 21 commits into
mainfrom
saspandit/add-resiliency-agent-tool
Open

Saswata Pandit (psaswata) wants to merge 21 commits into
mainfrom
saspandit/add-resiliency-agent-tool

Conversation

@psaswata

@psaswata Saswata Pandit (psaswata) commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Adds the Azure Resiliency Agent namespace with seven tools for general
guidance, architecture assessment, IaC generation, Bicep/ARM/Terraform review
and consent-based local file attachment.

The tools delegate resiliency decisions to the existing Azure Resiliency Agent
through its asynchronous A2A API. The implementation includes delegated
authentication, Azure data-boundary propagation, polling, clarification turns,
bounded attachment handling and native MCP file artifacts.

This PR also:

  • registers the namespace in Azure MCP and consolidated-tool surfaces;
  • adds an opt-in McpContent path to every tool-loading mode so commands can
    return native content using official MCP tool-result content
    blocks

    and MCP resources;
  • promotes detailed recommendation reports ahead of generated templates,
    includes explicit artifact-presentation guidance, and emits one
    content-carrying embedded resource per file without duplicate local-path
    resource links;
  • requires detailed recommendation reports to be preserved as normal workspace
    files under azure-resiliency/, reusing identical content and avoiding
    overwrites through collision-safe naming;
  • instructs clients to surface verified workspace reports as clickable Markdown
    links using canonical absolute file:/// URIs while excluding session,
    tool-call, cache and temporary paths;
  • adds command, service and shared-loader coverage;
  • updates command metadata, routing prompts, README, changelog and CODEOWNERS.

The file-upload design was reviewed with the Azure MCP security team, including
the LocalRequired designation, file validation and sanitization checks, and
UNC/network-path rejection.

Tool surface

  • resiliencyagent_guidance_get
  • resiliencyagent_file_attach
  • resiliencyagent_architecture_assess
  • resiliencyagent_iac_generate
  • resiliencyagent_bicep_review
  • resiliencyagent_arm_review
  • resiliencyagent_terraform_review

Testing

  • 89 Resiliency Agent tests passed.
  • 52 single-proxy loader tests passed.
  • 50 Azure MCP server tests passed.
  • Build-Local.ps1 passed.
  • Build-Local.ps1 -VerifyNpx passed.
  • Serial Vally routing validation passed 9/9, covering conceptual guidance,
    architecture assessment, IaC generation and Bicep, ARM JSON and Terraform
    review.
  • Manual VS Code and Copilot CLI validation covered consent-based file
    attachment, clarification, native artifact rendering, repository edits and
    user-approved PR orchestration.
  • Direct A2A attachment validation confirmed exact file transport, private
    Blob persistence and pointer-only task storage.

Product evidence

GitHub issue number?

Closes #3844

Pre-merge Checklist

  • Required for All PRs
    • Read the contribution guidelines
    • PR title clearly describes the change
    • Commit history uses descriptive messages
    • Added comprehensive tests for new functionality
    • Added a changelog entry
  • For MCP tool changes
    • The onboarding issue documents why the seven commands are submitted as
      one cohesive namespace contribution
    • Updated the Azure MCP Server README
    • Updated consolidated-tools.json
  • Extra steps for Azure MCP Server tool changes
    • Updated azmcp-commands.md
    • Updated command metadata
    • Updated e2eTestPrompts.md

Exposes the Azure Resiliency Agent through a single conversation-level tool,
resiliencyagent_conversation_ask. A developer describes an application in their
own words and receives a zonal resilience assessment, or asks for zone-resilient
Bicep, ARM or Terraform templates for new resources.

The area holds no agent logic. It is a thin client over the agent's existing A2A
surface, so the backend keeps ownership of what a turn does, including which
scenario handles it and when to stop and ask the user something. That is why one
conversation-level tool covers both assessment and template generation rather
than one tool per Azure operation.

The agent is multi-turn: it asks its own clarifying questions before it can act.
A single tool call therefore carries an entire conversation. The command polls
the agent, raises an elicitation when the agent needs input, feeds the answer
back, and returns once. The host model issues one call and never sees the
polling, so clarifying questions reach the user exactly as the agent wrote them
rather than depending on a model to follow instructions about how to poll.

While a turn is running the agent publishes short reasoning steps. Those are
forwarded as progress notifications, which also resets client inactivity timers
on a call that can run for minutes.

Templates and reports are written to the caller's working directory and returned
as paths, following the pattern the Azure Migrate platform landing zone tool
uses. A generated template is more useful as a file that can be opened and
deployed than as text in a chat reply, and a long report does not have to travel
through the model's context. Artifact names arrive from a remote service and are
treated as untrusted input when used as file names.

The tool is marked LocalRequired because it asks the user questions over the
client connection, which is not available in HTTP mode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
…ncy-agent-tool

# Conflicts:
#	servers/Azure.Mcp.Server/README.md
Add five architecture and IaC scenario tools, local file attachment with explicit consent and bounded in-memory caching, A2A FilePart forwarding, public data-boundary routing, MCP artifact content blocks, evaluations, documentation, and tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Remove stale POC prompts and use customer-facing service-area language.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Remove the checked-in Vally specification and rely on the repository evaluator to generate unattended routing evaluations from the E2E prompt inventory. Normalize interactive scenarios to the supported context-required classification.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Add generated Vally coverage for inline ARM, Bicep, and Terraform reviews. Clarify that review commands accept source directly in the request while local files use attachment IDs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Guide complete and multi-file templates through the attachment flow while retaining direct support for templates pasted inline. Reserve existing IaC resiliency review for the format-specific Resiliency Agent commands instead of generic guidance tools.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Include the nested FileContent kind discriminator required by the A2A polymorphic contract so uploaded bytes, filename, and MIME type survive backend deserialization and blob offload.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Add a conceptual guidance command and routing prompts, and make the public A2A endpoint plus delegated scope fixed production constants with no runtime environment overrides or auth bypass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Native artifacts are lost in single-tool mode, existing files can be overwritten, and several required security, metadata, and integration gaps remain.

Review effort: Balanced
Findings: 3 High severity · 5 Medium severity · 5 Low severity

Open (13)
What changed in this PR

Adds an Azure Resiliency Agent toolset that delegates guidance, assessment, generation, and IaC review to the hosted A2A service.

Changes:

  • Adds seven commands with delegated authentication, polling, elicitation, attachments, and artifacts.
  • Adds native MCP content support to command responses and loaders.
  • Registers and documents the toolset with unit-test coverage.
File Description
.github/​CODEOWNERS Adds toolset owners.
Microsoft.Mcp.slnx Adds projects to the root solution.
core/​Microsoft.Mcp.Core/​src/​Areas/​Server/​Commands/​ToolLoading/​CommandFactoryToolLoader.cs Appends native MCP content.
core/​Microsoft.Mcp.Core/​src/​Areas/​Server/​Commands/​ToolLoading/​NamespaceToolLoader.cs Appends native MCP content.
core/​Microsoft.Mcp.Core/​src/​Models/​Command/​CommandResponse.cs Adds the native content contract.
servers/​Azure.Mcp.Server/​Azure.Mcp.Server.slnx Adds toolset projects.
servers/​Azure.Mcp.Server/​README.md Documents the service area.
servers/​Azure.Mcp.Server/​changelog-entries/​saspandit-resiliency-agent-tool.yaml Adds the feature changelog entry.
servers/​Azure.Mcp.Server/​docs/​azmcp-commands.md Documents all commands.
servers/​Azure.Mcp.Server/​docs/​e2eTestPrompts.md Adds routing prompts.
servers/​Azure.Mcp.Server/​src/​Program.cs Registers the toolset.
servers/​Azure.Mcp.Server/​src/​Resources/​consolidated-tools.json Adds consolidated tool mappings.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​AssemblyInfo.cs Exposes internals to tests.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Azure.Mcp.Tools.ResiliencyAgent.csproj Defines the tool project.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​Architecture/​ArchitectureAssessCommand.cs Adds architecture assessment.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​Arm/​ArmReviewCommand.cs Adds ARM review.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​Bicep/​BicepReviewCommand.cs Adds Bicep review.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​File/​FileAttachCommand.cs Adds consent-based attachment preparation.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​Guidance/​GuidanceGetCommand.cs Adds resiliency guidance.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​Iac/​IacGenerateCommand.cs Adds IaC generation.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​ResiliencyAgentCommand.cs Implements shared scenario execution.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​ResiliencyAgentJsonContext.cs Registers serializable models.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Commands/​Terraform/​TerraformReviewCommand.cs Adds Terraform review.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Models/​ResiliencyAgentModels.cs Defines agent and artifact models.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Options/​FileAttachOptions.cs Defines file attachment input.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Options/​ResiliencyAgentOptionDescriptions.cs Defines shared option descriptions.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Options/​ResiliencyAgentRequestOptions.cs Defines scenario inputs.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​ResiliencyAgentSetup.cs Registers services and commands.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​ArtifactWriter.cs Materializes generated artifacts.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​AttachmentCache.cs Caches approved snapshots.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​AttachmentPolicy.cs Defines attachment limits and types.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​DataBoundaryResolver.cs Resolves tenant data boundaries.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​IArtifactWriter.cs Defines artifact writing.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​IAttachmentCache.cs Defines attachment caching.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​IDataBoundaryResolver.cs Defines boundary resolution.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​ILocalFileSnapshotter.cs Defines file snapshotting.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​IResiliencyAgentService.cs Defines the A2A client contract.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​LocalFileSnapshotter.cs Validates and snapshots files.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​src/​Services/​ResiliencyAgentService.cs Implements A2A communication.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​AttachmentServicesTests.cs Tests snapshots and caching.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​Guidance/​GuidanceGetCommandTests.cs Tests guidance execution.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​Iac/​IacGenerateCommandTests.cs Tests generation and native artifacts.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​ResiliencyAgentSetupTests.cs Tests registration.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​ScenarioCommandExecutionTests.cs Tests shared scenario behavior.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​Services/​ArtifactWriterTests.cs Tests artifact writing.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​Services/​DataBoundaryResolverTests.cs Tests boundary mapping and retries.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​Services/​ResiliencyAgentServiceTests.cs Tests A2A payloads and artifacts.
tools/​Azure.Mcp.Tools.ResiliencyAgent/​tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests/​Azure.Mcp.Tools.ResiliencyAgent.Tests.csproj Defines the unit-test project.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Outdated
Comment thread tools/Azure.Mcp.Tools.ResiliencyAgent/src/Services/ArtifactWriter.cs Outdated
Comment thread core/Microsoft.Mcp.Core/src/Models/Command/CommandResponse.cs
Comment thread servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Outdated
Comment thread tools/Azure.Mcp.Tools.ResiliencyAgent/src/Commands/Guidance/GuidanceGetCommand.cs Outdated
Comment thread tools/Azure.Mcp.Tools.ResiliencyAgent/src/Models/ResiliencyAgentModels.cs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Comment thread tools/Azure.Mcp.Tools.ResiliencyAgent/src/Commands/ResiliencyAgentCommand.cs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Resolve the cspell dictionary conflict and update affected tests for the latest command registration and loader APIs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Keep the upstream explicit server command registration while resolving the PR conflict.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 974958dc-ded9-4351-bed3-07227e1bce92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server-Azure.Mcp Azure.Mcp.Server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ONBOARD] Azure Resiliency Agent tools

3 participants