While AI is advancing fast, I don't think we've seen examples of it deciding to do anything specific (it merely responds to humans and what they prompt it to do).
In terms of the two attacks we are talking about here - the ECDLP and a 51% attack - neither are particularly helped by the umbrella term of "AI". Until we have (or indeed, if we ever have) large, stable, functioning quantum computers capable of running Shor's algorithm on the size of numbers we are using (which will be decades away at a minimum), then the best attack against the elliptic curve multiplication used in bitcoin requires in the order of 2
128 operations. An AI can't change that fact. Maybe it can run those operations slightly faster, but 2
128 is still
many orders of magnitude outside the realms of possibility.
And in terms of a 51% attack - an AI can't generate hash rate unless it has the hardware to do it. And we already have very specialized hardware called ASICs which do just this. Mining bitcoin is not a difficult problem which requires a super advanced AI to figure out - it's simply a case of performing a very simple hash operation as many times as possible as quickly as possible. And so any AI running on non-ASICs will be inferior to the ASICs we already have.
Perhaps there would be a role for an advanced enough AI to help design the next generation of ASICs and squeeze out a bit more efficiency, but an AI isn't going to attack bitcoin.