A dog given up by his owner has embarked on a promising future stopping drugs from being smuggled into prisons.