Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Instance aware flow is a 1st party-only feature that should not be suggested to 3rd party customers. This PR adds explicit guidance to prevent Copilot from recommending it incorrectly.

Changes

  • New section "Instance Aware Flow Restrictions" in .github/copilot-instructions.md:
    • Marks instanceAware config and instance_aware query parameter as 1st party-only
    • Prohibits suggesting this feature for 3rd party applications
    • Clarifies existing docs at lib/msal-browser/docs/instance-aware.md are for internal use
    • Provides alternative solutions for 3rd party multi-cloud scenarios (standard flows, proper authority config, separate app registrations)

Context

Instance aware flow enables dynamic cloud instance selection via STS parameters in the /authorize response. While available in the public API surface, it's designed exclusively for Microsoft internal applications handling users across cloud boundaries.

Original prompt

Please create a PR for me that updates the "copilot-instructions.md" file that states that the instance aware flow is only available for 1st party customers, and not to suggest or use instance aware for 3rd party customers. Please use the instructions located at .github/copilot-instructions.md for the PR.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: jo-arroyo <45890484+jo-arroyo@users.noreply.github.com>
Copilot AI changed the title [WIP] Update copilot-instructions to clarify instance aware flow Add instance aware flow restriction to copilot-instructions.md Nov 14, 2025
Copilot AI requested a review from jo-arroyo November 14, 2025 21:42
Copilot finished work on behalf of jo-arroyo November 14, 2025 21:42
@jo-arroyo jo-arroyo marked this pull request as ready for review November 14, 2025 22:25
@jo-arroyo jo-arroyo requested a review from a team as a code owner November 14, 2025 22:25
Copilot AI review requested due to automatic review settings November 14, 2025 22:25
Copilot finished reviewing on behalf of jo-arroyo November 14, 2025 22:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds explicit guidance to prevent GitHub Copilot from recommending the instance aware flow feature to 3rd party developers, as it's exclusively designed for Microsoft internal applications. The new section clarifies that while the feature exists in the public API, it should only be used by 1st party Microsoft customers for handling users across different cloud instances.

Key Changes

  • Added "Instance Aware Flow Restrictions" section with clear prohibitions against suggesting this feature to external developers
  • Documented what instance aware flow is and when it should be used (1st party only)
  • Provided alternative solutions for 3rd party multi-cloud scenarios

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

### Instance Aware Flow Restrictions

**IMPORTANT: The instance aware flow is only available for 1st party Microsoft customers and should NEVER be suggested or used for 3rd party customers.**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copilot is unlikely to know if I am a 1st party or 3rd party customer or what that is. The instructions here are probably not going to be all that useful, we probably need to restrict access in code instead if this is the goal.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should just be that this feature isn't supported and we have copilot instructions in the 1p repo to ignore that statement in the 3p repo? We aren't looking to make code changes for this, just doc updates.

Copy link
Collaborator

Choose a reason for hiding this comment

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

When working in the 1P repo, this instructions file won't be read at all so no need to ignore explicitly. At a higher level though exposing something we don't support creates several challenges, including this one. We should reconsider whether this is the right approach.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good to know re. what Copilot does and does not know. This part has now been amended, since the current ask is just to move/remove the public-facing documentation.

- Instance aware flow documentation exists at `lib/msal-browser/docs/instance-aware.md` but is intended only for internal Microsoft use cases
- If asked about multi-cloud or cloud instance scenarios by 3rd party developers, provide alternative solutions that do not involve instance aware flow

**What Is Instance Aware Flow:**
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move what is / when to use sections to the 1p docs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants