Restricting affiliate codes to only work on specific customer segments is a great way to prevent affiliates from referring existing customers (+ lots more). With this feature, you can include/exclude any segment of customers from using affiliate's codes.
To set this up, head to your Programs tab and select the program you want to apply this to.
From within the program builder page, head to the Advanced program settings section. In the "Discount code applies to" field, change "all customers" to "specific customer segments". An additional field will appear where you can select which customer segments you want to affiliate's codes to work on.
To restrict code usage to new customers only, include a segment of customers who haven't purchased previously .
Click Publish once done to set your changes live!