Using an AI coding assistant with guardrails

Published 2026-11-06

Leverage, not autopilot

An AI coding assistant is most useful as a fast pair: it reads a large codebase quickly, drafts changes, writes tests and explains unfamiliar code. It is least useful, and most dangerous, when treated as an autopilot that is trusted to run commands without review. The rules below keep the first and avoid the second.

Scope the permissions

Give the assistant read access freely, write access to the working tree, and nothing else by default. Commands that touch databases, servers, billing or secrets should require explicit approval each time. A permission mode that asks before running unknown commands costs a few seconds and prevents the expensive mistakes.

Keep production credentials out of its reach altogether. If it needs to look at a server, give it read-only access to logs rather than a shell with write rights.

Work in small, reviewable steps

Ask for one change at a time and read the diff. Run the tests, build the project and check the result in the real application. A confident-sounding explanation is not evidence; a passing test and a working screen are. For anything that changes data, ask for the plan first: which tables, what SQL, how to roll back.

Write the rules down

Project instructions files let you record conventions once: naming, forbidden commands, how deploys work, which directories are generated. The assistant reads them at the start of every session, which removes a large class of repeated corrections and encodes hard-won lessons, such as never running a destructive migration command against a real database.

Own the result

Whoever merges is responsible for the code, whoever wrote it. Review AI-written code as you would a colleague's, with extra attention to security-sensitive paths, error handling and edge cases the tests do not cover. Keep humans in charge of what is built and what is released; let the assistant raise the speed of everything in between.

© 2026 The Good Fellas