Protect your preview
Prefer access control for private previews. If a staging page must stay publicly accessible, send an X-Robots-Tag: noindex header or include a robots noindex meta tag in its head. Apply this only to the staging environment.
Do not confuse crawling and indexing
A robots.txt Disallow rule is not a reliable way to prevent indexing. Crawlers need access to a page to see its noindex instruction. Before launch, confirm that production has no inherited noindex header or tag.