The sexual history of alleged victims will be off limits without pre-trial sign-off from a judge, after a law change passed with unanimous support.
Sexual violence complainants won't be shielded from having such details introduced by defence teams but the change will allow them to prepare themselves for such an eventuality, the government says.
Currently, a party that wants to introduce evidence about a complainant's sexual history with a person other than the defendant must apply to the court for permission.
That permission can be sought at any time during the trial. Under the new law, it will need to be before the case is tried, unless a judge rules otherwise.
National MP and Attorney-General Chris Finlayson said the change would give victims time to come to terms with what will be discussed in court.