YouTube has signed up to the pilot scheme to give music videos shown online an age rating. Photograph: Graeme Robertson

Online music videos will carry an age classification from October as part of a pilot scheme by YouTube, music video service Vevo and the British Board of Film Classification to protect children from "graphic content", David Cameron announced on Monday.

As he warned of the dangers of allowing the internet to become "some sort of lawless space", the prime minister said the rules for online videos should be brought into line with content bought offline. He admitted that he had banned his own children from viewing some videos.

Cameron said: "Helping families with children and parenting shouldn't stop at childbirth.

"To take just one example – bringing up children in an internet age, you are endlessly worried about what they are going to find online. So we've taken a big stand on protecting our children online.

"We're making family-friendly filters the default setting for all new online customers, and we're forcing existing customers to make an active choice about whether to install them.

"And today we're going even further. From October, we're going to help parents protect their children from some of the graphic content in online music videos by working with the British Board of Film Classification [BBFC], Vevo and YouTube to pilot the age rating of these videos."

The voluntary pilot, to run initially for three months from October, will also involve the big three music labels in the UK – Sony, Universal and Warner Music.

The videos will go through the same classification system as films and other video content, aiming to give parents more information to protect children from "graphic content".

Music videos sold or distributed on disc or other physical form deemed to include 12-rated-plus material will also have to go through the same age-classification process starting in October under amendments to the Video Recording Act. The music labels will submit music videos that they consider could contain content that should be classified as for age 12 or over, using BBFC guidelines.

The prime minister said that the internet should not be exempt from the rules of society. He said: "We shouldn't cede the internet as some sort of lawless space where the normal rules of life shouldn't apply. So, in as far as it is possible, we should try to make sure that the rules that exist offline exist online.

"So if you want to go and buy a music video offline there are age restrictions on it. We should try and recreate that system on the internet."

Cameron said he has stopped his children from watching some content online. He said: "As for my own children I am sure there are times when they have been disappointed because they haven't been able to do something or see something.

"But that is part of what being a parent is about – being able to deploy the use of the word no and sometimes even to deploy the off switch on the television, unpopular as that can sometimes be, and sometimes ineffectual because they find another screen somewhere to switch on."

A spokesperson for the BPI, the trade association for the record industry, said: "The BPI agrees with government that, with so many more music videos now being released online through such sites as YouTube and Vevo, it is important this content is made available to the public in a responsible way, that is sensitive to the needs and concerns of younger viewers and their parents in particular ...

"If, as hoped, the pilot proves successful, then as a key next step we would call on digital service providers to introduce filters linked to those age ratings so that families have the additional option to block video content they consider unsuitable viewing for children."