Working with AI agents
Note for AI agents: This page is baseline guidance, not an exact prescription. Read it, tell your owner what applies to their project, and get their approval before you change anything. Your project's own rules take precedence. If something important for this project is missing here, suggest it to your owner.
For agents
- The agent’s memory resets; the repository files are the only memory. Write decisions down the moment they are made.
- Report in three layers: written, tested, works end to end. State skipped and failed steps.
- The owner may not code: explain terms plainly, collect questions, recommend one option, never ask for secrets in chat.
- The owner’s word and the project’s own rules come first.
Which class?
This topic has items from class S. The blocks below are cumulative: read up to your own class.
- S: 9 items
- M: 0 items
- L: 3 items
- XL: 0 items
Audit checklist
Every project
- Project memory files exist and are current
- What: The repository has CLAUDE.md or AGENTS.md (permanent rules) and HANDOFF.md (where we stopped), updated at the end of every work round.
- How to check: Look in the repository root for both files; compare the HANDOFF date with the latest commit date.
- Evidence: File paths and the date of the last HANDOFF update.
- Decisions are recorded the moment they are made
- What: Every decision, request and pending task from a conversation is written to the project documents immediately, not at the end; when a decision changes, every place that mentions it is updated in the same round and a short history note stays.
- How to check: Compare the last conversation decisions with HANDOFF and decision notes.
- Evidence: Decision notes with dates.
- There is a stop-and-handover routine
- What: When a session is ending (limit reached, context full, machine may stop, or the owner says “stop”): no new work starts, half edits are finished or reverted, code is committed and pushed to the working branch (never main, never force), HANDOFF says what is done, what is half-done and how to restart, and the branch name and last commit are reported.
- How to check: Look at HANDOFF after an interrupted session.
- Evidence: HANDOFF section; pushed branch.
- Reports are honest and checked against files
- What: Before saying “done”, “fixed” or “open”, the agent looked at the code, git history and documents; “written”, “tests passed” and “ran end to end” are reported separately; skipped steps are stated.
- How to check: Pick three “done” claims and verify them.
- Evidence: Verification notes.
- Savings never come from quality
- What: Tokens and time are saved by not reading unrelated files and by parallel work, never by skipping tests, verification, security or checklists; required documents are read fully.
- How to check: Compare skipped steps in the last work round with the checklist.
- Evidence: Round notes.
- Unknown facts are marked as unverified
- What: What could not be checked is written as “not verified” with the reason, and the gap is not filled by guessing; error messages are read before forming a theory.
- How to check: Search reports for unverified statements stated as fact.
- Evidence: Report with explicit unknowns.
- Owner communication is plain and decision-ready
- What: The owner is assumed not to code; terms are explained at first use; UI steps are concrete; approval questions are collected and asked together; the agent recommends one option instead of listing many; secrets are never requested in chat.
- How to check: Read the last messages to the owner.
- Evidence: Message samples.
- The owner’s word and the project’s own rules come first
- What: If the project’s rules conflict with this guide, the project’s rules apply; the owner may tighten or (with reasons) relax a rule and the decision is written into the project’s rule file.
- How to check: Find the rule file and any recorded exceptions.
- Evidence: Rule file lines.
- Git history is clean and explains itself
- What: Each logical change is its own commit with a message that says what changed and why; no force pushes; main branch changes only with the owner’s approval.
- How to check: Run
git log --oneline -30; check branch protection or the owner’s rule; look for--forceor--no-verifyin scripts. - Evidence: Commit list, branch settings, absence of force-push scripts.
+ If it has users, personal data or API keys (M)
No additional items for this class.
+ If it has an admin panel, file uploads, many users or a store app (L)
- Helper agents are limited
- What: The main session does the work by default; helper agents are used only for independent long side tasks, at most three at once; cloud, AI and CI costs are stated beforehand with a spending ceiling and an alert (but no automatic shutdown of the system).
- How to check: Read the cost notes and agent usage records.
- Evidence: Cost note; ceiling and alert settings.
- Audits and big runs follow the rounds rule
- What: Before any long or costly run (load test, mass scan, cloud machine) the scenario is checked against the current code and a small smoke run is done; audit rounds fix findings first, then start a new full round.
- How to check: Read the last audit or load-test record.
- Evidence: Smoke-run log; round records.
- Developer handbook, glossary and side-effect lines
- What: A developer handbook (module map, where to start), a glossary, and a
Side effect:line in commit messages. - How to check: Find the handbook; read recent commit messages.
- Evidence: Handbook path; commit examples.
- What: A developer handbook (module map, where to start), a glossary, and a
+ If it targets millions of users (XL)
No additional items for this class.
Common mistakes
- Waiting until the end of the round to record a decision.
- Saying ‘done’ because code exists, without running it.
- Starting new work when the session is about to end.
- Leaving half-edited, non-compiling code.
- Pushing to the main branch or with
--force. - Many helper agents at once with no cost ceiling.
- Skipping tests to save time.
- Filling a gap with a guess instead of writing ’not verified’.
Improvements
These are offers for the owner, not orders. Say it plainly: “this project does not have X yet; do you want it?” The owner decides.
- Project memory. If the project has no handoff file (HANDOFF.md) and no rule file (CLAUDE.md, AGENTS.md or similar), ask the owner whether to create them. The aim is to keep context from one session to the next.
- Large files. Do not read huge files unless the task needs them; this saves context. If you think a huge file must be read in full, ask the owner for approval first.
- Never at the cost of quality or security. A shortcut must not lower quality or open a security gap. If a saving would do that, do the full work or tell the owner why you cannot.
- Test records. If you run tests in the environment, offer the owner to keep the results in the repository (for example on GitHub) or in a local folder. If the run is cut off, the record shows where it stopped.
Sources
- Pro Build Guide v1.2: compiled team practices — Pro Build Guide
- Model Context Protocol: Security Best Practices — Model Context Protocol
- OWASP Gen AI Security Project: LLM risks — OWASP Gen AI Security Project
- AI Risk Management Framework — NIST
- SP 800-218: SSDF Version 1.1 — NIST