Designing AI Agents for Engineering Workflows
A practical mental model for agents that help with real engineering work — tools, loops, guardrails, human review and how to evaluate whether they actually help.
- #ai agents
- #llm
- #automation
- #developer tooling
Table of contents
An "agent" is just a loop: a model looks at the current state, picks an action (usually a tool call), observes the result and repeats until it's done. The interesting engineering is everything around that loop.
The basic loop
Rendering diagram…
def run_agent(goal: str, tools: dict, max_steps: int = 10) -> str:
history = [{"role": "user", "content": goal}]
for _ in range(max_steps):
step = model.next_step(history, tools=list(tools))
if step.type == "final":
return step.content
result = tools[step.tool](**step.arguments)
history.append({"role": "tool", "name": step.tool, "content": result})
return "Stopped: step limit reached"Design tools, not prompts
Agents are only as good as the tools they can call. Good tools are:
- Narrow —
list_exported_components(manifest)beatsrun_shell(cmd). - Deterministic — the same input returns the same output.
- Descriptive — clear names and argument descriptions are part of the prompt.
- Safe by default — read-only first; writes behind explicit approval.
Guardrails
- Step and cost limits on every run.
- Allow-lists for commands and file paths.
- A human approves anything that ships.
Evaluate like any other system
"It seemed to work" isn't a metric. Build a small set of real tasks with known-good outcomes and track:
- Task success rate on the evaluation set.
- Steps and cost per successful task.
- Regressions when prompts, tools or models change.
A realistic first project
Start with a release review assistant: given a build, it checks the manifest for exported components, verifies the network security config, confirms R8 is enabled and summarises findings for a human. Read-only, narrow tools, easy to evaluate — and genuinely useful.
Takeaways
- An agent is just a loop; the real engineering is the tools, guardrails and evaluation around it.
- Give agents narrow, deterministic, read-only-by-default tools, and treat everything they read as untrusted input.
- Put hard limits on steps and cost, and keep a human in the loop for anything that ships.
- Measure success against a real task set before trusting an agent inside a workflow.