Reminds me of Iain M Banks’s Feersum Endjinn, where the castle resisted investigation by leveraging its smart fabric to hurl ghosts at the workers trying to drill out its walls!