Before I go any further, let me be clear that this is for a work of fiction.
Doing some research for a story where a military protagonist becomes trapped behind enemy lines, with a plan to have her hold out until rescue against superior forces by adopting asymmetric warfare tactics, including the use of improvised explosive devices. This is an urban environment, but it's a situation where most of the civilians formerly in the area are already gone (either dead, fled, or captured), and she's actively trying to keep the enemy away from a pocket of survivors.
Under standard Western rules of war, is it legal for her to use IEDs in this context? I did a little research already but that article mostly just deals with IEDs being used partially or fully for ideological reasons with no care to collateral damage (and often deliberately targeting civilians).