Most agent workflows run verification after code is written: lint, tests, then a review pass. That order is convenient because the agent already has a patch to measure, but it is the wrong order for impact analysis. By the time a post-edit check runs, the agent has already committed to a change, and the cheapest correction is a revert, which costs a full rewrite and usually a second model round trip.
Move the caller check in front of the edit and the shape of the loop changes. The agent first asks: if I touch these symbols, which functions will call them? That question is answerable without writing a single line of new code. It costs one graph build and one query per symbol. If the answer is stable, the edit proceeds. If the answer changes once the patch is applied to a scratch copy, the agent stops with a non-zero exit instead of handing back a patch that quietly adds a new caller from a module nobody reviewed.
There is a real precedent for keeping this kind of check in the calling code rather than the callee. Python's inspect module can recover the caller's frame at runtime, which is how libraries that vary behavior by caller name do it, but the accepted answer on Stack Overflow warns that this introspection is meant for debugging and development, not production logic: the inspect answer. The lesson transfers. Caller relationships are better established as an artifact the tooling produces than as something a running function discovers about itself. An agent building a static graph is doing the same thing, in the safe direction.



