You can have invisible walls (collision area without a sprite) around whole level to make sure it doesn't get out it.
If your level is bigger than screen and you want to bounce around visible area, you can add that invisible wall into the Camera2D scene.. so it moves with your camera together and will always be just behind the edge.