Skip to content

fix: resolve the destructive action bug - #1103

Merged
Roopan-Microsoft merged 1 commit into
microsoft:devfrom
Dhruvkumar-Microsoft:feat/model-changes
Jul 20, 2026
Merged

fix: resolve the destructive action bug#1103
Roopan-Microsoft merged 1 commit into
microsoft:devfrom
Dhruvkumar-Microsoft:feat/model-changes

Conversation

@Dhruvkumar-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This pull request strengthens and clarifies how team scope and agent capabilities are evaluated and communicated throughout the orchestration system. The changes ensure that requests are only accepted if they both match a team's domain and can actually be fulfilled by its agents, and that users receive clear, accurate feedback when requests are out of scope—especially for actions the agents cannot perform (such as deleting or modifying data). Messaging and prompt templates have been updated across the codebase to reflect these stricter, more explicit policies.

Scope and Capability Evaluation Policy Updates:

  • The system prompt in _evaluate_team_scope (orchestration_manager.py) now instructs the classifier to consider both the team's specialization and the actual capabilities of its agents, explicitly distinguishing between "domain" and "capability" out-of-scope cases. It also clarifies that destructive or state-changing actions are not allowed unless explicitly supported.
  • The Magentic prompt template in plan_review_helpers.py was updated to require that requests must be both within an agent's domain and ask for actions the agents can actually perform, with explicit instructions for handling unsupported actions and clearer out-of-scope messaging.

User Messaging and Logging Improvements:

  • When a request is out of scope, the returned message now differentiates between domain mismatches and unsupported actions, providing tailored explanations and ensuring users are told when no data was changed. Logging now also records the kind of out-of-scope reason.
  • The out-of-scope handling step (_handle_out_of_scope) now informs users whether a request is out of scope due to domain or unsupported action, and always clarifies that no data was changed.
  • The final answer rules in the Magentic prompt were updated to provide more specific, accurate, and polite user-facing messages for both domain and capability out-of-scope cases, and to reinforce that no unsupported actions are ever performed.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft
Roopan-Microsoft merged commit af97587 into microsoft:dev Jul 20, 2026
5 of 6 checks passed
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.

2 participants