Using an AI coding assistant without losing control
By Kallistesoft · · 3 min read
We use AI coding assistants every day, on our own apps and on client work. The speed-up is real, but they replace neither judgment nor accountability: generated code is still your code.
Where it helps, where it fails
It shines when the result is easy to verify: boilerplate (models, serialization, forms), edge-case tests, mechanical refactors, and exploring unfamiliar code ("where is session expiry handled?").
Its mistakes are rarely spectacular, they are plausible: invented APIs and methods, concatenated SQL (see the OWASP Top 10), client-only validation, a dependency added for ten lines of code, tests that mirror the implementation instead of checking it. It also knows nothing about your conventions or why a strange workaround was left there three years ago. Concurrency, performance on a modest device and overall architecture still need a human.
Review it like a new teammate's code
Golden rule: never merge what you cannot explain.
- Read the whole diff, not the assistant's summary.
- Look for what is missing: handled errors, edge cases, resource cleanup.
- Check every new dependency (exact name, license, maintenance).
- Run the code: compiling is not working.
Keep the tests green and the pull requests small
Write the tests before the change, and never let the assistant "fix" a failing test without understanding why it fails: bending the test to the bug is the slipperiest slope there is. Nothing merges while CI is red.
An assistant produces a thousand lines in five minutes, but nobody reviews them properly. One intent per pull request, a few hundred lines at most, one commit per healthy step: if things go sideways you step back without throwing everything away.
Secrets and privacy
Anything you send may leave your machine. Never paste keys, passwords or .env files (if you did, rotate the secret). Use fake data, never customers'. Read the tool's terms on retention and model training. Check your contracts: some clients forbid sending their code to a third party. Run a secret-scanning tool (GitHub offers one) before each commit (GitHub offers one).
Context that gets good results
- A precise goal: "add email validation to
SignupFormand a test for empty and invalid input", not "improve the form". - Explicit constraints: language version, allowed libraries, "do not touch the public API".
- An existing example from the project and a conventions file at the repository root (build and test commands, things to avoid).
- Plan first, then implement. Start fresh with clean context when the conversation gets muddled.
A team policy template
| Topic | Rule |
|---|---|
| Accountability | The PR author answers for the code, written or generated. |
| Tools | Approved list; business plans only for client code. |
| Forbidden data | Secrets, personal data, uncleared NDA code. |
| Review | Reviewed by another person, full diff. |
| Tests | Added or updated, CI green. |
| Dependencies | Every new library is justified. |
Conclusion
An AI assistant is an excellent accelerator for someone who already knows what they want. Keep tasks small, tests demanding and review intact: the best teams are not the ones generating the most code, but the ones that understand everything they ship.
Sources
- GitHub — About secret scanning
- GitHub — Helping others review your changes
- OWASP — Top 10 for LLM Applications