Building Product Copilots: Engineering Challenges and Best Practices

various · Tech · 2023 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.5 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production engineering for AI product copilots

The study examines how software engineers integrate LLM-powered copilots into products when normal software practices do not fit non-deterministic prompts, model orchestration, testing, safety, telemetry, compliance, and rapidly changing tooling.

Constraints:

Architecture

The paper is an empirical study rather than a single product implementation. It defines product copilots as systems that translate user actions into prompts for an LLM and transform model outputs into user-facing interactions. Across interviewed teams, the common architecture includes prompt assets and templates, orchestration for intent detection and skill routing, model calls, output wrangling into formats such as JSON or product actions, safety/privacy/compliance filters, telemetry, benchmarks, and release gates. The paper's proposed tooling opportunities include prompt linters, tracing and optimization, LLM-assisted prompt writing, automated benchmark creation, cost alerting, and unified development environments.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  user-interaction-surface["User interaction surface"] --> prompt-assembly-layer["Prompt assembly layer"]
  prompt-asset-store["Prompt asset store"] --> prompt-assembly-layer
  prompt-assembly-layer --> intent-router["Intent router"]
  intent-router --> skill-orchestrator["Skill orchestrator"]
  skill-orchestrator --> llm-endpoint["LLM endpoint"]
  llm-endpoint --> output-wrangler["Output wrangler"]
  output-wrangler --> safety-and-compliance-layer["Safety and compliance layer"]
  output-wrangler --> product-action-layer["Product action layer"]
  product-action-layer --> telemetry-layer["Telemetry layer"]
  safety-and-compliance-layer --> telemetry-layer
  telemetry-layer --> benchmark-and-evaluation-harness["Benchmark and evaluation harness"]
  benchmark-and-evaluation-harness --> release-gate["Release gate"]
  benchmark-and-evaluation-harness --> prompt-quality-tooling["Prompt quality tooling"]
  prompt-quality-tooling --> prompt-asset-store
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
User interaction surface Product UI or workflow where users ask natural-language questions or issue actions. Prompt assembly layer
Prompt assembly layer Templates, fragments, examples, and context that are dynamically assembled for the LLM. Intent router, Prompt asset store
Prompt asset store Version-controlled library of prompts, templates, examples, and fragments. Prompt assembly layer, Prompt quality tooling
Intent router Determines user intent and routes to skills such as test generation or documentation generation. Skill orchestrator
Skill orchestrator Coordinates product-specific capabilities, agent flows, and multi-turn workflows around model calls. LLM endpoint, Output wrangler, Safety and compliance layer
LLM endpoint Model service used by the copilot to generate natural-language or structured outputs. Output wrangler
Output wrangler Parses, validates, reformats, and applies model output to product interactions or actions. Safety and compliance layer, Product action layer
Product action layer Product-specific actions or UI responses produced after model output interpretation. Telemetry layer
Safety and compliance layer Responsible AI, privacy, content filtering, blocklists, and compliance review controls. Telemetry layer, Benchmark and evaluation harness
Telemetry layer Observability over user interactions, skill use, cost, and model behavior, constrained by privacy requirements. Benchmark and evaluation harness
Benchmark and evaluation harness Manually or automatically created datasets, flaky-test mitigation, grading, and benchmark runs. Prompt quality tooling, Release gate
Prompt quality tooling Proposed prompt linters, tracing, optimization, and LLM-assisted prompt writing tools. Prompt asset store
Release gate Shipping decision that combines benchmarks, safety review, responsible AI assessment, and cost constraints. —

Data flow

User actions or natural-language requests enter a product copilot. The system maps the request into prompts, assembles prompt assets and context, routes the intent to a skill or workflow, calls an LLM, parses or transforms the output into a product action or response, and then subjects the result to validation, safety/privacy controls, telemetry, and evaluation. Feedback and benchmark data loop back into prompt changes, test suites, and tool improvements.

5 supporting quotes
“product copilots enable users to ask questions in natural language and receive relevant responses that are specific to the user's context”article, stated
“The term "copilot" in this context refers broadly to any software system that translates user actions into prompts for an LLM”summary, stated
“refers broadly to any software system that translates user actions into prompts for an LLM and transforms the outputs into suitable formats for user interaction. Examples include GitHub Copilot for code generation, Windows Copilot for OS interactions, and Microsoft 365 Copilot for”summary, stated
“Systems needed to first determine user intent from natural language inputs and then route to appropriate "skills"”summary, stated
“After receiving model responses, additional processing was needed to interpret and apply the results appropriately”summary, stated

