  In the article we consider Bach-flat metrics on four-manifolds with boundary,
with conformally invariant boundary conditions. We show that such metrics arise
naturally as critical points of the Weyl energy under a constraint. We then
prove a rigidity result: if a Yamabe metric associated to a critical metric
when restricted to the boundary is isometric to the round three-sphere, then
the critical metric must be isometric to the standard upper hemisphere.
