Skip to content
be-human.ai
← Back to the journal

AI by industry

AI Agents for Software Engineering Teams: Code and Incident Memory

How engineering teams can prepare repo, runbook and incident memory, sandboxed execution and human merge approval before handing work to coding agents.

Nested oak boxes with a green marble cube in the innermost one stand beside a brass balance scale on a sunlit travertine slab.
Conceptual illustration created with AI · Be Human

AI agents for software engineering teams work best when they have a narrow role, a written memory of how your code and incidents actually behave, a sandbox to run in, and a human who approves every merge. Coding agents will keep getting more capable, so the durable work is the setup around them: repo notes, runbooks, incident history, permissions and review rules. A team that builds this foundation can adopt a stronger agent later without redrawing its boundaries.

Key takeaways

  • Start with one role, such as triaging failing builds or drafting fixes for labeled issues, not a general engineering assistant.
  • Give the agent written memory in files people can read and correct: repo conventions, runbooks and incident history.
  • Run every command in a disposable sandbox with scoped, expiring credentials and no path to production.
  • Keep merges and deployments human, and make the agent's pull request easy to review.
  • Define one observable success criterion and keep traces, so a more capable model can replace the current one as a controlled change.

What should an agent actually do on an engineering team?

Engineering work has two rhythms. Planned change covers features, refactors, dependency updates and tests. Unplanned work covers incidents, flaky builds and noisy alerts. Agents can help with both, but the shape of the help is different.

On the code side, an agent takes a scoped ticket, reads the repo, makes a change on a branch, runs the tests and opens a pull request that explains what it did. On the incident side, it gathers context, lines up alerts against recent changes, finds the matching runbook, drafts a timeline and proposes a mitigation for a person to run. In both cases the agent prepares and a human decides.

Published guidance on building effective agents favors simple, composable workflows over elaborate autonomy, and that is a sound rule for a first role. Use this decision guide to choose where to begin:

  • Good first fit: work that happens often and that your team already understands well.
  • Good first fit: changes that are easy to reverse and easy to check with a test or a short review.
  • Good first fit: read-only incident support, such as collecting logs, recent deploys and similar past incidents into one summary.
  • Poor first fit: schema migrations, permission changes and anything that touches customer data directly.
  • Poor first fit: ambiguous work where the team itself disagrees about the right answer.
  • Poor first fit: production changes during an active incident, where speed pressure hides mistakes.

What memory does a code and incident agent need?

An agent that starts every task from zero will repeat every mistake a new hire would make, and it will do so quickly. Memory is what turns a capable model into a useful colleague. For engineering, three layers matter.

  • Repo memory: how the code is organized, which commands build and test it, naming and style conventions, who owns which area, which parts are fragile, and what a good pull request looks like on this team.
  • Runbook memory: the steps for known failure modes, the conditions that trigger each one, which steps are safe for an agent to suggest, and which are reserved for a named human role.
  • Incident memory: past incidents with symptoms, cause, mitigation, follow-up work and what the team would do differently, written in plain language.

Keep this memory as plain documents the agent retrieves at the moment of need, rather than baking it into the model. Facts about your system change every week, and retrieval lets you correct a page instead of retraining anything. Every page should have an owner and a review date, because a stale runbook is worse than none. The agent should also be able to propose edits to its own memory through a normal pull request, so people stay the editors.

The same pattern appears outside product teams. IT operations teams face the same need for runbooks and ticket history, and the preparation work is nearly identical.

A small oak loom holding a woven ivory band made of three differently textured layers, with a brass measuring tape and a glass vessel beside it on linen.
Conceptual illustration created with AI · Be Human

How should sandboxed execution work?

An agent that can run code can also run the wrong code. A sandbox limits the damage so that mistakes stay cheap. Treat it as the default place where the agent works, not as an extra for risky tasks.

Use this checklist when you set one up:

  • A fresh, disposable environment per task, built from a clean checkout of the repo.
  • No production secrets, no production database and no network route to production systems.
  • Outbound network access limited to an allowlist, such as your package registry and internal documentation.
  • Credentials scoped to one repo and one purpose, short-lived, and revoked when the task ends.
  • Limits on time, compute and the number of files the agent can change in one task.
  • Full logs of commands, outputs and file changes, kept after the sandbox is destroyed.

Two security ideas deserve particular attention. First, authorization: OWASP authorization guidance recommends least privilege and denying access by default, which fits agents well. Give the agent only the permissions its role needs and check them on every action, not once at login.

Second, prompt injection. An agent reads issue text, log lines, dependency files and web pages, and any of these can contain instructions written by someone else. OWASP's prompt injection prevention guidance is clear that untrusted content must be handled as data and not as commands. In practice that means the agent's permissions, not its good judgment, are the real protection. If a poisoned log line tells the agent to send out a secret, the sandbox should leave it with no secret to send and nowhere to send it.

