What kind of fence do you have? Many Basenjis are great jumpers, some will use chain link as a ladder, and a few like to dig. Some won't bother trying to get out but I wouldn't count on it. Best solution is a 6 - 8 foot vertical board fence. If you have chain link you can attach something to the inside of the top, e.g. pvc pipe, which may deter the dog. If you don't have any option to change your fence, invisible fence backed up by the physical fence can work.
It's best not to leave the dog in the yard unsupervised in any case.....