A female prison officer is being investigated by police after being caught on camera allegedly having sex with an inmate in his cell.