Why contain it. Best case he's the only one with the weapon as a prize for breaking all 108 locks. Worst case thousands die trying to replicate gunpowder.
Either way no more dangerous than having kids learn swordsmanship. Hell which is worse having a kid with a short range weapon that makes you get in close or a long range weapon that could be a one hit kill?
Huh, in a world where people can fling fireballs to each other and freely carry swords and spears around town, does gun even matter in terms of security...
@PotatoZero swords are really heavy and big so you need training, and I don't think a kid can shot a fireball without proper knowledge of magic... But a gun is small, easy to use and the effect is super effective at short and long distance, so I guess it would be a "cheat" item in this world, it breaks the balance completely because anyone could use it. And if they manage to replicate it and the information falls in wrong hands then GG
@DaJa-rahrah kids don't need to learn because they're kids