How can I prevent a trapped necromancer from causing trouble?

According to the wiki, necromancers can be safely kept in cages. [RE-EDIT: I initially got this wrong, see comments] Since they are immortal, they won't starve. They will not reanimate things.

They can reanimate any corpse or body part they have a line of sight to. So walls and raised bridges will stop them completely, and windows or bars will stop their movement while allowing them to reanimate training material. You can combine bridges and windows to make an effective switchable danger room.

You can read more about this on the wiki: http://dwarffortresswiki.org/index.php/Necromancer#Applications


The safest way to store a necromancer until you are ready to "do something" is keep it in a cage. Caged enemy cannot do anything until they are let out. They effectively enter a "stasis" state, so they do not starve and the do not heal.

Once let out of the cage, the necromancer can do anything that a necromancer can do. Chains and fortifications won't stop the necromancer. Only being caged will stop the necromancer and make it safe to have in your fortress. A caged necromancer, in version 0.34, cannot reanimate until it is out of the cage. The dwarf fortress wiki agrees with this information.