How to create an incident summarization assistant in Microsoft Copilot
This tutorial shows how to create an assistant in Microsoft Copilot that analyzes incident descriptions (logs, emails, tickets) and generates a technical summary and an executive summary. It is useful for teams that need fast, consistent reports for management and audit.
Prerequisites
- Account with access to Microsoft Copilot / Copilot Studio and permissions to create agents.
- Incident examples: log snippets, ticket email and notes (file .txt or .csv).
- Basic knowledge of prompts and data organization (simple CSV/JSON).
Step 1: Define the goal and training examples
Clearly explain what the assistant should do: produce a "Technical Summary" (cause, impact, mitigation steps) and an "Executive Summary" (context, business impact, next steps). Gather 10–20 real or simulated examples to guide the responses (this improves consistency).
# Estrutura de exemplo (CSV) id,origem,texto 1,email,"Serviço X caiu às 03:12. Erro 503 no endpoint /api/pay." /* Guardar estes exemplos num ficheiro incidents.csv */
Step 2: Create a new agent in Copilot Studio
In Copilot Studio, choose to create an agent/assistant and give it a name like "ResumoIncidentesBot". In the agent summary, describe the role: transform incident text into two distinct summaries with technical and executive tones. Set the language to Portuguese (pt-PT).
Step 3: Configure the main prompt (system + examples)
Write a base prompt that guides behavior: personality, output format and rules (maximum length, required inclusions). Add input/output examples for few-shot learning.
System: És um assistente que resume incidentes. Regras: - Produz dois blocos: "Resumo Técnico" e "Resumo Executivo". - Resumo Técnico: 3 pontos (Causa provável, Impacto técnico, Ação imediata). - Resumo Executivo: 2 frases (impacto no negócio, próximo passo). Example Input: "Serviço X caiu às 03:12 com erro 503 no endpoint /api/pay." Example Output: Resumo Técnico: 1) Causa provável: Timeout no upstream. 2) Impacto técnico: Erros 503 em pagamentos durante 3 min. 3) Ação imediata: Reiniciar serviço e monitorizar logs. Resumo Executivo: O serviço de pagamentos esteve indisponível por ~3 minutos, afetando transações. A equipa reiniciou o serviço e monitoriza para evitar recorrência.
Step 4: Connect data sources (optional) and transform inputs
If you want to process files, set up an integration that allows uploading CSV/JSON or copy/pasting text. Normalize the text before sending (remove irrelevant lines, combine timestamp + message).
# Exemplo simples de transformação em Python para preparar uma linha def preparar_texto(timestamp, origem, mensagem): return f"[{timestamp}] {origem}: {mensagem}"
# Usar isto para gerar cada 'input' a enviar ao Copilot agent
Step 5: Test prompts and adjust temperature
Send some examples through the agent test interface. If outputs are too verbose or creative, lower the temperature or instruct the model to be concise. If technical detail is lacking, add required fields in the prompts or more examples.
# Parâmetros típicos a ajustar temperature = 0.2 # respostas mais determinísticas max_tokens = 300 # limitar tamanho do resumo
Step 6: Create output templates and validate format
Define an output template to facilitate reading and integration with ticketing tools (e.g., simple JSON). This makes it easier to automate ingestion of the summaries.
Saída JSON sugerida: {
"id": 1,
"resumo_tecnico": {
"causa": "...",
"impacto_tecnico": "...",
"acao_imediata": "..."
},
"resumo_executivo": "..."
}
# Peça ao agent para responder neste formato.
Step 7: Integrate with workflow (tickets, email)
After validation, configure an action that sends the JSON to the ticket queue or as an email draft. Use Power Automate or a simple webhook to receive the agent output and create a ticket in the internal system.
# Pseudocódigo de integração webhook POST /webhook/tickets Body: {"incident_id":123, "summary_json":{...} }
Verify the result
To confirm it is good: process 10 test incidents and compare the summaries with what a person wrote. Check consistency (same fields), technical accuracy and conciseness of the executive summary. Fix prompts where data is missing or factual errors appear.
Conclusion
You now have an assistant in Microsoft Copilot to generate technical and executive incident summaries, ready to integrate into workflows. Next steps: automate log ingestion, add human validation and quality metrics. Tip: start with few examples and iterate the prompts with common errors you find (false causes, excessive detail).