When I use it, I use it to create single functions that have known inputs and outputs.
If absolutely needed, I use it to refactor old shitty scripts that need to look better and be used by someone else.
I always do a line-by-line analysis of what the AI is suggesting.
Any time I have leveraged AI to build out a full script with all desired functions all at once, I end up deleting most of the generated code. Context and "reasoning" can actually ruin the result I am trying to achieve. (Some models just love to add command line switch handling for no reason. That can fundamental change how an app is structured and not always desired.)