That's incorrect, or at best misleadingly incomplete. 8 USC §1357(a) authorizes border agents to, "(3) within a reasonable distance from any external boundary of the United States, to board and search for aliens any vessel within the territorial waters of the United States and any railway car, aircraft, conveyance, or vehicle, and within a distance of twenty-five miles from any such external boundary to have access to private lands, but not dwellings, for the purpose of patrolling the border to prevent the illegal entry of aliens into the United States."
The associated regulations, 8 C.F.R. §287.1, interpret "reasonable distance" to mean up to 100 miles from the actual border. But: "In fixing distances not exceeding 100 air miles pursuant to paragraph (a) of this section, chief patrol agents and special agents in charge shall take into consideration topography, confluence of arteries of transportation leading from external boundaries, density of population, possible inconvenience to the traveling public, types of conveyances used, and reliable information as to movements of persons effecting illegal entry into the United States."
The statute and regulation just mean that agents don't need to patrol the border at the literal border--which in some cases runs through the middle of bodies of water. But they must justify the determinations of what's a "reasonable distance" from the border must be based on what's needed to prevent illegal entry into the United States, based on factors such as topography and transportation routes.