What robots.txt does
robots.txt tells crawlers which parts of your site they may visit. It's a request, not a lock: anything private still needs a login. To keep a page out of search results, use a noindex tag instead.
AI crawlers: search vs training
Some crawlers gather data to train AI models; others fetch pages to answer people's questions in AI search. Blocking training crawlers keeps your content out of future training data. Blocking search crawlers also keeps you out of AI answers, which can cost you visitors.
To help AI assistants understand your site, add an llms.txt file.