Why keep a human merge approval, and what should the reviewer see?

Passing tests do not prove a change is right. An agent can write a test that confirms its own mistake, or satisfy a check without solving the problem. A human merge approval is the point where intent, context and responsibility come together, and it should not be optional or quietly delegated to another agent.

Enforce the rule with the platform, not with politeness. Branch protection should prevent the agent's identity from approving or merging its own work, and deployment should require a person with the right role. For incidents, the agent can have read access to observability data (logs, metrics and traces, as described in the OpenTelemetry observability primer) and can propose actions, while a named human runs anything that changes production.

The review is only as good as the packet the agent hands over. Ask for the same structure every time:

  • The goal, restated in the agent's own words, so misunderstandings show up early.
  • The files changed and the reason for each change.
  • The commands run, with results, and anything that could not be run.
  • What was not verified, stated plainly.
  • The risk of the change and how to roll it back.
  • The memory pages the agent relied on, so the reviewer can spot outdated guidance.

A short, consistent packet makes review faster over time, and reviewers learn where this particular agent tends to be weak.

What is a practical plan for getting ready?

This plan assumes one team, one repo and one role. It is meant to be finished in order, because each step makes the next one safer.

  • Write the role in one paragraph: what the agent does, what is out of scope and who it reports to.
  • Collect the memory: repo notes, the runbooks for the most common failures and a short summary of recent incidents. Assign an owner to each page.
  • Build the sandbox and test that it really has no route to production or to real secrets.
  • Set permissions per tool: which repos, which branches, which read-only data sources, and which actions are never allowed.
  • Define the approval boundary: who reviews code, who approves a production action, and what the agent must do when it is unsure.
  • Choose one observable success criterion, such as reviewers accepting agent pull requests on routine tickets without rework, and decide how it will be recorded.
  • Run in shadow mode first: the agent drafts, people do the work as usual, and the two are compared.
  • Review traces on a regular schedule, fix the memory where the agent went wrong, and keep a small set of fixed test tasks.

That last item is what makes upgrades safe. When a more capable model arrives, run it against the same test tasks and the same review packet before it touches live work. Guidance on evaluating agents consistently points to this habit: define the tasks, grade the outcomes, then change one thing at a time.

Product teams that receive bug reports through support will find that SaaS company workflows offer a good source of well-labeled tickets for the first role.

What does this look like in practice, and how does Be Human run it?

Here is an illustrative scenario, not a real case. A small product team has a recurring problem: a background job stalls after certain deploys. An alert fires, and the agent collects the last deploys, the relevant logs and two similar entries from the incident history. It finds the matching runbook and drafts a timeline. It then proposes a restart and, on a branch inside the sandbox, a fix for the cause the earlier incident identified. The on-call engineer reads the packet, runs the restart herself, and later approves the pull request after asking for one more test. Afterwards the agent drafts the incident note, the team corrects it, and the corrected note becomes memory for next time.

Notice what stayed human: the production action, the merge and the final wording of the record. Notice what the agent did: gathering, matching and drafting, which is where most of the time usually goes.

Be Human designs, implements and operates this kind of setup remotely, in English and Portuguese. A first engagement defines one useful role, the memory and tools it needs, the approval boundaries and an observable success criterion. Managed operations can include monitoring, recurring evaluations, integration maintenance, permission review, incident response and controlled improvements, so a stronger model arrives as a reviewed change and not as a surprise. Teams that already coordinate work through operations processes often find the approval structure familiar.

If you want to find the first task worth handing to an agent, take the free Be Human AI diagnostic.

Frequently asked questions

Will AI agents replace software engineers? Not in the setup described here. The agent handles preparation, such as reading, drafting, testing and summarizing, while engineers keep decisions, merges and production actions. The work shifts toward writing clearer tickets, better runbooks and sharper reviews.

What is the safest first task for a coding agent? Pick something frequent, reversible and checkable, such as fixing small labeled issues or updating a dependency with its tests. Read-only incident support, where the agent assembles context for the on-call engineer, is also a low-risk start. Avoid migrations, permission changes and anything involving customer data until the review habit is solid.

Do we need to fine-tune a model on our codebase? Usually not. Retrieval from well-kept repo notes, runbooks and incident records is easier to correct and audit, because you can edit a page when the facts change. Fine-tuning can be considered later for specific needs, but memory and permissions come first.

How do we prepare for more capable agents? Build the parts that do not depend on any one model: the sandbox, scoped credentials, written memory, the review packet and a fixed set of test tasks. When a stronger model appears, run it through those same checks before it handles live work. The boundaries stay the same while the capability improves.

Your next step

See where an AI agent fits in your company first.

Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.

Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.

Less busywork. More room for you.

Bring us the work you wish you had time for.

Book a call to try a personalized AI agent free for 7 days ↗Or take the free AI diagnostic →