In addition to the answer of Bryan Krause, note that in the US there is no need to choose between different subfields in CS in order to apply with only a bachelors. There will be plenty of time (couple of years, perhaps), early on, for coursework that lets you choose a proper research area. You also get to spend some time looking at faculty to find a dissertation advisor.
The first task in most US CS programs is to take advanced coursework that enables you to pass the qualifying exams. There are a few exceptions to that, but it is very common.
Also, as I think you understand, there is normally no need, in the US, to get a masters in order to apply for a doctorate. In fact the early coursework in a doctoral program is likely to overlap with that of a masters. If you want a PhD, then apply for that. In some other countries (Germany...) the situation is different.
So, you may have a misconception that you can "just choose one", as there is no real need to choose early, i.e. before you apply. And another misconception that you can just switch as a fresh PhD.
As to switching fields "later" I'll agree with Bryan Krause that immediately after earning a doctorate not a likely time. You need to get hired for something, maybe a postdoc, based on the skills you have demonstrated. There are probably a few postdocs that give you a lot of freedom, but that isn't the standard. Switching is easy for tenured faculty, since you have a secure base from which to explore. But that is down the road a bit.
In the US, the students who enter doctoral studies in most fields fall into a few categories. There are those who are undecided after a bachelors about their future, but want to know more. There are those who start a doctoral program in one place but leave for one of several reasons, but leave with a masters and want to continue doctoral study elsewhere (my case, actually). There are those who want to return to academia after a stint in industry for which they earned a masters. International students often come with a masters due to the system requirements in their home countries where a masters might be required for doctoral study.
But few students who actually want a doctorate in US decide to do a masters first, as it just isn't necessary. There are some, certainly, but it isn't the most common path. Partly because the goals of the two are usually different. Masters prepares practitioners. PhD prepares researchers. But, again, this is a US perspective.
See the following for more on how doctoral admissions works in the US, in case you have questions: https://academia.stackexchange.com/a/176909/75368