The "Osgood Box" was a device given to Osgood and her Zygon duplicate by the Doctor to use if the ceasefire between humans and Zygons broke down after a peace treaty was arranged. The two Osgoods recorded a brief video explaining the Osgood Box and its abilities before one of them was murdered by Missy. (TV: The Zygon Invasion)
In fact, two Osgood Boxes, a red one and a blue one, were kept in the Black Archive under the Tower of London. However, inside the Archive, an identical blue box was revealed with the red box. The reason for two Osgood Boxes existing was that there were two Osgoods who guarded watch over them.
Both boxes contained two buttons inside them, hidden underneath a lid. The buttons were labelled "truth" and "consequences" in all capital letters accordingly. Pressing them would allegedly cause an event to take place as safeguards or countermeasures against either humans or Zygons. The red box would either release Z-67 gas into the Earth's atmosphere which would turn Zygon biology inside-out, or detonate the nuclear warhead underneath the Archive, which would wipe out most of London. The blue box would either send out a signal that would disable their ability to shapeshift for at least an hour and revert them to their true forms, exposing their alien nature to all, or send out a signal that permanently prevented them from changing back from the human forms or other disguises that they assumed.
However, neither of the boxes posed a threat at all, merely being empty objects with superficial buttons made to appear threatening through clever deception and misinformation. The Osgood Boxes were simply framing devices used by the Doctor to demonstrate a "scale model of war", as no matter what decision the parties made who used the boxes, they would never know for sure what the impact of their actions would be or who would potentially have their lives shattered. The Twelfth Doctor was able to use them to persuade Bonnie to stop a rebellion and stop Kate Stewart from taking drastic actions against the Zygons.
The Doctor relied on the memory-wiping devices in the Black Archive to make the Osgood Boxes serve their purpose to their fullest, and he set them off with his sonic sunglasses each time the experiment failed. It took the Doctor sixteen tries to get Bonnie to see reason while Kate, who may or may not have made the right choice, was never the wiser after the memory wipes. The mind wipe was a success for Kate and two Zygons, leaving only the Doctor, Clara, Osgood and Bonnie aware of the true purpose of the Osgood Boxes. (TV: The Zygon Inversion)
Appearance and abilities
The designs and functions of the Osgood Boxes were directly inspired by that of the Moment, as the Doctor had once faced a decision to use the dangerous weapon to end the Last Great Time War at the expense of innocent Gallifreyan lives.
Behind the scenes
The Osgood Boxes can be compared to the Schrödinger's cat experiment, in that it was impossible to know what would happen from using them until opening them and learning they were harmless. However, while it would normally only be possible to do this experiment just once due to remembering what one saw, the Doctor went to such lengths as to erase the memories of those who used the boxes when they failed to meet his expectations and forcibly manipulated the results of the experiment until he got a desired response from both subjects involved. It also bears some similarity to the red pill and blue pill that originated in the 1999 film The Matrix.