Let $X$ and $Y$ be two algebraic varieties, and let $f: X \to Y$ be a morphism. Suppose $A$ is a holonomic $D$-module on $Y$. In this situation we can pull $A$ back to $X$ using either the $!$ or $*$ pullbacks. If $f$ was smooth, then the two operations would agree for all sheaves up to a shift.
What if $f$ isn’t smooth? Are there still conditions we can put on $A$ to guarantee that the two pullbacks agree (up to a shift)? I am particularly interested in the case when $f$ is a closed immersion.