Agent-based workspaces. This section applies if your workspace organizes traces by agent and environment. To check, look at the control at the top left: it names your workspace. If it shows the LangSmith logo instead, and the sidebar has an Application section with an application picker, your workspace is project-based. Skip this section and read Tracing projects.
Project-based workspaces. This section applies if your workspace organizes traces by tracing project. To check, look at the control at the top left. In a project-based workspace, it shows the LangSmith logo, and the sidebar has an Application section with an application picker. If the control shows your workspace name instead, your workspace is agent-based. Skip this section and read Agents.
View evaluators
In the LangSmith UI, select Evaluators in the left sidebar to view all evaluators in your workspace. The evaluators table shows the following columns:Create an evaluator
You can create an evaluator in the LangSmith UI or programmatically with the SDK. Evaluators created either way are workspace-level resources that appear in the Evaluators table.Create an evaluator in the UI
- In the LangSmith UI, select Evaluators in the left sidebar.
- Click + Evaluator to open the new evaluator panel.
- The panel lets you:
- Create from scratch: Build a new LLM-as-a-Judge, Decision Model, or Code evaluator.
- Add a LangChain Tuned Evaluator: Attach a specialized judge managed by LangChain to a compatible tracing project without configuring a prompt, model, or API key.
- Create from a template: Start from a ready-made evaluator (also known as a prebuilt evaluator) for common evaluation patterns. A Recommended section lists popular templates first. The rest are grouped by category: Security, Safety, Quality, Conversation, Trajectory, Image Evaluations, and Voice Evaluation. For what each template scores, see Prebuilt evaluator templates.
Create an evaluator with the SDK
Use the LangSmith SDK to create evaluators programmatically. The SDK is available for Python and TypeScript. Evaluators created through the SDK appear in the Evaluators table alongside those created in the UI. The SDK does not support decision model evaluators yet. To create one, use the UI.Managing evaluators through the SDK requires
langsmith>=0.9.8 (Python, PyPI) or langsmith>=0.7.16 (TypeScript, npm).Prebuilt evaluator templates
Prebuilt evaluator templates are ready-made evaluators for common checks, such as hallucination, prompt injection, and task completion. Each template is a starting point. You can edit its prompt and scoring schema before you save it to your workspace. Most templates are LLM-as-a-judge evaluators whose prompts come from the open-source openevals package. Two are exceptions: Assertions uses a prompt defined in LangSmith, and Exact Match is a code evaluator. Each LLM-as-a-judge template writes a score under its feedback key and acomment with the judge’s reasoning. Language and Support Intent return a label without a comment.
A true score does not always mean a pass. Templates that detect a problem return true when they find it: the Security and Safety templates, Hallucination, Perceived Error, the Image templates, and Audio Quality. The rest return true when the output passes. The Score column in each table states what true means.
Templates differ in the data they read:
- Whole threads: Conversation and Trajectory templates read every message in a thread. When you add one to a tracing project, LangSmith configures it as a thread-level evaluator. For more information, see Set up multi-turn online evaluators.
- Reference outputs: Correctness, Assertions, and Exact Match compare the output against a reference output, which comes from a dataset example.
- Plan: Plan Adherence reads a
planvariable in addition to the thread messages. - Attachments: Image and Voice templates read the run’s attachments. For more information, see Evaluate with attachments.
Security
Security templates detect leaks, injections, and adversarial inputs.Safety
Safety templates evaluate content safety and moderation.Quality
Quality templates measure output quality and accuracy.Conversation
Conversation templates evaluate conversational quality and user experience across a whole thread.Trajectory
Trajectory templates evaluate agent tool use and decision paths across a whole thread.Image Evaluations
Image templates evaluate image content quality and safety.Voice Evaluation
Voice templates evaluate voice and audio interaction quality.View evaluator details
Click any evaluator in the table to open its detail view. The detail view has four tabs:- Overview: The evaluator’s feedback configuration and prompt or code definition.
- Traces: Traces processed by this evaluator across all attached resources.
- Logs: Execution logs for this evaluator across all attached resources.
- Projects & Datasets (Environments & Datasets in an agent-based workspace): The tracing projects, agent environments, and datasets this evaluator is attached to, with each attachment’s weekly spend and limit.
Edit an evaluator
Open an evaluator. In the Overview tab, click the Edit evaluator icon to open the Configure Evaluator panel. Update the evaluator’s configuration. Click Save. Because the evaluator is shared, changes apply across every trace container and dataset it is attached to.Manage evaluator trace retention
When an online evaluator scores a trace, it attaches feedback to the trace. This can auto-upgrade the trace to extended retention, depending on the evaluator’s retention setting. When you set up an online evaluator on a tracing project, or on an agent environment, you can opt out of this upgrade so that scored traces stay at the base retention. This control is available only when the project’s default retention is the base tier. If the project defaults to extended retention (set at the project or workspace level), traces scored by the evaluator follow that default and the option is locked. To opt out of extending retention for scored traces:- When you create or edit an online evaluator, set the source to a tracing project or an agent environment, rather than a dataset.
- Expand the Advanced section in the evaluator configuration panel.
- Clear Extend trace retention.
Include extended stats
Use Include extended stats (feedback, costs, tokens) in a run-level evaluator to evaluate feedback statistics, token usage, or cost data from the run. Thefeedback_stats field contains feedback statistics, including the number and average for each feedback key. This option is not available for multi-turn (thread-level) evaluators.
LangSmith fetches additional data for evaluators with this option enabled. Enable it only when your evaluation logic or prompt requires these fields.
To include extended stats:
- When you create or edit a run-level evaluator, expand the Advanced section in the evaluator configuration panel.
- Select Include extended stats (feedback, costs, tokens).
Access extended stats
Code evaluators receive these fields in therun object, including feedback_stats, total_tokens, and total_cost. They also receive individual feedback records in run["feedback"], regardless of whether you enable extended stats. For LLM-as-a-judge evaluators, map the corresponding run.* field to a prompt variable. For example, map {{correctness_average}} to run.feedback_stats.correctness.avg to include a correctness feedback average in the prompt. The available run.* fields also include prompt and completion token, cost, and detail fields. For the full run data schema, see Run data format.
Chain evaluators
A chained evaluator is an online evaluator that triggers only on runs another evaluator has already scored. Chaining lets you use a more specific evaluator or reserve a more expensive evaluator for the runs that need it. For example, you can run an LLM-as-a-judge evaluator only when an earliercorrectness score is below a threshold.
The second evaluator must be a run-level evaluator because multi-turn (thread-level) evaluators cannot filter on feedback. The first evaluator can be either type. A multi-turn evaluator attaches its feedback to the last run in the thread, so a second evaluator chained onto it evaluates that run, not the full thread.
To chain a second evaluator onto a first:
- Create or open the second evaluator and expand its filter. For more information, see Apply a filter to runs that trigger the evaluator for LLM-as-a-judge evaluators or Create a filter for code evaluators.
-
Filter on the first evaluator’s feedback key. The filter matches on the key rather than the evaluator that produced it, so feedback from any source with that key triggers the second evaluator, including user feedback. Use a key that only the first evaluator produces.
-
To trigger on every run the first evaluator scored, filter on the key alone:
-
To trigger only when the score meets a condition, combine the key with a
feedback_scorecomparison. For example, to trigger only whencorrectnessis below0.5:
-
To trigger on every run the first evaluator scored, filter on the key alone:
- If the second evaluator reads the first score, include extended stats. LLM-as-a-judge evaluators require it, and code evaluators use it to read the score reliably. For more information, see Read the first score.
- Save the evaluator.
Read the first score
How the second evaluator reads the first evaluator’s score depends on its type:- LLM-as-a-judge evaluators: Include extended stats, then map a prompt variable to
run.feedback_stats.<feedback_key>.avg. For example, map{{correctness_average}}torun.feedback_stats.correctness.avg. - Code evaluators: Read the feedback record in
run["feedback"]whosekeyis the first evaluator’s feedback key, and use itsscore.run["feedback"]holds at most 100 feedback records across each batch of runs the evaluator processes, and the oldest records are dropped first, so the score can be missing when the batch carries many feedback records. To read the score reliably, include extended stats and read the average fromrun["feedback_stats"]["<feedback_key>"]["avg"].
avg field averages every feedback record with that key on the run, so it equals the first evaluator’s score only when the run has one record with that key. Another record with the same key, such as user feedback, changes the average.
Delete an evaluator
You cannot delete an evaluator while it is attached to a trace container or dataset. To delete an evaluator:- In the LangSmith UI, select Evaluators in the left sidebar.
- Select the evaluator you want to delete.
- Open the Projects & Datasets tab (Environments & Datasets in an agent-based workspace). For each attachment listed there, select Detach in the Actions menu at the right of the row.
- Return to the Evaluators page and click Delete at the top of the page.
Connect these docs to your agent of choice via MCP for real-time answers.

