Know when to call escalate_to_human tool, in your brain and your codebase
/ 5 min read
#ai-agents #engineering #career
The strongest AI agent is not the one that can simply do your job. It's the confident one that never hesitates to stop and ask when needed. Think for a second: is your AI setup make it criticize you for your super wrong and dumb decisions? If not, read this post.
these days i keep hearing about one small thing in every serious agent system: the escalate_to_human tool. the agent hits a point where it should not decide alone, so it stops and hands it back to a person. sounds obvious. but it's becoming the convention: teams decide where the human steps in first, and only then let the AI do the rest.
and honestly, it's the same skill that splits junior and senior level in using AI.
when i said this junior/senior, don's mess with the level on the labor contract, but the mindset and skillset of people using AI. an intern can also have a senior level of AI-using if he knows how to cook right with AI.
1. the third ending
every agent is a loop: think, do something, look at the result, repeat. most diagrams stop there. the good ones have one more exit:
without that dashed line, an agent only has two endings: it finishes, or it does something wrong with full confidence. with it, there's a third ending: "i'm not sure, here's what i have, you decide."
that's the whole idea. a human is just one more step in the loop, the slowest and the most trusted one.
2. where the human still holds the wheel
if you code with Claude, Cursor, Copilot or whatever, you already feel this. the AI types really fast in the middle. but look at the edges:
the places i've learned to step in (or want the agent to stop and ping me):
-
the plan (in your head, not AI's plan mode), before any prompt. not the plan the AI writes before it executes. the one you should have before you even open the chat: what you actually want. every question you don't answer, the AI answers for you, silently, with the most average default on the internet. and it won't tell you it guessed.
- building UI? what font, what radius, 0px or 8px? light or dark? mobile first? which design system, or "whatever looks nice"?
- "clean up the old tables"? delete or archive? how old is old? which partitions? what if a dashboard still reads one of them?
- new pipeline? batch or streaming? full load or incremental? what happens when it runs twice, duplicates or nothing? who gets paged when it fails at 3am?
- new API? which auth? what's the error format? is breaking the old clients ok?
if you can't answer these, the AI can't either; it will just look like it can. ten minutes writing down what you want saves a day of "no, not like that".
-
anything you can't undo. migrations,
DROP, force push, deleting files, prod deploys, emails to real users. AI can prepare it. a human presses the button. -
secrets, money, access.
.envfiles, API keys, cloud resources that cost money, permissions. not because the AI is evil, just because one mistake there is expensive and very public. -
the "all tests pass" moment. sometimes they pass because the agent quietly changed the test, or mocked the thing that was broken. green ≠ correct. read the diff.
-
the loop. same error, third fix, now it's rewriting the whole file. stop it. it doesn't need a 4th try, it needs context that only you have.
-
taste. naming, the UX, which trade off to take. AI can give you 3 options. picking is your job.
"but my agent has a taste skill"
a skill is just a prompt structure in a file, and the AI decides when to load it. no skill? paste the same text in the chat, same result. and that taste was written by someone else, so installing it is not having it.
"i'll just let AI write the skill"
one prompt: write a skill to code data products. then the AI decides everything end-to-end: the stack, the layers, the naming, what "good" means. you never answered any of it, so the skill is the average of the internet in a file. you escalated nothing, and now every future run inherits that guess.
you are the point
it's the same for plugins, MCPs, rules, whatever comes next. if the AI writes your skills, follows your skills, and picks your options, then what's left for you? the tool can repeat your decisions, it can't make them. "oh i know skills, i can use AI" is just showing off the tool. the proof is knowing what you want and when the output is wrong.
3. the ladder
before any step that matters, walk down this. one "yes" is enough:
4. but don't ask about everything
an agent that asks permission for every ls trains you to click "yes" without reading. approval fatigue is worse than no approval, because now you think you're in control.
- reversible (read files, code on a branch, run tests): let it run. git is your undo button.
- irreversible: hard stop, every time.
- in between: let it ask, but with what it tried and what it recommends. not just "what should i do?".
5. in your brain
now replace "agent" with "you".
i've been the junior stuck on one pipeline bug for way too long, because asking felt like admitting i wasn't good enough. someone fixed it in 15 minutes. the silent grinding didn't make me look smart, it just slipped the deadline.
seniors escalate early and well. same ladder, and my own rule: 30 minutes with no new idea, i write the message. a good one is short:
backfill for orders fails only on the 2024-03 partitions. tried rerun, bigger cluster, schema matches. is someone else writing to that table? if not sure, i'd rerun it tonight.
what's wrong, what i tried, one question, what i'd do. not weakness, just a well designed system.
the end
in the AI era the code is cheap. knowing when to stop and call a human isn't. build that switch first, in your agents and in your head, then go fast on everything else.