Skip to content

Use of AI for development ​

Guidelines on using AI coding agents in the course of development work.

Principles ​

Observe the following guiding principles:

Use AI to accelerate and enhance your work, not to do it for you.

Code you contribute is your code, even if an agent has written it.

The more sensitive or business-critical the work is, the more human involvement it requires.

Benefits ​

Used well, AI has real power to accelerate and enhance your abilities as a developer. Some good use cases for AI coding agents:

  • Documentation and research – asking an agent is often faster than a Google search and hunting through a poorly structured documentation site.
  • Ideation and brainstorming – conversing with an agent about a task may yield better solutions than you would otherwise have thought of.
  • Grunt work and boilerplate, e.g.
    • Scaffolding models, relationships and factories from handwritten database migrations
    • Building basic CRUD pages and API endpoints
    • Fixing linting errors
    • Dependency upgrades (review the lockfile diff – see Security)
    • Writing automated tests
  • Prototyping new ideas – a new UI, a backend performance optimisation, etc.
  • Validating your work – agents can check code you have written for bugs and flaws.

Using AI in these ways frees you up to spend more of your attention on the harder and more interesting parts of the job that really need a human.

Avoiding AI pitfalls ​

AI coding agents can produce solutions with remarkable speed, especially during the initial phases of a project, but speed is no substitute for care.

  • Review agent output as closely as code from any other source. Resist the temptation to give a plausible-looking suggestion a lighter pass than code you wrote yourself. Defects in agent output are often only found later.
  • Know the code you commit. You're responsible for supporting it, so make sure you understand it well enough to do that, rather than leaning on the agent to patch anything that goes wrong.
  • Good output requires good input. The clearer your own understanding of the problem, the better you'll be able to direct the agent toward a good solution.
  • Stay engaged. Use the time an agent saves you for other work, not as downtime. See Stay engaged.
  • Keep tasks scoped. A narrow, well-scoped task gets better results than an open-ended one, especially as a project grows. See Keep context windows small.

Take particular care in sensitive areas of an application – auth, payments, PII handling, cryptography, etc – and always get senior dev review of agent-written code there.

Risks & mitigation ​

AI coding agents also present more serious real-world risks that must be managed.

Data privacy & confidentiality ​

While AI vendors make promises about data privacy and confidentiality, there are no guarantees that these promises are and will be kept.

Any data provided to or accessible by an agent should be considered effectively public. This is a serious risk if the agent has access to live credentials or PII. An agent with live access can also do direct harm. For example:

  • Live credentials are leaked, and a malicious actor incurs high API costs or gains access to sensitive data.
  • PII is leaked and morphsites is found liable under data protection laws.
  • An agent uses live credentials to access a live API or system as part of its work, and incurs unanticipated expense or causes irreparable data loss.

DANGER

Any one of these or other serious events could have financial repercussions for morphsites, either in the form of legal action or a morphsites customer seeking reparations.

Required privacy mitigations ​

The following guidelines must be followed as a minimum:

  • Ensure any settings to 'help improve our models' or 'use your data to train' are disabled.
  • Never put live credentials anywhere an agent can read them, e.g. .env files, shell environment variables or other config files. While it is possible to set up rules to deny access to certain files, these rules are not failsafe. Agents can and will use alternative means to read and write to these files, e.g. Python or PHP scripts.
  • Never store sensitive data in a local database that an agent can access. Agents can and will query the database as part of their work.
  • Enable sandboxing (e.g. Claude Code sandboxing).
  • Never paste sensitive data into a prompt or chat. This can be easily done when pasting logs and error messages as part of an agent conversation. Redact any sensitive information first.

TIP

Using live credentials and cloning live data for local environments may seem convenient, but has never been good practice, even before the rise of AI coding agents.

However, with the help of an agent, it is now much easier to scaffold a realistic test database (e.g. with seeders and factories). This has a number of benefits aside from security and data privacy:

  • It is much easier and quicker to spin up a new local environment. This improves the onboarding experience for new developers and makes it practical to run multiple environments on the same machine.
  • Automated tests are much easier to write and maintain.
  • Seeders can be designed to create test cases to replicate issues encountered in production.

Security ​

At their core AI models work exclusively with plain text. Therefore, it is relatively easy for an attacker to plant malicious text (e.g. in third-party code dependencies) that can be interpreted by the agent as a prompt and cause it to act in unexpected ways. This is known as prompt injection.

Required security mitigations ​

The following guidelines must be followed as a minimum:

  • Apply good judgment when selecting third-party code dependencies. Consider: is the package from a reputable source? Is it actively maintained? How long has it existed? How popular is it?
  • Ensure package managers are up to date and configured to current standards. For example, configuring a minimum age of 1-3 days for dependencies can mitigate against supply chain attacks.
  • Never run untrusted content through an agent. This includes user-submitted data, issue and ticket text, scraped web pages, third-party READMEs and logs or error messages containing any of these. Review such content before giving it to an agent, and keep agents away from live systems where injected instructions could do harm (see Data privacy & confidentiality).