Why this architecture

The study shows that production copilots need explicit engineering layers around the LLM because prompts, raw outputs, and ad hoc playground workflows do not provide enough reliability. Intent routing, output wrangling, safety review, telemetry, and benchmark loops are needed because copilots act inside products and because non-deterministic model behavior strains standard software engineering practices.

4 supporting quotes
“software engineering processes and tools have not caught up with the challenges and scale involved with building AI-powered applications”article, stated
“pain points at every step of the engineering process and the challenges that strained existing development practices”article, stated
“Production copilots require sophisticated orchestration beyond simple single-turn interactions: Intent Detection and Routing: Systems needed to first determine user intent from natural language inputs and then route to appropriate "skills" (like adding tests”summary, stated
“Traditional unit testing approaches broke down because each model response could differ. One participant described running "each test 10 times" and only considering it passed if 7 of 10 instances succeeded. Engineers maintained manually curated spreadsheets”summary, stated

Models used: Large Language Models · GPT-4 · Internally hosted OpenAI models · Managed endpoint models

Scale

Alternatives considered (roads not taken)

Ad hoc playground-based prompt engineering.

Rejected because: Engineers described this as time-consuming trial and error without structured guidance or integrated tooling.

3 supporting quotes
“as "more of an art than a science." Several key challenges emerged: Trial and Error Nature: Engineers started in ad hoc environments like OpenAI's playground, bouncing between different tools based on availability. The process was described as "stumbling around" and "playing around”summary, stated
“The process was described as "stumbling around" and "playing around with prompts" without structured guidance. As one participant noted, "Experimenting is the most time-consuming if you don't have the right tools." Output Wrangling: Getting consistent,”summary, stated
“"Experimenting is the most time-consuming if you don't have the right tools." Output Wrangling: Getting consistent, machine-readable output proved extremely difficult. Engineers attempted various tactics like providing JSON schemas for responses, but”summary, stated

Forcing rigid output formats regardless of model tendencies.

Rejected because: The study found that models often malformed requested formats and that working with natural output tendencies could perform better.

3 supporting quotes
“you don't have the right tools." Output Wrangling: Getting consistent, machine-readable output proved extremely difficult. Engineers attempted various tactics like providing JSON schemas for responses, but discovered "a million ways you can effect it." The models would sometimes generate”summary, stated
“The models would sometimes generate malformed outputs, hallucinate stop tokens, or produce inconsistent formatting”summary, stated
“working with the model's natural output tendencies (like ASCII tree representations for file structures) yielded better results”summary, stated

Exact-output unit tests for non-deterministic copilots.

Rejected because: Model outputs vary, so teams used repeated runs, acceptable-output sets, metamorphic tests, or graded evaluations instead.

3 supporting quotes
“Traditional unit testing approaches broke down because each model response could differ. One participant described running "each test 10 times" and only considering it passed if 7 of 10 instances succeeded. Engineers maintained manually curated spreadsheets”summary, stated
“Engineers maintained manually curated spreadsheets with hundreds of input/output examples, with multiple acceptable outputs per input. Some teams adopted metamorphic testing approaches focusing on structural properties rather than exact content. Benchmark”summary, stated
“Some teams adopted metamorphic testing approaches focusing on structural properties rather than exact content. Benchmark Creation: No standardized benchmarks existed, forcing each team to create their own. Building manually labeled datasets was described as”summary, stated

Open-ended product action access from natural language.

Rejected because: Users expected broad commanding, but safety concerns and engineering effort limited what copilots could safely execute.

“Engineers noted significant gaps between user expectations and actual copilot capabilities. Users expected copilots to perform any available product action, but considerable engineering effort and safety concerns limited open-ended access. Agent-Based Approaches: Some teams explored”summary, stated
“copilots to perform any available product action, but considerable engineering effort and safety concerns limited open-ended access. Agent-Based Approaches: Some teams explored agent-based architectures for more complex workflows and multi-turn interactions. While more powerful, these approaches”summary, stated

Using LangChain-style frameworks directly for production.

Rejected because: Participants found such frameworks useful for prototypes but often avoided them in products due to learning curve and customer-problem focus.

3 supporting quotes
“Experience and Tooling Gaps Tool Selection: While libraries like LangChain offered "basic building blocks and most rich ecosystem" with "clear-cut examples," they were primarily useful for prototypes. Most participants did not adopt LangChain for actual products, citing the learning curve and”summary, stated
“LangChain offered "basic building blocks and most rich ecosystem" with "clear-cut examples," they were primarily useful for prototypes. Most participants did not adopt LangChain for actual products, citing the learning curve and preference for focusing on”summary, stated
“most rich ecosystem" with "clear-cut examples," they were primarily useful for prototypes. Most participants did not adopt LangChain for actual products, citing the learning curve and preference for focusing on customer problems. Integration Challenges: Getting frameworks”summary, stated

Patterns

prompt-versioning (prompt_ops)

Teams kept growing prompt libraries in version control, but lacked systematic performance tracking for changes.

3 supporting quotes
“Prompts evolved into complex libraries of templates, examples, and fragments”summary, stated
“While engineers kept these assets in version control, there was no systematic approach to tracking performance over time or validating the impact of changes.”summary, stated
“there was no systematic approach to tracking performance over time or validating the impact of changes”summary, stated

tool-use-orchestration (agent_architecture)

Product copilots use intent detection and skill routing to connect user requests to product capabilities.

“Systems needed to first determine user intent from natural language inputs and then route to appropriate "skills"”summary, stated
“After receiving model responses, additional processing was needed to interpret and apply the results appropriately”summary, stated

eval-driven-development (evaluation)

Teams used repeated tests, spreadsheets, manually labeled examples, benchmarks, grades, and structural tests to cope with non-deterministic output.

3 supporting quotes
“running "each test 10 times" and only considering it passed if 7 of 10 instances succeeded”summary, stated
“Engineers maintained manually curated spreadsheets with hundreds of input/output examples”summary, stated
“Teams resorted to simple grading schemes (A, B, C, etc.) with averaging to mitigate biases, but lacked established guidelines.”summary, stated

safety-policy-enforcement (safety)

Teams layered rule-based classifiers, blocklists, privacy checks, and responsible AI assessments around managed model endpoints.

3 supporting quotes
“Content filtering on managed endpoints was sometimes insufficient”summary, stated
“requiring additional rule-based classifiers and manual blocklists”summary, stated
“Responsible AI Assessments: These reviews were significantly more intensive than traditional security or privacy reviews”summary, stated

observability-tracing (operations)

The study identifies visibility into agent behavior and telemetry as a tooling gap, complicated by privacy limits on logging prompts.

3 supporting quotes
“Telemetry Limitations: A catch-22 situation emerged where telemetry was needed to understand user interactions”summary, stated
“A catch-22 situation emerged where telemetry was needed to understand user interactions, but privacy constraints prevented logging user prompts.”summary, stated
“The study proposes opportunities for improved tooling including prompt linters, automated benchmark creation, better visibility into agent behavior, and more unified development workflows.”summary, stated

cost-aware-routing (operations)

Benchmarking and prompt changes need cost awareness because repeated LLM endpoint tests can add up and affect production endpoints.

3 supporting quotes
“Running benchmarks through LLM endpoints introduced significant costs”summary, stated
“Running benchmarks through LLM endpoints introduced significant costs ("each test would probably cost 1-2 cents to run, but once you end up with a lot of them, that will start adding up").”summary, stated
“Cost Alerting: Mechanisms to warn of drastic cost changes from prompt modifications”summary, stated

structured-output-contract (output_control)

Teams tried JSON schemas and output wrangling to get machine-readable results, but the study shows this remains brittle without tooling.

3 supporting quotes
“Getting consistent, machine-readable output proved extremely difficult”summary, stated
“Engineers attempted various tactics like providing JSON schemas for responses”summary, stated
“The models would sometimes generate malformed outputs, hallucinate stop tokens, or produce inconsistent formatting”summary, stated

context-compaction (context_management)

Teams struggled to select and truncate context while understanding how each prompt component affected performance.

3 supporting quotes
“Engineers struggled with providing appropriate context while staying within token limits”summary, stated
“"distilling a really large dataset" and "selectively truncating" conversation history”summary, stated
“Testing the impact of different prompt components on overall performance proved particularly difficult”summary, stated

Tradeoffs

Treat prompt engineering as a managed software artifact.

Chose Prompt assets, version control, linters, tracing, and benchmark feedback over Ad hoc playground experimentation.

Rationale: Prompt libraries grew complex enough that teams needed ways to validate and track changes over time.

3 supporting quotes
“Prompts evolved into complex libraries of templates, examples, and fragments”summary, stated
“While engineers kept these assets in version control, there was no systematic approach to tracking performance over time or validating the impact of changes.”summary, stated
“Prompt Tracing and Optimization: Techniques inspired by delta-debugging”summary, stated

Route copilots through skills and orchestration.

Chose Intent detection, skill routing, and post-response processing over Single-turn LLM calls directly attached to product UI.

Rationale: Production product copilots have to interpret intent, choose capabilities, and transform outputs into product-specific behavior.

3 supporting quotes
“Production copilots require sophisticated orchestration beyond simple single-turn interactions”summary, stated
“route to appropriate "skills" (like adding tests or generating documentation)”summary, stated
“additional processing was needed to interpret and apply the results appropriately”summary, stated

Use property, repeated-run, and graded evaluation methods.

Chose Probabilistic and structural testing over Deterministic exact-match unit tests only.

Rationale: Non-deterministic model outputs require evaluation methods that account for acceptable variation.

3 supporting quotes
“running "each test 10 times" and only considering it passed if 7 of 10 instances succeeded”summary, stated
“metamorphic testing approaches focusing on structural properties rather than exact content”summary, stated
“Teams resorted to simple grading schemes (A, B, C, etc.) with averaging to mitigate biases, but lacked established guidelines.”summary, stated

Add safety and compliance layers beyond managed endpoint filters.

Chose Rule-based classifiers, blocklists, privacy processing, and responsible AI assessments over Relying only on model endpoint safety filters.

Rationale: Managed filters were insufficient for product-specific harms, privacy, and compliance requirements.

3 supporting quotes
“"Windows runs in nuclear power plants." Content filtering on managed endpoints was sometimes insufficient, requiring additional rule-based classifiers and manual blocklists.”summary, stated
“Processing was needed to ensure outputs didn't contain identifiable information”summary, stated
“Responsible AI Assessments: These reviews were significantly more intensive”summary, stated

Limit telemetry to privacy-compliant signals.

Chose Skill-use and aggregate behavior visibility over Logging raw user prompts.

Rationale: Privacy constraints blocked raw prompt logging, even though teams needed more observability to understand interactions.

3 supporting quotes
“A catch-22 situation emerged where telemetry was needed to understand user interactions, but privacy constraints prevented logging user prompts.”summary, stated
“A catch-22 situation emerged where telemetry was needed to understand user interactions, but privacy constraints prevented logging user prompts.”summary, stated
“Teams could see what skills were used but not what users actually asked”summary, stated

Gotchas (what bit them)

Prompt engineering behaved more like ad hoc experimentation than normal software engineering.

Root cause: Engineers lacked structured tools and guidance, so they moved between playgrounds and prompt experiments by trial and error.

Resolution: The paper proposes prompt linters, prompt tracing/optimization, and LLM-assisted prompt writing to make prompt work more systematic.

3 supporting quotes
“prompt engineering was fundamentally different from typical software engineering processes”summary, stated
“## Prompt Engineering Challenges The study found that prompt engineering was fundamentally different from typical software engineering processes, with participants describing it as "more of an art than a science.”summary, stated
“Prompt Linters: Automated validation against team-defined best practices”summary, stated

Machine-readable output contracts were brittle.

Root cause: Models could produce malformed output, hallucinate stop tokens, or vary formatting despite schema instructions.

Resolution: Use output wrangling and prefer formats aligned with the model's natural tendencies where possible.

3 supporting quotes
“Getting consistent, machine-readable output proved extremely difficult”summary, stated
“The models would sometimes generate malformed outputs, hallucinate stop tokens, or produce inconsistent formatting”summary, stated
“working with the model's natural output tendencies (like ASCII tree representations for file structures) yielded better results”summary, stated

Agentic workflows were hard to manage and steer.

Root cause: Models could fail to recognize completion, get stuck in loops, or go far off track during multi-turn work.

Resolution: Treat agent orchestration as a separate engineering concern with visibility, routing, and guardrails rather than simple prompt chaining.

3 supporting quotes
“Agent-Based Approaches: Some teams explored agent-based architectures for more complex workflows and multi-turn interactions”summary, stated
“these approaches were described as having behaviors that are "really hard to manage and steer."”summary, stated
“Models struggled with recognizing task completion and often got "stuck in loops or went really far off track."”summary, stated

Flaky tests made conventional test pass/fail logic unreliable.

Root cause: Each model response can differ, so an exact assertion can fail for reasons unrelated to product quality.

Resolution: Use repeated runs, multiple acceptable outputs, metamorphic properties, grading schemes, and benchmark datasets.

3 supporting quotes
“Flaky Tests Everywhere: Traditional unit testing approaches broke down because each model response could differ.”summary, stated
“Traditional unit testing approaches broke down because each model response could differ”summary, stated
“Teams resorted to simple grading schemes (A, B, C, etc.) with averaging to mitigate biases, but lacked established guidelines.”summary, stated

Benchmark creation was expensive and labor-intensive.

Root cause: No standardized benchmarks existed, so each team had to curate or label its own datasets.

Resolution: The paper proposes automated benchmark creation, including converting user feedback into benchmarks.

3 supporting quotes
“No standardized benchmarks existed, forcing each team to create their own”summary, stated
“"mind-numbingly boring and time-consuming," often requiring outsourcing”summary, stated
“Automated Benchmark Creation: Systems to capture and convert user feedback into benchmarks”summary, stated

Privacy constraints limited telemetry exactly where teams needed visibility.

Root cause: Teams needed to understand user interactions but could not log prompts because of privacy and compliance restrictions.

Resolution: Log safer interaction metadata such as skill use, while developing privacy-aware observability patterns.

3 supporting quotes
“A catch-22 situation emerged where telemetry was needed to understand user interactions, but privacy constraints prevented logging user prompts.”summary, stated
“A catch-22 situation emerged where telemetry was needed to understand user interactions, but privacy constraints prevented logging user prompts.”summary, stated
“Teams could see what skills were used but not what users actually asked”summary, stated

Evaluation

The paper itself uses mixed methods: semi-structured interviews plus structured brainstorming with 26 engineers. The copilots studied used repeated-run tests, curated input/output spreadsheets, multiple acceptable outputs, metamorphic tests, manually labeled benchmarks, external labeling, simple grading schemes, and responsible AI benchmark suites.

Metrics: 26 interviewed professional engineers · 14 internal Microsoft participants and 12 external participants · 45-minute semi-structured interviews · Repeated test success such as 7 of 10 runs · Hundreds of curated input/output examples · Approximately 10,000 externally labeled responses in one team · Per-test LLM cost of roughly 1-2 cents · Hundreds of harm subcategories for one responsible AI benchmark

5 supporting quotes
“we present the findings of an interview study with 26 professional software engineers”article, stated
“The study combined semi-structured interviews (45 minutes each) with structured brainstorming sessions”summary, stated
“running "each test 10 times" and only considering it passed if 7 of 10 instances succeeded”summary, stated
“One team labeled approximately 10,000 responses externally. Cost and Resource Constraints: Running benchmarks through LLM endpoints introduced significant costs ("each test would probably cost 1-2 cents to run, but once you end up with a lot of them, that will start adding up").”summary, stated
“automated benchmarks covering hundreds of subcategories of potential harm before shipping”summary, stated

Outcomes

The study covers 26 engineers, 14 internal and 12 external, through 45-minute interviews and brainstorming. Operational scale signals include hundreds of curated examples, 10 repeated test runs with a 7-of-10 passing rule, about 10,000 externally labeled responses for one team, 1-2 cents per benchmark test, multiple weeks of responsible AI documentation, and hundreds of harm subcategories in one benchmark.

5 supporting quotes
“From our interviews, we found pain points at every step of the engineering process”article, stated
“Output Wrangling: Getting consistent, machine-readable output proved extremely difficult”summary, stated
“Flaky Tests Everywhere: Traditional unit testing approaches broke down because each model response could differ.”summary, stated
“Prompt Linters: Automated validation against team-defined best practices”summary, stated
“Unified Development Environments: "One-stop shop" solutions with templates for common applications”summary, stated