builder: add safeguard to prevent duplicate in/outputs