How-to · Coding & productivity
How to use AI coding tools carefully
Practical rules for GitHub Copilot, Cursor, and other coding assistants: branches, secrets, review, and what to do when you cannot explain the diff.
On this page
Coding assistants are useful and they are junior. GitHub Copilot and Cursor will both write a plausible function that is wrong in a way tests might miss. This is a working agreement you can adopt this week. It is not a certification. Last reviewed October 2026.
Before the first prompt
Decide where generated code is allowed. A hobby repo is not a client repo. Read the client’s contract and the tool’s current privacy settings. If private code cannot be sent to a third party, do not open that repo in the tool. The Copilot vs Cursor page lists the questions. The answers are on the vendors’ sites, and you should read them yourself.
Create a branch. The default branch is not a scratchpad.
What never goes in the prompt
- Passwords, API keys, tokens, and private certificates.
- Customer records, even “just this one row.”
- Unreleased security issues you would not put in a public ticket.
If a key has already been pasted, revoke it. Do not negotiate with the chat about whether it “remembers.”
A review you can do in one sitting
When the tool proposes a change:
- Read the diff as if a new teammate wrote it. Say out loud what it does.
- Look for new dependencies, disabled checks, and copied blocks you do not recognize.
- Run the tests you have. If you have none, do not tell yourself the tool tested it.
- Check auth, payments, file uploads, and SQL or queries built from user input. Those are where a fluent mistake becomes an incident.
- If you cannot explain a hunk, delete the hunk and write it yourself.
Ship from the branch through the same pull request you would use for your own code. The assistant does not get a faster path.
Browser builders
Replit, Bolt, and v0 can start an app from a prompt. Treat the result as untrusted code you now own. Before it is public, look at environment variables, authentication, and what happens if a stranger opens the URL. A demo login that is admin / admin is not a placeholder you can leave for the weekend.
When to turn it off
Turn the assistant off for a change you do not understand yet. Learning a codebase by accepting edits is slower than reading it. Turn it off when you are tired. The worst merges happen at the end of the day, when the diff is long and the tests are green for the wrong reason.
Write these rules in the repository’s contributor notes in your own words. A rule that lives only in a chat transcript will not be there for the next person, or for you in three months.
Questions this guide answers
Is generated code safe to merge if the tests pass?
Tests you have are necessary and not sufficient. You still need to understand the change, especially around auth, payments, and anything that touches user data.
Can I paste an API key so the tool can debug?
No. Revoke any key you already pasted. Describe the error without the secret.
Does this apply to browser builders like Replit?
Yes. A prototype is still code. Do not put production secrets in it, and do not point a real domain at it until you have read what it generated.