Attribution ​

Commits containing substantial AI-authored code should include a Co-Authored-By trailer noting the provider and model used. For example:

feat: Add new feature

Any relevant additional details.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

Agents will typically, but not always, add this by default when asked to make a commit.

TIP

Substantial AI-authored code could include a generated function, file or feature. It does not include single-line/inline autocomplete suggestions, or code you wrote yourself based on AI-provided research, explanations or ideation.

Efficiency & effectiveness ​

As of September 2026 (the date of all pricing and model recommendations in this section), AI agents are accessible via an inexpensive flat-rate subscription model. However, the economics of this are yet to be resolved, and it is very possible that in future this subscription model will change to a much more expensive 'pay for what you use' model.

Therefore, it is worth understanding what agents actually cost, and how to use them efficiently.

TIP

The habits that reduce cost also often make agent responses more relevant. So efficient and effective use go hand in hand.

Token costs ​

AI providers bill on the number of tokens used. Everything sent to the LLM – your prompt, the agent's system prompt, attached files, tool descriptions (including MCP servers), skill descriptions, conversation history and instruction files – is billed as input tokens. Everything the LLM generates in response is billed as output tokens.

For example, Anthropic publishes the following pricing (prices per 1 million tokens):

ModelTierInput $/1MCache hits $/1MOutput $/1M
Claude HaikuLightweight$1.00$0.10$5.00
Claude SonnetVersatile$2.00$0.20$10.00
Claude OpusPowerful$4.00$0.20$20.00

Note that:

  • Every time the agent sends a request to the LLM, either triggered by you or as part of its agentic loop, all previous input is sent again.
  • Input that repeats from earlier requests in your session is served from cache at the lower 'cache hit' rate, provided the previous request was within the past 1 hour.
  • Output tokens are LLM responses, whether displayed as explanations in chat, or text written to files, and cost 5x more than input tokens.

Recommendations ​

Use an appropriate model and effort level ​

The default model and effort level is often overkill for the task at hand. 'Thinking' tokens are billed as output tokens, so reducing the effort level can have a big impact on cost.

ACTION

Update your defaults to a sensible model and effort level for the majority of coding tasks. As of September 2026, Claude Sonnet 5.5 at medium effort level is very capable.

Learn from experience and develop an intuition for when a more powerful model or higher effort level is appropriate, such as research and design for complex tasks. Consider using a lower effort level for simple questions and code search tasks.

Choose the model when you start a session, and avoid changing it mid-session, since each model has its own cache. If a task needs a different model, start a new session.

Keep context windows small ​

Because every agent step re-sends the full conversation history, a long conversation gets steadily more expensive. If you return to one after it has been idle for more than an hour, the cache has expired and the whole history is processed again at the uncached rate.

During long conversations, the context window can also fill with irrelevant conversation, file contents and commands. Agents have a limited context window, and this clutter can reduce performance and distract the agent, reducing accuracy.

ACTION

Keep sessions short and focused on a single task. For example, you could:

  • Break down larger pieces of work into smaller tasks, clearing the context window between each task.
  • Save plan output to a file, then clear the context window before asking the agent to implement it.
  • Don't return to large sessions after the cache has expired. Starting a new one with the relevant context provided will be cheaper.

Keep CLAUDE.md / AGENTS.md files concise ​

These files are sent to the LLM on every interaction and every agent step, and they tend to become overly verbose. A bloated CLAUDE.md / AGENTS.md file can also cause the agent to ignore your instructions.

ACTION

Keep these files concise. If a line gives information that can easily be inferred in one step (e.g. via ls or cat composer.json), omit it. Focus instead on information that cannot be easily inferred, or would cause the agent to make mistakes if omitted.

For further guidance, see:

Install skills only when needed ​

Every skill available to the agent has its description included in the system prompt on every agent step. This adds cost and can distract the agent – especially if it starts using a skill that you didn't intend it to.

ACTION

Only install skills that you intend to use. Re-evaluate periodically the skills you have installed. Ensure they are giving you value, and are not causing a distraction to the agent – or even you!

When using Laravel Boost with supporting packages, evaluate each skill it offers to install rather than blindly accepting all of them.

Stay engaged ​

When making heavy use of AI coding agents, resist the temptation to sit and watch them work. Even while you are still producing output, passive supervision reduces your engagement with your work, leading to skill atrophy, a loss of job satisfaction and poorer reviews of what the agent produces. Watching an agent all day isn't a good use of your time.

Manage your time so a long-running agent task doesn't break your flow. Have another task to focus your attention on while the agent runs in the background. This includes responding to emails, updating Jira tickets, as well as project work.

Make good use of worktrees. Worktrees allow you to run an agent on a separate copy of the code in the background, while you continue to work on other tasks.