How to use a coding agent safely in an unfamiliar codebase
Brief
Kiro recommends building checkable evidence before letting a coding agent modify unfamiliar code.
Establish what the code does
- Ask the agent to identify relevant packages and entry points, cite files for its claims, and trace a known working example.
- Turn the trace into characterization tests that capture current behavior; distinguish observed facts from inferences and verify assumptions with tests or an owner.
Set boundaries and supervision
- Write down the permitted scope before implementation; characterization tests protect behavior, but do not prevent unrelated edits.
- Use evidence and the reach of a potential mistake to set autonomy. Supervise public API, migration, security, and concurrency changes throughout.
Retain useful checks
- Keep tests that protect intended behavior, and remove exploratory tests and ticket-specific steering after the work ships.
- Kiro suggests using hooks to run affected tests and packaging reusable prompts and boundary templates as a skill.
Generated by AI from the original article. Check the source for full details.