{"slug": "how-to-stop-a-copilot-studio-agent-from-guessing-a-missing-input", "title": "How to stop a Copilot Studio agent from guessing a missing input", "summary": "A developer outlined a layered defense for preventing Copilot Studio agents from inventing missing tool inputs, using a quote flow with Product and Quantity inputs as the example. The approach combines input descriptions that forbid assuming a quantity, customized prompts for missing values, a Condition check in the flow that rejects non-whole or sub-1 quantities, and post-tool instructions telling the agent to re-ask rather than guess. The author notes none of the layers is a guarantee, since an invented but valid whole number will still pass the flow's rule-based check.", "body_md": "A user writes \"I need a quote for Standard.\" and never says how many units. If your Copilot Studio agent answers with a total, it has made up the quantity. The arithmetic can be exact, and the answer is still wrong.\n\nThis article assumes that an agent flow does all the math and returns one finished text, `Result`, while the agent only fills the flow's inputs and words the answer. That takes the arithmetic away from the language model, but the model still fills the inputs, and that is where a guess gets in.\n\nThe example is invented. Standard costs 12.50 EUR and Premium 24.85 EUR per unit, orders of 100 units or more get 10% off, and VAT is 20%.\n\nThe flow is added to the agent as a tool named **Quote**, with the inputs `Product` (Text) and `Quantity` (Number), and the agent uses generative orchestration. For 240 units of Standard, the flow returns a net total of 2,700.00 EUR and a gross total of 3,240.00 EUR.\n\nOn the tool's page, each input has a **Fill using** setting. The default is **Dynamically fill with AI**: the agent tries to take the value from the available context, and if it finds none, it generates a question for the user. Use **Custom value** with a Power Fx formula only when a rule, not language, decides the value; the agent then does not ask the user for that input.\n\nThe available context is wider than the last message: Microsoft documents that agents use recent conversation history when they fill input values.\n\n| The quantity comes from | Is it a guess? | \n|---|---|\n| The current message: \"240 units\", \"two hundred forty\" | No | \n| An earlier message in the same conversation | No: documented behavior | \n| Nowhere | Yes | \n\nThe last row is the one to stop. The five numbered sections are layers of defense. None is a guarantee; each has a limit.\n\nThe input description steers what the AI extracts. State the format, the valid values and what the agent must not do:\n\n```\nProduct description:   Product name: Standard or Premium. Pass any other name unchanged.\nQuantity description:  Number of units, as a whole number. Never assume a quantity.\n```\n\nThe limit: a description steers the model, which can still slip.\n\nTo set the question the agent asks when a required value is missing, open the input's settings and, under **Prompt**, select **Customize**:\n\n```\nProduct prompt:   Which product do you need: Standard or Premium?\nQuantity prompt:  How many units do you need?\n```\n\nThe limit is in Microsoft's guidance on generative orchestration: \"The generated question can appear before configured tool-input prompt wording is reached.\" So the agent may still ask in its own words first. If the generated question reads badly, Microsoft's advice is to refine the input's name or description.\n\nThe flow cannot see where a number came from, but it can refuse values that cannot be right. Check the inputs in a **Condition** before any math. If the price list has no row for the product, or the quantity is below 1 or not whole (`mod(…, 1)` is greater than 0), end that branch with its own **Respond to the agent**, whose `Result` names the wrong input, for example:\n\n```\nQuantity must be a whole number of 1 or more.\n```\n\nDo all the math in the other branch. Two details:\n\n`Result`.\n\n```\nAFTER THE QUOTE TOOL RUNS\n- If the Result says an input is missing or wrong, ask for it. Do not guess.\n```\n\nThe limit: the check is a rule, so the same input always takes the same branch, but it sees only what the agent passes. An invented 1 or 100 is a valid whole number, and the flow will quote it.\n\nFor wording that must be the same every time, Microsoft's guidance is an authored Question node that collects the input before the tool runs. That means calling the flow from a topic:\n\nCollect the quantity with the Question node, not with a topic input: for a missing topic input, the agent generates the question, as it does for a tool input.\n\nWhen the node asks, it uses the text you wrote. The node's **Skip behavior** setting (**Allow question to be skipped** or **Ask every time**) applies when its variable already has a value. Test a message that already contains the quantity, and check whether the question still appears. The cost: one more topic to maintain.\n\nAn agent that invents a quantity passes every test that gives one. A row without a quantity can catch it. On the agent's **Evaluation** page, select **New evaluation**, then **Single responses**, switch the toggle to **Import** and upload a CSV:\n\n```\nQuestion,Expected response\n\"How much for 240 units of Standard?\",\"240 x Standard at 12.50 EUR = 3,000.00 EUR. Volume discount 10%: 300.00 EUR. Net total: 2,700.00 EUR. VAT 20%: 540.00 EUR. Gross total: 3,240.00 EUR.\"\n\"I need a quote for Standard.\",\"How many units do you need?\"\n```\n\nUse the **Keyword match** test method, set to **All**. It does not read the expected response, so open each test case and add its keywords: `2,700.00` and `3,240.00` for the first row (the answer must then state both totals) and `How many units` for the second. Remove **General quality**, the default method, which does not compare the answer with your expected response.\n\nWhen the second row fails, read the answer:\n\n| The answer is | It means | What to do | \n|---|---|---|\n| A question in other words | The agent asked | Change the keyword, or use the Question node | \n| A quote | The agent guessed | Send the same message in the test panel and check the tool's inputs in the activity map. Tighten the `Quantity` description and rerun | \n\nTwo limits. A pass shows that the agent asked on this run, for this wording; rerun the set after every change to the flow, the instructions, a description or the model. And a single-response test has no earlier message: try \"And for Premium?\" after a 240-unit quote, in a conversation test set or the test panel. An agent that takes 240 from the earlier message is using conversation history as documented.\n\n| Layer | You can rely on | You cannot rely on | \n|---|---|---|\n| Input description | Steering what the model extracts | The model never filling in a value | \n| **Customize** prompt | Your question, once the configured prompt is reached | Fixed wording | \n| Flow check | The same input taking the same branch | Catching a plausible invented number | \n| Question node | The wording you wrote | Knowing when it is skipped, until you test it | \n| Test row | Seeing whether the agent asked on this run | Proof for other wordings or later runs | \n\nWhere do you draw the line in your agents: does a quantity from an earlier message count as context, or as a guess?\n\n*The price list and all figures in this article are invented. The article was generated with AI under my direction. The interface labels and limits were checked against Microsoft Learn on 15 November 2026, and the figures were verified by calculation; the example as a whole has not been run end to end in a tenant, so test it before you rely on it.*\n\n**References (Microsoft Learn)**", "url": "https://wpnews.pro/news/how-to-stop-a-copilot-studio-agent-from-guessing-a-missing-input", "canonical_source": "https://dev.to/juliaalba/how-to-stop-a-copilot-studio-agent-from-guessing-a-missing-input-40b", "published_at": "2026-12-01 13:40:00+00:00", "updated_at": "2026-12-01 13:44:17.602961+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "large-language-models", "ai-products"], "entities": ["Microsoft", "Copilot Studio", "Power Fx"], "also_reported_by": [], "takeaway": "Layer input descriptions, custom prompts, a flow-side Condition rejecting non-whole or sub-1 quantities, and post-tool re-ask instructions to stop a Copilot Studio agent from inventing missing tool inputs, though a plausible invented whole number still passes.", "recommendation": {"advice": "When a Copilot Studio agent fills tool inputs, forbid assumptions in the input description, add a flow Condition rejecting invalid values, and instruct the agent to re-ask instead of guessing.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/how-to-stop-a-copilot-studio-agent-from-guessing-a-missing-input", "markdown": "https://wpnews.pro/news/how-to-stop-a-copilot-studio-agent-from-guessing-a-missing-input.md", "text": "https://wpnews.pro/news/how-to-stop-a-copilot-studio-agent-from-guessing-a-missing-input.txt", "jsonld": "https://wpnews.pro/news/how-to-stop-a-copilot-studio-agent-from-guessing-a-missing-input.jsonld"}}