In BGP confederation, how does the AS_PATH attribute handle the confederation sub-AS numbers to prevent loops?
Correct. The confederation AS_PATH is used within the confederation and removed when routes are advertised outside.
Why this answer
In BGP confederation, confederation sub-AS numbers are carried in a separate confederation AS_PATH segment and are not visible to external BGP peers. The confederation AS_PATH is used for loop prevention within the confederation, while the regular AS_PATH remains unchanged when routes leave the confederation.