Large-Scale AI Assistant Deployment with Safety-First Evaluation Approach

discord · Tech · 2023 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (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: Consumer-scale AI assistant safety and evaluation

Discord needed to ship Clyde AI, an agentic RAG chatbot, to a massive consumer audience while preventing safety, legal, policy, and abuse failures from surfacing in production. At Discord scale, rare failures become common enough to matter, so the central problem was measuring and mitigating risk before launch while keeping evaluations usable by product engineers.

Constraints:

Architecture

Discord built Clyde AI as an agentic RAG chatbot and wrapped it in a safety-first evaluation workflow. The team treated evals like unit tests: fast, local, deterministic checks for individual components such as moderation, tool triggering, retrieval summarization, and end-to-end behavior. Promptfoo provided local declarative evaluation and red-teaming workflows, while Datadog carried LLM observability metrics alongside product metrics. Safety assessment included predeployment risk views, harmful-input tests, application-specific jailbreak generation with attacker and judge LLMs, and coverage for PII leaks, hallucination, hijacking, and political opinions. Configuration and prompts were managed with Git and Retool, and lower-powered models were occasionally steered back on track by injecting GPT-4 responses in long conversations.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  clyde["Clyde AI chatbot"] --> evals["Component eval suites"]
  evals --> promptfoo["Promptfoo CLI"]
  evals --> pr["Pull request workflow"]
  clyde --> obs["Runtime observability"]
  obs --> online["Model-graded online evals"]
  clyde --> config["Prompt and configuration store"]
  promptfoo --> risk["Risk assessment view"]
  risk --> redteam["Adversarial red-team loop"]
  redteam --> promptfoo
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Clyde AI chatbot Discord-scale AI assistant combining chat behavior, agent behavior, and RAG. Component eval suites, Prompt and configuration store, Runtime observability
Component eval suites Fast targeted tests for moderation, tool usage, retrieval triggering, summarization, and end-to-end behavior. Clyde AI chatbot, Promptfoo CLI, Pull request workflow
Promptfoo CLI Local declarative evaluation and red-teaming tool used by developers. Component eval suites, Risk assessment view, Adversarial red-team loop
Pull request workflow Development process where every PR includes an eval link or CI/CD-integrated evaluation. Component eval suites
Runtime observability Datadog-based tracking for LLM and product metrics, including some online production evals. Clyde AI chatbot, Model-graded online evals
Model-graded online evals Simple in-house one-shot model-graded evaluations feeding production signals into observability. Runtime observability
Prompt and configuration store Git-backed prompt versioning plus Retool configuration toggles for nontechnical team members. Clyde AI chatbot
Risk assessment view Predeployment promptfoo view that breaks down risk categories such as brand, legal, and harmful content. Promptfoo CLI, Adversarial red-team loop
Adversarial red-team loop Attacker LLM generates adversarial inputs while judge LLM guides rewording to expose safeguard weaknesses. Risk assessment view, Promptfoo CLI

Data flow

A Clyde interaction flows through the assistant's agent/RAG path, where components such as moderation, tool use, retrieval triggering, and summarization are evaluated separately. Developers run local promptfoo eval suites from declarative configs and attach eval evidence to pull requests or CI/CD. Production and online eval metrics flow into Datadog. For safety, promptfoo risk views and red-team loops generate or mutate adversarial inputs before launch, while public dogfooding/social-media examples feed new eval cases when privacy blocks direct production-data reuse.

4 supporting quotes
“this agent um and rag called Clyde AI uh which was basically a chatbot that launched to over 200 million users on Discord”transcript, stated
“figure out the specific parts of your system so in this case in this architecture you know we might have an evalve for moderation specifically or each of the specific tool usages”transcript, stated
“if we're doing web search um with uh retrieval and then Generation Um the way that I would split this up is I'd have a test Suite that tests just the triggering”transcript, stated
“we wound up building an open source project called promp Fu it's a CLI uh that does evals it runs completely locally”transcript, stated

Why this architecture

Discord chose a developer-first evaluation architecture because safety risk, not model capability, was the repeat launch blocker. Unit-test-like evals were understandable, local, deterministic, and cheap enough to run frequently, while predeployment red teaming reduced the chance that vulnerabilities would first appear at 200-million-user scale. Existing observability and simple Git/Retool configuration kept the system operationally familiar.

4 supporting quotes
“the biggest repeat launch blockers were security legal safety uh and sometimes policy”transcript, stated
“the way to think about this is to treat them as as unit tests”transcript, stated
“fast uh tiny evals that are ideally deterministic”transcript, stated
“My Philosophy here is that the best observability tool is the one that you're using already”transcript, stated

Models used: Clyde AI · RAG chatbot · GPT-4 · GPT-3.5 · Llama · attacker LLM · judge LLM · model-graded evals

Scale

Alternatives considered (roads not taken)

Complex LLM graders or classifiers for every behavior check

Rejected because: Discord found simple deterministic checks could capture most of the desired signal with much less effort.

“you may say to yourself oh well you know that sounds like something that I need an LM grader for maybe I'll have a model for it”transcript, stated
“what worked well for us is just you know checking that the the output begins with a lowercase letter”transcript, stated

Large end-to-end evals as the main testing strategy

Rejected because: The team preferred small component-level evals and only one broad end-to-end eval where needed.

“most of the EV vals are for specific steps in um what the system is doing so break it down into really small pieces”transcript, stated

Live databases or live web search in every eval

Rejected because: For retrieval-generation testing, the speaker recommends static context to isolate summarization from triggering and external-system variation.

“what I'm not doing is I'm not hooking it up to like my live database I'm not hooking it up to to live web searches or whatever”transcript, stated
“I'm just testing the ability to correctly summarize web pages”transcript, stated

Specialized LLM observability platform

Rejected because: Discord used Datadog because it was already in the product monitoring stack and could accept the relevant metrics.

“at Discord we used a um super secret uh stealth AI startup called Data Dog for our observability uh for for llm observability”transcript, stated
“the best observability tool is the one that you're using already”transcript, stated

Close the eval feedback loop directly with live production data

Rejected because: Privacy constraints prevented Discord from incorporating live production data into eval datasets.

“for privacy reasons and Etc we were never really able to um to close that Loop”transcript, stated

Patterns

eval-driven-development (evaluation)

Discord made evals part of normal development hygiene, expecting each PR to include an eval and preferring local unit-test-style checks.

“every PR got an eval uh in in the most basic sense you can just paste a link to the eval um in the pr”transcript, stated
“if you truly internalize the fact that evals are just tests that means a couple things it means that they should run locally”transcript, stated

safety-policy-enforcement (safety)

The launch process focused on quantifying and mitigating security, legal, safety, policy, and harmful-content risk before production.

“the biggest repeat launch blockers were security legal safety uh and sometimes policy”transcript, stated
“how do we quantify this risk ahead of time so we can get these stakeholders uh comfortable with with what we were doing”transcript, stated

guardrails-io-filtering (safety)

Discord used predeployment risk assessment, harmful-input testing, and application-specific jailbreak testing to expose safeguard failures.

“there's kind of the the predeployment side so you know how are you going to do your risk assessment um how are you going to do red teing”transcript, stated
“when you sprinkle your prompts and all your stuff on top of the base model you introduce new vectors for uh for jailbreaks”transcript, stated

observability-tracing (operations)

LLM metrics and online production evals were fed into Datadog alongside other product metrics.

“take the metrics that we cared about put it into Data dog so it was with all the other data that we are measuring for our product”transcript, stated
“we did do some like online production evals um uh some of which were were Model graded”transcript, stated

prompt-versioning (configuration)

Discord used Git as the source of truth for prompt versioning and Retool for configuration toggles.

“we used G as a source of Truth for for versioning um and we used retool for configuration”transcript, stated

rag-retrieval (retrieval)

Clyde is described as an agent and RAG chatbot, and the evaluation strategy includes splitting retrieval triggering from static-context summarization.

“this agent um and rag called Clyde AI uh which was basically a chatbot”transcript, stated
“if we're doing web search um with uh retrieval and then Generation Um the way that I would split this up is I'd have a test Suite that tests just the triggering”transcript, stated

Tradeoffs

How sophisticated eval metrics should be

Chose Simple deterministic component evals over Fancy LLM graders and complex metrics for every behavior.

Rationale: Simple checks were understandable, fast, local, and got enough signal to support high-frequency developer use.

“I really would try to caution people against like over the toop fancy eval Solutions special products cloud-based etc etc keep it simple”transcript, stated
“you shouldn't have any trouble understanding the metrics that you're selecting for evals so this is why I'm a big fan of basic deterministic metrics”transcript, stated

How to test RAG or web-search behavior

Chose Separate triggering tests from static-context summarization tests over End-to-end live retrieval tests for every eval run.

Rationale: Splitting the tests isolates decisions and avoids live database or live web-search instability.

“I'd have a test Suite that tests just the triggering so does how does the agent decide when to use the tool”transcript, stated
“separately I'll have a test Suite that uh tests uh on on static context”transcript, stated

Which observability stack to use

Chose Datadog and in-house simple online evals over A specialized LLM observability platform.

Rationale: The team could put LLM metrics into the observability tool already used for product metrics.

“the best observability tool is the one that you're using already”transcript, stated
“we wound up implementing these ourselves because it was it was pretty simple U most of these were just like one shot”transcript, stated

Where to focus safety effort

Chose Predeployment risk assessment and red teaming over Relying mainly on live filtering after launch.

Rationale: The speaker says commercial attention skews toward filtering, but predeployment risk assessment was more important for Discord.

“there are two schools of thought for safeguarding LM apps um there's kind of the the predeployment side”transcript, stated
“I see more solutions out there for that but I actually think the leftand side is the most important”transcript, stated

Gotchas (what bit them)

Safety failures appear in production if they are not quantified before launch.

Root cause: Rare failures become frequent at Discord's 200-million-user scale, and users actively probe LLM weaknesses.

Resolution: Make risk measurement and mitigation a predeployment requirement with safety evals and red-team tooling.

“without a system in place uh you know you're going to discover most of these vulnerabilities and failures in production”transcript, stated
“if you have a one in a million uh sort of occurrence uh it will happen 200 times at at Discord scale”transcript, stated

Prompt bloat from fixing every discovered failure can produce negative returns.

Root cause: Teams are tempted to keep adding special cases to prompts after each eval failure.

Resolution: Remove prompt clutter and give the model room to do the reasonable thing.

“it was very tempting for us to try to prompt out all of the different failure modes um that came out of the evals”transcript, stated
“we ran into diminishing returns and then we hit kind of negative returns uh we realize that less is more”transcript, stated

Prompts do not transfer cleanly across model families.

Root cause: Teams calibrate prompts around GPT behavior, but Claude and Llama-style models need model-specific tuning.

Resolution: Treat prompts as vendor-specific artifacts and spend time re-tuning when switching models.

“prompts are actually a form of vendor lockin”transcript, stated
“you take your GPT prompt and you try test it out with CLA um that's that's not really going to cut it”transcript, stated

Lower-powered models can drift away from the system prompt in long conversations.

Root cause: Long chats caused models like Llama and GPT-3.5 to revert toward vanilla chat behavior.

Resolution: Discord experimented with occasional GPT-4 responses as bumpers to steer the conversation back on track.

“lower powerered models like like like llama and gbt 3.5 um kind of drifting from their system prompt over very long conversations”transcript, stated
“we would occasionally drop in a GPT 4 response um just literally randomly um which would kind of act as like a bowling alley bumper”transcript, stated

The ideal production-data feedback loop may be blocked by privacy.

Root cause: Live user data could not be freely incorporated back into evaluation datasets.

Resolution: Use dogfooding, public posts, and publicly visible failures or wins as substitute eval examples.

“for privacy reasons and Etc we were never really able to um to close that Loop”transcript, stated
“we used data from um from from dog fooding we uh Scout the internet like people tweeting”transcript, stated

Evaluation

Discord evaluated Clyde through local deterministic component tests, PR-level eval requirements, optional CI/CD integration, promptfoo red-team runs, risk-category views, online production evals in Datadog, and public/dogfood-derived regression examples.

Metrics: component-level moderation behavior · tool-triggering behavior · static-context summarization correctness · end-to-end assistant behavior · risk categories such as brand and legal risk · harmful-content refusal · PII leak checks · hallucination checks · prompt-hijacking checks · political-opinion checks

4 supporting quotes
“evals are just a way of systematically characterizing the behavior of a system given inputs um and and measuring the outputs”transcript, stated
“every PR got an eval uh in in the most basic sense you can just paste a link to the eval”transcript, stated
“we did do some like online production evals um uh some of which were were Model graded”transcript, stated
“there are a bunch of other failure modes so Pi leaks um of course hallucination hijacking”transcript, stated

Outcomes

The talk repeatedly anchors risk in Discord scale: 200 million users, one-in-a-million failures occurring about 200 times, and a developer workflow aiming for dozens of local eval runs per day.

5 supporting quotes
“launched to over 200 million users on Discord”transcript, stated
“if you have a one in a million uh sort of occurrence uh it will happen 200 times at at Discord scale”transcript, stated
“we wound up building an open source project called promp Fu it's a CLI uh that does evals”transcript, stated
“we ran into diminishing returns and then we hit kind of negative returns uh we realize that less is more”transcript, stated
“for privacy reasons and Etc we were never really able to um to close that Loop”transcript, stated