While every effort should be made to prevent accidents, there is no way to ever completely eliminate the possibility that something will go wrong. There are just no guarantees in the real world no matter how hard you try. The idea behind containment efforts is to first acknowledge the fact that some day something will go wrong, then turn your attention towards minimizing the possible damage it will cause. The basic principles of containment are perhaps the most ignored by the pyro hobbyist, usually due to the nature of the workshop or area where fireworks are being built.
Separation of Process and Storage
The separation of completed products from the area in which you normally conduct assembly is the number one rule of containment. Completed products include not only finished items that are ready to shoot, but also stars, burst charge, match and other easily ignitable items that will produce flash fires if ignited. In fact, it is the exposed and easily ignitable nature of stars and other components that actually make them even more hazardous than completed shells. They are the most likely starting point of a runaway flash fire, and can even cause an explosion by themselves if the quantity is large enough.
The magazine is the principle element of containment, which is why the ATF places so much emphasis on it. The concept of the magazine is to remove high-energy materials away from where people normally reside or work and place them far enough away that nothing would be damaged if they did go high order. Granted if anything ever happened inside the magazine while you were inside it, then your chances of injury would be very high. But the percentage of your time spent in your shop is far greater and thus your overall chances of getting hurt are drastically reduced by the use of a magazine.
The biggest problems hobbyists encounter with magazines is having the place to put one. The unfortunate reality of our ever growing population density makes the luxury of having large plots of land increasingly expensive and hard to come by. Many hobbyists are forced to work out of attached garages and other dwellings that are far too close to either their own home or others. However, even a small magazine out in your backyard is better than storing energetic material in your shop or, even worse, your home. Even if your magazine can not meet ATF distance requirements, it is still beneficial to your safety to build one anyway and start using it.
Work Outdoors
When an accident occurs inside of a building, the building itself acts like a shell casing. This containment results in an increased pressure that propagates the flash fire and raises temperatures even further, thus making a bad situation worse. Then there is the additional hazards of the building collapsing on you if the walls blow out. Most buildings are not designed to withstand pressure forces from within, and getting pinned by a falling roof can make an otherwise survivable situation fatal. Any kind of flash fire, even a small one, is going to fill the air with smoke that will lower your visibility to zero even if the flash of light doesn't temporarily blind you first. Trying to fumble your way to safety from a burning building is drastically more difficult when blind.
The best place to build fireworks is out in the open air in a shaded area. This is especially true for dust prone activites like mixing chemicals together or rolling stars. If these processes are done indoors, the unavoidable dust will settle on everything in your shop and make the environment even more hazardous. But even without the dust problem, working outside eliminates the hazards caused by enclosed overhead environments when things go wrong. A tent may be used to provide shade without incurring any additional risks, since the sides are all open and collapse is not an issue.
Note that some chemical combinations may become more sensitive if exposed to direct sunlight, such as chlorate compositions. This is why shade is recommended. Sunlight has also been known to cause ignitions with compositions stored in round metal bowls left in the sun, possibly through parabolic focusing of the sunlight through reflection. Shiny metal bowls should thus be avoided altogether as a container for holding pyrotechnic compositions.
Unlike professional manufacturing operations, the hobbyist does not have to keep producing if the weather outside is not cooperative. If rain or cold weather prevents you from working outside, then it is better to just wait for it to clear up. I realize this may be difficult for those living in Northern regions who are subjected to frozen tundra for half the year, but cold weather also brings with it a static electricity hazard that is further reason to wait for more favorable conditions in which to make pyro. If you simply must do pyro year around in an environment such as this, it would be a good idea to get all your stars and chemicals mixed in the summer months so that only the assembly operations would need to be done in cold, dry weather.
Open Buildings
When you must work inside a building, try to keep it as open as possible. By opening things like doors, garage doors and windows, you reduce the ability for pressure to build up and thus reduce the chances of a building collapse. Having large openings like open garage doors also makes it easier to escape the building under blind conditions. Many commercial assembly buildings do not even have doors and have multiple exits so that a blinded worker can escape in multiple directions.
Sealed Storage Containers
The containers used to store raw materials such as stars, burst charge and composition also play a key role in containment safety. These containers should be sturdy enough to withstand a brief flash fire without the internal contents igniting. Standard five gallon plastic pails are most commonly used for this. Some five gallon buckets have a rubber seal in the lid, while others do not. Without the seal, a closed bucket subjected to the hot gas pressures of an indoor flash fire would still ignite. Sealed lids have been found to prevent ignition and thus reduce the impact of flash fires in commercial accidents. A very nice type of screw-on lid adapter for five gallon buckets is sold by PyroSupplies or U.S. Plastics.
It is pretty common for hobbyists to store stars in plastic zip-lock bags. This is very convenient due to how cheap they are and how many different types of stars one typically accumulates. Having a plastic or paper container for each type of star would take up a lot of space and get expensive. The thing to do in this case would be to store the bags themselves into large sealable containers. Old empty perchlorate drums make good containers also, and are more fire resistant since they are made from metal. The down side to metal containers would be the potential shrapnel generated should a reaction ever initiate from inside the drum.
Minimize Exposed Material
When engaged in assembly operations and other activities where energetic material must be present, it is important to minimize the amount of material that is exposed out in the open. Any material that is not needed for the project at hand should not even be in the room, even if it is in a closed container. By limiting the amount of material that a flash fire can feed on, you minimize the size and destruction an accidental ignition is capable of producing. If you are working in a small space with a large rack of stars drying in one part of the room, a table top full of rough powder drying behind you, a bunch of black match sitting on the table and open buckets full of burst charge and stars sitting around, your chances of survival are much more limited if something ignites.