The outer edge of a random dungeon level can have undiggable walls. Phaseable monsters, such as earth elementals, could hide deep inside that boundary. Turn the walls beyond the first layer of non-diggable walls also non-phaseable.
\c