langsmith_observability

langsmith_observability is a cursor rule for Cursor from yu-iskw/llmops-demo-ts. It costs 28 tokens per session (1,004 once invoked), scanned A, original, Apache-2.0.

A set of rules for recording and inspecting applications that use large language models with LangSmith. LangSmith is a service that records model calls, application steps, feedback, and related metadata.

In plain words
What is it for?
Use it to enable tracing, record model chains, attach feedback and metadata, and investigate non-deterministic model results.
Why use it?
It makes difficult-to-reproduce model behaviour easier to inspect and helps teams monitor and debug multi-step AI applications.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to enable tracing, record model chains, attach feedback and metadata, and investigate non-deterministic model results.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/yu-iskw/llmops-demo-ts/langsmith_observability
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/yu-iskw/llmops-demo-ts

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for langsmith_observability

README.md
[![agentmods](https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/langsmith_observability.svg)](https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/langsmith_observability)
Your own site
<a href="https://agentmods.dev/rules/yu-iskw/llmops-demo-ts/langsmith_observability"><img src="https://agentmods.dev/badge/rules/yu-iskw/llmops-demo-ts/langsmith_observability.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,004 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.01004
Opus 5 $0.00014 $0.00502
Sonnet 5 $0.00006 $0.00201
Haiku 4.5 $0.00003 $0.00100

Measured 3d ago against content hash 5257ddf543bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

langsmith_observability scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/langsmith_observability.mdc · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LLM Observability with LangSmith

This rule provides guidelines for setting up and utilizing LangSmith for LLM-native observability, which is crucial for debugging and monitoring non-deterministic LLM applications.

1. Environment Setup

To enable LangSmith tracing, set the following environment variables:

export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY=<your-api-key>
export LANGSMITH_PROJECT=<your-project-name>

Note: LANGSMITH_PROJECT is supported in JS SDK versions >= 0.2.16; otherwise, use LANGCHAIN_PROJECT.

2. Tracing LLM Calls and Chains

LangSmith allows you to trace individual LLM calls and entire application chains.

2.1 Basic Tracing with traceable

Wrap your functions or methods with traceable to automatically log their execution as LangSmith runs. This is applicable even if you are using @google/genai or other LLM providers.

import { traceable } from "langsmith/traceable";
import { GoogleGenAI } from '@google/genai';

// Initialize GoogleGenAI client (assuming environment variables are set)
const genAI = new GoogleGenAI();

const tracedGenerateContent = traceable(
  async function generateContentWithTracing(modelName: string, prompt: string) {
    const response = await genAI.models.generateContent({
      model: modelName,
      contents: [{ role: 'user', parts: [{ text: prompt }] }],
    });
    return response.text;
  },
  { run_type: "llm" } // Designate as an LLM run
);

// Example usage:
// await tracedGenerateContent('gemini-pro', 'What is the capital of France?');

2.2 Tracing with wrapOpenAI (for OpenAI SDK)

If you are using the OpenAI SDK, you can directly wrap the client:

import { OpenAI } from "openai";
import { wrapOpenAI } from "langsmith/wrappers";

const openAIClient = wrapOpenAI(new OpenAI());

// Use openAIClient as usual, and calls will be traced automatically.
// const response = await openAIClient.chat.completions.create({...});

3. Collecting Feedback

Read the full file on GitHub · 132 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 132 lines · 28 tokens per session scan A 5257ddf543bd

Subscribe to this mod's changes

langsmith_observability is a cursor rule published in the GitHub repository yu-iskw/llmops-demo-ts (6 stars, last pushed 6d ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,004 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.