Their Mercedes team said they had "strengthened our rules of engagement to include much greater deterrents to contact between our cars".
Boss Toto Wolff said the drivers faced "sporting and financial consequences".
Wolff refused to give details of the potential sanctions but hinted it could include suspensions from races.
"You know how a driver is calibrated and what is important for them," Wolff said before this weekend's British Grand Prix at Silverstone.
"It is clear if it would happen again it would be something that has a negative outcome for their campaign."
Mercedes added that team orders - which define the order in which the cars finish a race - could be imposed "as a solution of last resort" if the drivers failed to abide by their new guidelines.
The move follows their last-lap collision when Hamilton was trying to pass Rosberg for the lead at Sunday's Austrian Grand Prix, their third contact in five races.
Hamilton went on to win the race, while Rosberg dropped down to fourth place with a damaged car.
Wolff said he had given Hamilton and Rosberg guidelines about their conduct on track but repeatedly refused to detail what they were or the potential penalties that could be imposed if they were not followed.
However, the only penalty the team could impose that would have any significant deterrent effect would be a fine or suspension from a race.
Hamilton earns a reputed $31m (£23.9m) a year and Rosberg about half that, so it can be assumed any fine would likely run into the millions for it to have any deterrent effect.
In terms of sporting penalties, the only realistic serious threat the team have at their disposal would be to exclude a driver.
Wolff admitted that what he was asking of the drivers was "difficult because they drive in a certain way and they are at Mercedes because they are like that".
He added: "It is tricky because if you have a yellow card, will it change the way you tackle or not because you know what happens with a second yellow card?"
Hamilton said the discussions had been "private and confidential" and refused to give details.
But he was asked whether he was still able to perform the same manoeuvres as he had in races in Japan and the United States last year, when Rosberg felt he had pushed him off the track on the first lap.
Hamilton replied: "In all those races, the stewards deemed that racing. So I will still race like that."
Rosberg said his "battle" with Hamilton "remains nearly unchanged," adding: "It is a serious matter. We must avoid contact and collisions. We have had a discussion about the best way to move forward and now we are going racing again."
The German said his ongoing contract extension negotiations were unaffected by the new deterrents. "It is a monetary thing which does not have an impact on the long-term happiness of the team with me, and me with the team," he said.
The title rivals were given the ultimatum in meetings with Wolff at the Mercedes F1 factory on Thursday.
The collision in Austria was the third time the cars had hit each other in the last five races, after they took each other out on the first lap in Spain and banged wheels at the start of the Canadian race.
Wolff contemplated "all options" in the days following Sunday's crash but, after meeting with senior management, decided not to impose team orders on the drivers.
Rosberg was penalised for the incident by race stewards, who said he had not given Hamilton "racing room" as the Briton tried to overtake the German around the outside of Turn Two at the Red Bull Ring.
Wolff, who called the collision "brainless", is determined it should not happen again.
The decision to lay down the law to the two drivers adds further spice to an already tense weekend at Silverstone, the 10th grand prix of a record 21-race season.
Hamilton trails Rosberg by 11 points following his Austria win, his third of the season. The German has taken five victories.
Lewis Hamilton and Nico Rosberg are on a "final warning" that they will be severely punished if they crash again but remain free to race.