The Navy battle group off Lebanon is staying outside territorial waters, partly to reduce the risk of terrorist attacks against the ships, and has standard contingency plans for bombing raids if President Reagan should select that course, U.S. officials said yesterday.

Despite concerns by Shiite leaders in Lebanon about a possible retaliatory strike, the main preparations aboard the seven U.S. ships in the eastern Mediterranean yesterday were defensive rather than offensive, officials said.

The defensive measures included Marine Corps guards with machine guns posted aboard the aircraft carrier USS Nimitz at night to deter any sneak attack by a terrorist speed boat filled with explosives.

The Nimitz, flagship of the battle group, has routinely mapped possible targets in Lebanon should Reagan order a strike, officials said, a task that does not require the carrier to enter Lebanese waters. Lebanon claims 12 nautical miles from its coast as territorial waters, a few seconds' flight time by warplanes on the Nimitz.

The Pentagon takes the view that U.S. ships, submarines and planes have every right to operate in international waters and airspace off Lebanon. To change the current deployment of the battle group, as Shiite leader Nabih Berri is demanding, would violate Reagan's vow not to bow to hijackers' demand, officials said.

"The fleet has been there in those same waters for at least three to four years, and they are in international waters," Defense Secretary Caspar W. Weinberger said yesterday. "There is no indication of any change in the basic government policy that we don't give in to demands of hijackers."

While stating that the administration has "the very strong desire to take the steps necessary to get those hostages out alive," Weinberger appeared to make a case for retaliatory action by the battle group at some point by saying, "It's important for everyone to know that the United States has reserved its rights to take whatever action seems to be proper under the appropriate circumstances, and those circumstances change quite frequently."

To the Joint Chiefs of Staff in Washington and the admiral commanding the battle group aboard the Nimitz, such language is interpreted as an order to be ready to do anything the president asks. That could include bombing any one of a number of long-studied targets in Lebanon and evacuating U.S. Embassy personnel and other Americans from the country.

Besides the Nimitz with its 90 bombers, fighters and other aircraft, other U.S. ships stationed off Lebanon included the USS Saipan, an amphibious assault ship carrying Marines and helicopters that could be used to evacuate Americans or, after a bombing strike, rescue downed airmen; the USS Nashville, an amphibious ship carrying Marines, vehicles and small boats that can land on a beach; the USS Spartanburg County, a landing ship that carries Marines and heavy armored vehicles, including tanks; the USS South Carolina, a nuclear-powered cruiser with 80 launchers for antiaircraft missiles to help protect the battle group; the USS Kidd, a destroyer with 5-inch shore bombardment guns as well as antiaircraft missiles, and the USS Kalamazoo, an oiler.

The U.S. intelligence community believes that Iran has trained pilots to conduct kamikaze-type bombing attacks against American warships. Ships of the battle group have been issued heat-seeking Stinger missiles that can shoot down threatening aircraft at close range. The F14 fighter pilots on the Nimitz are under orders to intercept unidentified aircraft and to stay between them and the carrier.