Module 6 · AI Coding Workflow · Lesson 14 of 34
Working safely with coding agents
Context files, sandboxes, secrets, dependencies and review: guardrails for AI-written code.
In this lesson · about 16 minutes
- Give a coding agent the project context it needs
- Keep secrets and production systems out of reach
- Spot the common risks of AI-written code in review
Give it the project's context
Many coding agents read a project instructions file at the start of every task (often a Markdown file in the repository's root). Put the things a new developer would need on day one:
- How to install, build, run and test the project.
- Code style and conventions ("use the existing
logger, not print"). - Where things live, and what not to touch.
- Gotchas you have learned the hard way.
Guardrails
- Sandbox: let the agent run code in a container or a branch, never directly on production.
- Secrets: keep API keys and passwords in environment variables or a secrets manager, never in code or prompts.
- Permissions: allow safe commands freely (run tests, read files); ask before risky ones (install packages, push, delete).
- Review gate: every change goes through a pull request and a human review before it merges.
Sorting drill
Safe or risky?
Sort each practice.
- Letting the agent run the test suite on its own branch
- Pasting the production database password into the chat so it can debug
- Accepting a new dependency the AI suggested without checking it exists and is maintained
- Asking the agent to explain a part of its change you do not understand
- Merging a 2,000-line AI change after skimming the summary
- Keeping a project instructions file with build and test commands
0 of 6 sorted
Check your understanding0 of 2 correct
Write the first draft of a project instructions file.
Consider these questions and write down your thoughts. What you write stays on this device.
Quiz score: 0 of 2
Written by Noviq Academy in its own words. The simulators are small teaching models that keep the real idea and leave out the scale; their numbers (prices, speeds, scores) are illustrative. Model names, prices and features change quickly, so check your provider's current documentation before you build. Read-aloud uses your device's built-in voices.