The UK Department for Transport has published a new Code of Practice for testing self-driving cars .

Driverless vehicles are already being tested in the UK, but as our laws currently don't account for autonomous vehicles on the open road, they need to be tweaked.

It will be some time before we need a proper update to legislation, but a newly-published document provides a guide to anyone conducting tests of autonomous vehicles on UK public roads in the future.

Many of the rules are what you'd expect: all autonomous cars must follow the normal highway code; all cars must be insured and have a valid MOT; and cars must pass the "test track" before hitting the open road.

The regulations also state that there must be a backup driver in the car who holds a full driving license, and even when they're not at the wheel, the person in the car won't be allowed to use their phone (though that might not convince Google).

Dude, where's my car?

An interesting but important rule states that cars must also be protected from being accessed by hackers.

It states: "Manufacturers providing vehicles, and other organisations supplying parts for testing will need to ensure that all prototype automated controllers and other vehicle systems have appropriate levels of security built into them to manage any risk of unauthorised access."

Another notable clause says that cars must be fitted with a 'black box' type device that will capture data about each journey, so if you have a collision it will be able to tell who was at fault.

Google is road-testing cars over in the US right now, but UK trials are still taking place in smaller spaces. Still, it won't be long before we'll be seeing autonomous vehicles being tested on the roads over here, so it's time there were some safety measures put in place.