惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
博客园 - 司徒正美
A
About on SuperTechFans
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
F
Fortinet All Blogs
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
D
Docker
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Jina AI
Jina AI
H
Help Net Security
量子位
IT之家
IT之家

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
My agent worked yesterday. Today it's possessed.
Ansh Saxena · 2026-05-08 · via DEV Community

Ansh Saxena

Two weeks of clean runs. Same prompts, same repo, same results.

Then Tuesday happened.

The outputs were longer. Different variable names. Tool calls you'd never seen before. You asked the agent about it. It explained confidently. The explanation sounded plausible.

No stack trace. No error. No crash. Just behavior that used to be one thing and is now quietly something else.

This is the hardest failure to diagnose because you have nothing to point at. You have a feeling. A feeling is not a measurement.


Here's what five baseline sessions looked like:

Session 1: ~1,000 tokens | tools: [search, summarize]
Session 2: ~1,000 tokens | tools: [search, summarize]
Session 3: ~1,100 tokens | tools: [search, summarize]
Session 4:   ~950 tokens | tools: [search, summarize]
Session 5: ~1,050 tokens | tools: [search, summarize]

Enter fullscreen mode Exit fullscreen mode

Here's session 6:

Session 6: 50,000 tokens | tools: [fetch_url, parse_html, extract_entities, classify, store_results]

Enter fullscreen mode Exit fullscreen mode

Five new tools. 50x the tokens. Every metric off the chart.

Your print() logs said: output looks reasonable. Moving on.

OCW fired drift_detected the moment the session closed.


The DriftDetector builds a rolling baseline from prior sessions. When a new session's token counts exceed a Z-score of 2.0, or the tool sequence diverges past a Jaccard distance of 0.4 — it fires. No manual baseline to set up. No dashboard to configure. It learns from your agent's own history.

You find out in seconds. Not after a week of "huh, that seemed weird."


pip install tokenjam
tj demo hallucination-drift

Enter fullscreen mode Exit fullscreen mode

No API keys. Runs entirely in-process. Watch 5 normal sessions, then 1 anomalous one, then the alert.

Enable it for your real agent:

# tj.toml
[agents.my-agent.drift]
enabled            = true
baseline_sessions  = 10
token_threshold    = 2.0
tool_sequence_diff = 0.4

Enter fullscreen mode Exit fullscreen mode

Then tj drift shows Z-scores per session. tj alerts shows when the threshold was crossed.


The take that makes people mad: "LLMs are non-deterministic — you can't test them."

You're right. You can't test them the way you test functions. But you can measure them. You can build a baseline and alert when behavior leaves it.

Testing asks "is this correct?" Drift detection asks "is this different from how it's always behaved?" The second question is answerable. It just requires keeping score.

tj demo hallucination-drift — run it, see what keeping score looks like.


Part of the Agent Incident Library