A prison governor who allegedly began a relationship with a drug-dealing gang boss was "green and stupid", a court heard.