Police will have the power to break up house parties with more than 15 people from Friday in a bid to reduce transmission of Covid-19.
Health officials have warned such gatherings could present “high-risk super-spreader environments”.
First Minister Nicola Sturgeon said the move was necessary in anticipation of a rise in indoor gatherings as winter approached.
And she said taking action now could prevent stricter lockdown measures.
The measures were first announced last week and the new limit was confirmed on Thursday.
Under current guidance, no more than eight people from a maximum of three different households should be meeting indoors.
The new law takes account of the varying size and composition of families and sets the limit for an indoor party at 15 people if more than one household is present.
During her daily media briefing, Ms Sturgeon said: “We know from the reports of our test and protect teams – and also from evidence around the world – that these kinds of gatherings pose a significant transmission risk.”
She acknowledged the colder weather would increase the likelihood of larger indoor social gatherings but said the new legislation was “not a green light” to ignoring the existing guidance.
Ms Sturgeon added: “In recognition that we intend these new legal powers to be a last resort only and for use in the most blatant breaches of the guidance, we have decided to set a higher threshold for their use.
“Ensuing that police have the powers to disperse large house parties, where that is necessary, is another important tool in trying to keep this virus suppressed.”
She added that it would help to reduce the potential for future clusters and outbreaks and prevent greater lockdown restrictions.
Addressing young people, Ms Sturgeon stressed that the move was “not about trying to stop people having fun” and added: “We’re not trying to police your social lives.”
But the first minister said the move was necessary for the “overall health and wellbeing of the country”.