Architecture
~8 min readUpdated: December 2026

Drift Monitor: 3.35B Supervisory Routing for Autonomous Agents

Drift Monitor 3.35B supervisory routing architecture in Smoke Monkey

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.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

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.

Key Architectural Takeaways
Quick Implementation Exampledrift-monitor-gated-agent.ts
drift-monitor-gated-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Run a fast worker agent with an external 3.35B Drift Monitor gating frontier advisor calls
const 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);
Video Guides

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)AUROCLatency / TurnFalse Alarms @ Recall >= 0.70Recall @ FA <= 0.10
Drift Monitor (3.35B Fine-Tuned)7.50.9700.3 s2.5%93.1%
Claude Sonnet 5.5 (Zero-Shot)13.10.8816.6 s12.9%57.8%
GPT-6.1 Terra (Zero-Shot)14.10.8343.6 s16.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.

bash
# 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)")
EOF

Never 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.

Google Search Questions & Answers

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 guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness