(Using Blender 4.2.5)

For flexibility, a GeometryNodes modifier can be attached to the object to frame. The size, the thickness and the material of the frame can be specified through the modifier input panel.

1. The frame is based on the Bounding Box of the object to which the modifier is attached.
2. The size of this bounding box can be modified using the Scale socket of a Transform Geometry node, and the user defined Inflate parameter recovered through the Group Input node.
3. The frame corners are made of Cube instanced on each vertex of the scaled bounding box. It is to notice that this Cube Size is set to 1. It is adjusted afterwards using the Scale socket of the Instance on Points node, and the user defined Thickness parameter recovered through the Group Input node.
4. The frame bars are made of Cube instanced at the mid point of each edge of the scaled bounding box. It is to notice that this Cube Size is set to 1 also. The mid point position is computed using a Mesh to Points node set in Edges domain. Bars orientation, thickness and length are set through the Rotation and Scale sockets of the Instance on Points node.
5. The orientation and length of an edge are computed as a vector by subtracting the position of its end points. These positions are recovered through an Edge Vertices node.
6. Arbitrarily, the length of a bar is aligned with its local Z axis while its cross section thickness is defined in its local XY plane. Consequently, its local Z axis is aligned with the vector computed at step 5, using an Align Rotation to Vector node. The resulting Rotation attribute must be captured in Edge domain.
7. Because of the corner cubes, a bar is shorter than the associated edge. This edge Length is evaluated using a vector math node from the vector computed at step 5, then the user defined Thickness parameter is subtracted.
8. The anisotropic scale of the unit Cube created at step 4 is assembled using a Combine XYZ node. The user defined Thickness parameter is input in X and Y directions to scale the cross section uniformly, while the value computed at step 7 is input in Z direction to scale the length. The resulting Scale attribute must be captured in Edge domain again.
9. The frame is assembled by joining corners (from step 3) and bars (from step 4).
10. The frame color can be specified independently from the object color using a Set Material node and the user defined Material parameter recovered through the Group Input node.
11. Eventually, the frame is put around the object using a Join Geometry node.
NB: To hide the frame, set the "Thickness" to 0, or deactivate the modifier.
Resources:

(Blender 4.2.5+)