TruLens is an open-source system for tracing and evaluating LLM applications and AI agents. It records each step's inputs, outputs, latency, tokens, and cost, then uses evaluations to find failures and compare application versions.
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.
npx skills add truera/trulens --skill trulens-diagnosisgit clone --depth 1 https://github.com/truera/trulensWrote 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.
[](https://agentmods.dev/skills/truera/trulens/trulens-diagnosis)<a href="https://agentmods.dev/skills/truera/trulens/trulens-diagnosis"><img src="https://agentmods.dev/badge/skills/truera/trulens/trulens-diagnosis/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/truera/trulens/trulens-diagnosis"><img src="https://agentmods.dev/badge/skills/truera/trulens/trulens-diagnosis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00017 | $0.02239 |
| Opus 5 | $0.00009 | $0.01120 |
| Sonnet 5 | $0.00003 | $0.00448 |
| Haiku 4.5 | $0.00002 | $0.00224 |
Grade A, and why
trulens-diagnosis 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 11d 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.
How it starts
The opening of the file, as written. The whole thing — 295 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TruLens Diagnosis and Improvement
After running evaluations, use this skill to diagnose why scores are low and what to change — closing the loop from eval results to concrete fixes.
Prerequisites
Before diagnosing, ensure you have:
- Run evaluations with at least one feedback function (see
running-evaluationsskill) - Access to the session to retrieve records and feedback results
Instructions
Step 1: Triage — identify failing metrics and patterns
Pull records with feedback scores and filter to failing cases:
import pandas as pd
from trulens.core import TruSession
session = TruSession()
# Get all records with feedback columns
records_df, feedback_cols = session.get_records_and_feedback()
# Identify feedback functions present
print("Feedback functions:", list(feedback_cols))
# Filter to low-scoring records (score < 0.7)
FAIL_THRESHOLD = 0.7
failing = {}
for col in feedback_cols:
if col in records_df.columns:
low = records_df[records_df[col] < FAIL_THRESHOLD]
if not low.empty:
failing[col] = low
print(
f"\n{col}: {len(low)} failing records out of {len(records_df)}"
)
print(low[["input", "output", col]].head(5))
Look for patterns:
- Which feedback functions fail most often?
- Are failures clustered around specific queries or query types?
- Do failures correlate with specific app versions?
Step 2: Root cause analysis — trace failures to their span
For each failing metric, inspect the OTEL trace to find the problematic span:
import json
# Get the record_id of a failing record
failing_record_id = failing["Context Relevance"].iloc[0]["record_id"]
# Fetch the full trace for that record
records = session.get_records_and_feedback()[0]
record = records[records["record_id"] == failing_record_id].iloc[0]
# Inspect the raw trace JSON
trace = json.loads(record["record_json"])
print(json.dumps(trace, indent=2))
Use the dashboard to inspect individual span attributes:
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.
- 11d ago First seen · 295 lines · 17 tokens per session scan A c7e5e4259ddf
trulens-diagnosis is a skill published in the GitHub repository truera/trulens (3,545 stars, last pushed today), licensed MIT. It adds 17 tokens to every session and 2,239 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-08-30.
Other skills, from other repositories
ai-engineer
Builds production AI/ML systems — model training, fine-tuning, MLOps pipelines, model serving, evaluation frameworks, RAG optimization, and agent orchestration at scale. Use when the user asks to build, train, or deploy ML models, set up MLOps pipelines, optimize RAG systems, create inference endpoints, or design…
ai-engineering-toolkit
6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.
ai-engineering-toolkit
6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.
mcp-apps-builder
MANDATORY for ALL MCP server work - mcp-use framework best practices and patterns. READ THIS FIRST before any MCP server work, including: Creating new MCP servers Modifying existing MCP servers (adding/updating tools, resources, prompts, widgets) Debugging MCP server issues or errors Reviewing MCP server code for…
mem0-status
Diagnoses mem0 connectivity, API key validity, and memory read/write functionality. Use when memory operations fail, searches return empty, addmemory errors occur, or to verify the plugin is working correctly.
ai-engineering-toolkit
6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.