Rahul Nanda, Chandra Maddila, Smriti Jha, Euna Mehnaz Khan, Matteo Paltenghi, Satish Chandra
6 min
Abstract
Autonomous coding agents, powered by large language models (LLMs), are increasingly being adopted in the software industry to automate complex engineering tasks. However, these agents are prone to a wide range of misbehaviors, such as deviating from the user's instructions, getting stuck in repetitive loops, or failing to use tools correctly. These failures disrupt the development workflow and often require resource-intensive manual intervention. In this paper, we present a system for automatically recovering from agentic misbehaviors at scale. We first introduce a taxonomy of misbehaviors grounded in an analysis of production traffic, identifying three primary categories: Specification Drift, Reasoning Problems, and Tool Call Failures, which we find occur in about 30% of all agent trajectories. To address these issues, we developed a lightweight, asynchronous self-intervention system named Wink. Wink observes agent trajectories and provides targeted course-correction guidance to nudge the agent back to a productive path. We evaluated our system on over 10,000 real world agent trajectories and found that it successfully resolves 90% of the misbehaviors that require a single intervention. Furthermore, a live A/B test in our production environment demonstrated that our system leads to a statistically significant reduction in Tool Call Failures, Tokens per Session and Engineer Interventions per Session. We present our experience designing and deploying this system, offering insights into the challenges of building resilient agentic systems at scale.
Alex: So that's the map of real-world problems. How does Wink use these checkers without slowing the agent?
Sam: Every so often—after a set number of steps—it runs the checkers in the background on the current history, without pausing the agent. If it flags a match, it adds short instructions like "do this" or "avoid that" to the next prompt as a subtle reminder. This happens asynchronously, so the agent keeps going.
Alex: Like a coach reviewing game tape between plays and texting tips without calling timeout. In tests on over 10,000 real runs, a single nudge fixed 90% of cases needing one?
Sam: Yes. An A/B test in live production cut engineer interventions by over 4% and total steps by over 5%. Tool errors fell similarly. The precision focus minimizes wrong nudges.
Alex: How did they measure if the agent truly got back on track after a nudge?
Sam: They checked over ten thousand sessions where a nudge occurred. They looked at steps right after: did the agent stop the bad pattern—like endlessly calling a tool on an unchanged file—and make progress? Another language model judged this, verified at 86% reliability.
Alex: Like a referee reviewing replay to confirm no repeat fouls. And results by number of nudges?
Sam: For single-nudge cases, the agent stayed on course over 90% of the time. Multiple nudges dropped to 79%, likely tougher tasks. Single-nudge cases are most common.
Alex: Did nudges cut problems overall, not just fix caught ones?
Sam: A shadow test on live traffic showed problems in 19% without nudges, dropping to 15% with them—a solid reduction.
Alex: So it recovers caught issues and prevents some repeats. What about the main live comparison?
Sam: Across thousands of sessions, it cut human fixes per session by 4% and agent steps by over 5%. Execution time improved but not with full confidence.
Alex: Overall, more independent agents without extra waits.
Sam: Yes—it reduces oversight while keeping responses quick, since checks run in parallel. Results hold across real coding tasks.
Alex: What did a closer look at fixed and unfixed cases reveal?
Sam: They hand-reviewed about four hundred nudge cases. Nearly four in ten recoveries broke repeated actions. Others refreshed the goal or fixed tool mistakes. Non-fixes often ignored guidance, in over a third; some tied to outside issues like editor problems.
Alex: Loops easiest to fix, but a third ignoring nudges. Any patterns why?
Sam: Agents sometimes stuck to faulty plans or hit unrelated snags. Targeted nudges help most, but stubborn reasoning needs more.
Alex: Single-nudge wins cover the bulk, but tougher spots need escalation. What limitations does the paper flag?
Sam: Categories and tools are from one company's setup, so results may not transfer. It misses rare slip-ups. Potential biases exist, though A/B tests help. It's solid but context-specific.
Alex: That's a clear gain without overpromising. Thanks, Sam—this has been a solid breakdown of how Wink tackles agent slip-ups. Thanks for listening to ResearchPod.