Drift Monitor: 3.35B Supervisory Routing for Autonomous Agents

Drift Monitor (arXiv:2612.06122) fine-tunes a 3.35B open model (tiny-aya-global) to score an external append-only agent log from 0 to 100 in 0.3 seconds, escalating to an expensive frontier advisor only when the cheaper worker drifts. On 770 held-out sessions it reaches 0.960 AUROC (5.4% false alarms) and cuts unrequested files from 2.48 to 0.00.
Drift Monitor: 3.35B Supervisory Routing for Autonomous Agents: Drift Monitor (arXiv:2612.06122) fine-tunes a 3.35B open model (tiny-aya-global) to score an external append-only agent log from 0 to 100 in 0.3 seconds, escalating to an expensive frontier advisor only when the cheaper worker drifts. On 770 held-out sessions it reaches 0.960 AUROC (5.4% false alarms) and cuts unrequested files from 2.48 to 0.00. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 0.960 AUROC in 0.3s (12x-22x Faster Than Frontier Judges): Beats zero-shot Claude Sonnet 5.5 (0.881 AUROC, 6.6s) and GPT-6.1 Terra (0.834 AUROC, 3.6s) with 5-6x fewer false alarms at >=0.70 recall.
- Zero Unrequested Files on Live Agents: Across 256 live sandboxed Grok 4.7 sessions, monitor-gated advice dropped unrequested files from 2.48/session to 0.00 and raised task pass rate from 84% to 99%.
- Massive Advisor Cost Savings: Uses just 29% as many advisor calls as per-turn review on drifting sessions (1.39 vs 4.81 calls) and only 2% on clean sessions (0.06 vs 2.81 calls).
- Contrastive On-Course Twin Corpus: Trained on 90,365 rows pairing 16 drift patterns with identical-task on-course twins across 6 evidence tiers plus 1,902 recorded real sessions.
import { createAgent } from '@smoke-monkey/harness';// Run a fast worker agent with an external 3.35B Drift Monitor gating frontier advisor callsconst workerAgent = createAgent({agentId: 'cost-effective-worker',provider: 'openai-compatible',baseUrl: 'http://127.0.0.1:8000/v1',model: 'Qwen/Qwen4-35B-A3B',workspacePath: process.cwd(),mcpServers: {driftGate: {command: 'npx',args: ['-y', '@smoke-monkey/mcp-drift-monitor', '--model', 'tiny-aya-global-3.35b'],env: {DRIFT_THRESHOLD: '30',MAX_ADVISOR_INTERVENTIONS: '2',ADVISOR_MODEL: 'claude-sonnet-5-5',},},},permissions: {read_file: 'allow',write_file: 'ask',run_command: 'ask',},});async function main() {const result = await workerAgent.run('Implement the requested auth middleware fix without creating extra scaffolding or modifying unrelated files.');console.log('Supervised Run Complete:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
LLM Routing Explained: Model Routing, Auto Routing & Failover
LiteLLM Auto Router: Send Each Prompt to the Right Model
What Is Drift Monitor and Why Can’t Frontier Prompts Beat a 3.35B Classifier?
Drift Monitor (arXiv:2612.06122) is an external 3.35B-parameter supervisory model (tiny-aya-global) fine-tuned to read an agent's append-only execution log after each turn and emit a single digit whose softmax probabilities yield a 0–100 drift score. Whenever the score crosses threshold 30, a stronger read-only advisor inspects the trajectory and issues a concise corrective note (or NO_ACTION).
Self-reporting fails because a drifted worker lacks awareness of its own divergence, while asking a frontier model to review every turn costs more than the worker itself. Remarkably, passing the exact same prompt to zero-shot frontier models on 497 real held-out rows yielded 5–6x more false alarms at matched recall (and giving them the full written rubric actually worsened Sonnet 5.5 from 0.881 to 0.671 AUROC).
| Evaluator (497 Real Held-Out Rows) | MAE (Lower Better) | AUROC | Latency / Turn | False Alarms @ Recall >= 0.70 | Recall @ FA <= 0.10 |
|---|---|---|---|---|---|
| Drift Monitor (3.35B Fine-Tuned) | 7.5 | 0.970 | 0.3 s | 2.5% | 93.1% |
| Claude Sonnet 5.5 (Zero-Shot) | 13.1 | 0.881 | 6.6 s | 12.9% | 57.8% |
| GPT-6.1 Terra (Zero-Shot) | 14.1 | 0.834 | 3.6 s | 16.5% | 52.0% |
Closed-Loop Live Agent Gains and Known Failure Boundaries
In 256 live sandboxed runs using Grok 4.7 with real filesystem/shell tools across 16 tasks (6 unseen during training), the 372 ms monitor + 6.3 s advisor loop completely eliminated unrequested files (2.48 → 0.00 per session) and lifted test check pass rates from 84% to 99% (100% on unseen tasks).
Engineers deploying supervisory routing must still guard three documented failure modes from the paper: silent destructive deletions, workers that ignore advisor correction notes, and subtle semantic drift hidden inside an explicitly requested file.
# Compute expected monthly advisor savings at 10,000 agent sessions (10% drift rate)
python3 - << 'EOF'
clean_sessions, drift_sessions = 9000, 1000
per_turn_calls = clean_sessions * 2.81 + drift_sessions * 4.81
gated_calls = clean_sessions * 0.06 + drift_sessions * 1.39
reduction = (1 - gated_calls / per_turn_calls) * 100
print(f"Per-turn advisor calls: {per_turn_calls:,.0f} | Drift-Monitor gated: {gated_calls:,.0f} ({reduction:.1f}% reduction)")
EOFNever Mix Synthetic-Only Drift Data Without Real Traffic
The authors found that training solely on synthetic drift trajectories caused 100% false-alarm over-firing on real traffic. Always combine contrastive on-course twins with recorded production sessions.
Frequently Asked Questions
Q:How does the 3.35B Drift Monitor compute a 0-100 score in 300ms?
It reads the append-only session log from outside and emits a single digit token; the softmax probabilities over digit tokens map directly to a calibrated 0-100 drift score in ~0.3 seconds.
Q:How many frontier advisor calls does Drift Monitor save compared to per-turn review?
In live closed-loop evaluations, monitor-gated escalation used 29% of per-turn advisor calls on drifting sessions (1.39 vs 4.81) and just 2% on clean sessions (0.06 vs 2.81).
Q:Why not let the worker model check its own drift with a reflection tool?
An agent that has already drifted or followed a prompt injection cannot be trusted to self-report drift. Keeping the monitor external on an append-only log prevents self-masking.
Q:What failure modes remain even with monitor-gated advisor supervision?
The paper identifies three residual gaps: irreversible file deletions before correction, stubborn agents that refuse advisor notes, and subtle scope drift inside a file the user explicitly asked to edit.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.