Underground enemy ai?

I have no previous experience in using or creating AI, but I wanted to know, is it possible to create an enemy AI that can move underground, without any caves, or make it so it generates caves as it moves through?