Assume the AI should never see a secret. Keep credentials in environment variables or a secrets manager, never in source files, and add .env files to .gitignore.
Be careful with "always allow" or "don't ask again" options. Saved permission rules can end up containing pasted keys or full commands, and they are often stored in project files that get committed. Prefer narrow, specific approvals over blanket ones, and review any settings files before you commit them. Add a secret scanner as a pre-commit hook and in your CI pipeline. If a key does leak, rotate it immediately. Deleting the file or commit is not enough, because copies may already exist. Check your tool's current docs for where permissions are stored.