I assume that customer P1 is ultimately responsible for the /17 that is advertised somewhere else on their network to another upstream peer and thus you are learning it coming in from your final upstream peering on A. This customer is in the best position to control then these routing advertisements by simply giving you the same subnet as two /17 from P1 to B.
You can then use local preference on A to keep that traffic internal and not go out to the upstream.
This would be the simpliest solution.
Otherwise you have to change your BGP architecture to create some isolation on router A for all your other internal routers. If you can add a new virtual router on A for internal peerings so that A is to the ISP and A2 has the peers to B, C and any other internal routers.
the export from A to A2 will give default only.
A2 will have all the specific routes from downstream clients so that any route on your own network will stay here. And only non matching routes get sent on the default to A.
A still gets all the specific routes from the downstream clients and can advertise those to the upstreams.