Generate agent instructions with an AI Builder prompt
cs_generate_instructionsGenerate precise system prompts and agent instructions for your Copilot Studio agents. Specify purpose, audience, and tone to define how the agent answers and behaves.
Instructions
Write the agent's instructions for it - the system prompt that decides how it answers. Builds a brief from purpose, audience, tone, capabilities, boundaries and examples, send it to an AI Builder prompt or model (pac copilot model predict; pick one with cs_list_prompts), and return the generated instructions. With apply: true the text is written into the agent's instructions (agent.mcs.yml, or settings.mcs.yml for cli-copilot), and only with confirm: true as well - without it the generated text comes back with the change it would make and the character count, and nothing is written. Pass currentInstructions/changeRequest (or refine: true to read the workspace) to revise existing instructions instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tone | No | ||
| apply | No | Write the result into the agent instructions (needs confirm: true as well) | |
| refine | No | Revise the workspace's current instructions using changeRequest | |
| confirm | No | Required to write the change to the file. Without it the tool returns a preview - the changed lines against the current ones, and the character count - and writes nothing. | |
| modelId | No | ||
| purpose | No | What the agent is for; required unless refining | |
| audience | No | ||
| examples | No | ||
| language | No | ||
| inputMode | No | ||
| modelName | No | Full or partial AI Builder model / prompt name | |
| workspace | No | Path to (or inside) the agent workspace. Defaults to CPS_WORKSPACE or the current directory. | |
| boundaries | No | ||
| environment | No | Environment id or URL. Defaults to the active pac auth profile. | |
| capabilities | No | Default: derived from the workspace (topics, knowledge, tools) | |
| changeRequest | No |