Fire imps are potentially very dangerous creatures that live in magma vents. They usually don't roam that far from the vent, but sometimes they do and they will also surface and attack any dwarf who comes near their vent. They are rather small and easy to kill from range by an average soldier, unless they are able to breathe fire first that deals high damage and ignites objects and creatures. They can only breathe occasionally - if a trained warrior can jump them (or dodge/survive their first breath), they can usually kill them easily.
If you need to use imp-infested magma for your metalworks, use extreme caution, or just kill them all first, or at least consider setting traps or stationing marksdwarves around the furnaces. It is safer though to follow the same procedure you use to prevent fire men from getting to your dwarves.
Another method of dealing with fire imps is to build a magma-proof grate into the channel leading to the vent where you're going to be drawing magma from. Grates made from Bauxite are a good start, but are not necessary. This will filter out just about all those unwanted pests. This same method can be done with other building types such as walls or doors over the magma channel just as easily.
Another danger of fire imps (and fire men) is that they will attack wild creatures (not other imps or fire men), traveling merchants and goblins, which can start a wild fire that will jump from ignitable tile to tile and can burn your entire map and your dwarves. For this reason, it is recommended that you keep an eye on the situation outside and give the orders for your dwarves to stay inside ( - ) when you see that flickering wall spreading from the magma vent area.
When a fire imp corpse is butchered, clouds of "boiling fire imp fat" sometimes bubble out from the Butcher's shop, which can ignite nearby items or clothes (at least one butcher has perished to this fate), while other times it may leave a glob of ‼fire imp fat‼ in the butcher's shop which emits significant amounts of smoke (and may require deconstructing the butcher's shop in order to get rid of it).
 Catching Imps
Imps can be easily caught by building a channel or wall around the magma with only one little opening then placing cage traps in that one entrance; many traps in a row are recommended. The imps will run out of the magma with the intent of killing your dwarfs, only to get caught by your traps. This is a good semi-safe way to control the fire imps in your area. Just make sure your dwarfs are not going in areas that you have boxed off, or there will be nothing to stop them from killing your dwarfs.
 Interesting Notes
When Fire Imps are injured, they bleed black Goo.
Although Fire Imps have a natural body temperature of only 10095 (about 127 degrees farenheit), they quickly reach a temperature of 12000 due to contact with magma. This is why imp fat does not consistently explode, and is not always lethal; an imp that was shot as soon as it jumped out of the magma and promptly butchered will produce nearly 12000 degree boiling fat, while an imp which chased your dwarves all over the fortress for an entire season will have cooled down to its natural body temperature. Similarly, this is why wrestling a fire imp will only sometimes catch a wrestler's clothes on fire. A final danger is that fire imp meat can retain a high temperature for a long time, and will slowly heat its surroundings. If the surroundings are a wooden barrel, fun can result.
Fire Imps cannot drown, and dumping them into water has no effect. The imp will escape the water and run away.
[CREATURE:IMP_FIRE] [NAME:fire imp:fire imps:fire imp] [TILE:'i'][COLOR:6:0:1] [MODVALUE:10] [LARGE_ROAMING][FREQUENCY:20] [FIREBREATH][FIREIMMUNE][LIKES_FIGHTING][MAGMA_VISION] [LARGE_PREDATOR] [GENPOWER:5] [BLOODTYPE:0] [BONECARN] [CANOPENDOORS] [PREFSTRING:terrifying features] [BODY:HUMANOID:TAIL:2EYES:2EARS:NOSE:HEART:GUTS:ORGANS:HUMANOID_JOINTS:THROAT:NECK:SPINE:BRAIN:MOUTH] [NOBREATHE] [SIZE:3] [ATTACK:MAIN:BYTYPE:MOUTH:bite:bites:1:6:BURN][ATTACKFLAG_CANLATCH] [EQUIPS] [FAT:1] [ALL_ACTIVE] [NO_DRINK][NO_EAT][NO_SLEEP] [POPULATION_NUMBER:15:30] [CLUSTER_NUMBER:3:5] [BIOME:SUBTERRANEAN_LAVA] [NO_GENDER] [STANDARD_FLESH] [HOMEOTHERM:10095] [SWIMS_INNATE][SWIM_SPEED:2500] [HEATDAM_POINT:13000] [IGNITE_POINT:13500] [LEATHER_HEATDAM_POINT:13000] [LEATHER_IGNITE_POINT:13500] [BONE_HEATDAM_POINT:14000]