Play with fire

Generated image of a child playing with fire
To play with fire means to do something that is risky. It often describes behavior that seems exciting or tempting but could easily lead to something bad happening.

The phrase comes from the obvious danger of handling real fire without care. Since fire can quickly spread and cause harm, the image became a way to describe risky actions.

Ignoring the safety rules at the construction site is like playing with fire.