The correct option is B O2
An oxidising agent or oxidant is a substance which:
∙ Supplies oxygen or any other electronegative element
∙ Removes hydrogen or any other electropositive element
∙ Undergoes reduction in the chemical reaction.
Here Mg is oxidised by O2 and O2 is being reduced. Therefore, O2 is the oxidising agent.