A practical guide to designing AI agents as structured work units: roles, guardrails, tool scopes, handoffs, and validation.
Full content
## Why this guide matters
Most people build agents as if they were magical personalities with a long prompt. That usually creates confusion, over-permissioned behavior, and brittle systems. A better approach is to design agents as **work units with a clear contract**.
An effective agent should have five things:
1. **A narrow mission**
2. **Guardrails**
3. **Defined inputs and outputs**
4. **Minimal tool access**
5. **A clear success condition**
This guide explains how to build agents in a way that is structured, secure, and useful in the real world.
## Shift the mental model: from prompts to systems
The real challenge in agent design is usually not prompting. It is organizational design:
- Who does what?
- Who is allowed to change things?
- Who only reads?
- Who verifies?
- Who asks for human approval?
- What memory does each agent need?
This is why frameworks like **AgenTopology** are interesting: they shift the discussion from “what can one smart agent do?” to “how should multiple agents cooperate?”
A useful definition is:
> **Agent design is mostly org design for software workers.**
## The four layers of a healthy agent system
### 1. Orchestrator
This agent thinks at the system level:
- what the objective really is
- which specialists to use
- what order to use them in
- when to stop
- when human approval is needed
Examples: chief-of-staff, planner, dispatcher.
### 2. Specialists
These agents have narrow expertise:
- researcher
- builder
- fact-checker
- writer
- reviewer
- memory curator
### 3. Guards
These agents or layers do not generate the main work. They protect the quality and safety of the result:
- security review
- factual verification
- schema validation
- permission gates
- output QA
### 4. Memory / context layer
Not always an agent, but always critical:
- what is known
- what was decided
- what is still open
- what should not be forgotten
## Rule 1: one agent, one job
If you cannot describe an agent in one sentence, it is too broad.
**Good examples**
- “A researcher that finds and compares sources”
- “A fact-checker that verifies claims before output”
- “A builder that turns a plan into files or drafts”
**Bad examples**
- “A super-agent that does everything”
- “An agent for research, marketing, coding, QA, and strategy”
Broad agents feel impressive but are much harder to control, evaluate, and secure.
## Rule 2: give each agent the minimum tools it needs
Security in agent design starts with **least privilege**.
Examples:
- A **researcher** usually needs read/search/fetch tools, not write access
- A **fact-checker** should often be read-only
- A **builder** may need read, write, and edit
- A **publisher** should often require human approval before external actions
If an agent does not need a tool, do not grant it.
## Rule 3: define outputs clearly
Good orchestration depends on predictable outputs.
Examples:
- Researcher → findings, sources, uncertainty
- Fact-checker → verified / unverified / contradicted claims
- Builder → files changed, summary, open risks
- Chief-of-staff → situation read, recommended next move, tradeoffs
Without defined outputs, multi-agent systems become hard to combine and review.
## Rule 4: separate role, guardrails, and procedure
A common mistake is hiding all policy inside one giant prompt. A more stable structure is:
### Role
Who the agent is.
### Guardrails
What it must or must not do.
### Procedure
How it should execute the task.
For example:
**Role:** Technical fact-checker
**Guardrails:** Do not guess; do not edit files; flag uncertainty clearly
**Procedure:** Extract claims → verify each one → classify status → return summary
## A practical starter topology
The best starting pattern is:
**Planner → Specialist → Verifier → Human**
Why this works:
- The planner turns a messy request into a path
- The specialist does the focused work
- The verifier catches errors and weak claims
- The human stays in control for important decisions
Example:
1. Chief-of-staff defines the goal and plan
2. Researcher gathers information
3. Fact-checker verifies critical claims
4. Main assistant presents the result and asks for approval if needed
## A slightly more advanced pattern: fan-out / fan-in
This is where **AgenTopology** becomes useful as a mental model.
A fan-out topology means multiple specialist agents work in parallel on different sub-angles, then a reducer or synthesizer combines their outputs.
Example from AgenTopology-style thinking:
- one analyst looks at regional markets
- one analyst looks at product categories
- one analyst looks at distribution channels
- one reducer synthesizes all three
This is powerful, but only after your simpler workflows are stable.
## Security checklist for building agents
### 1. Least privilege
Each agent gets only the tools it truly needs.
### 2. No secret sprawl
Do not place API keys or secrets in prompts, skills, markdown files, or memory files. Keep secrets in runtime config / environment / connectors.
### 3. Human approval for external actions
Anything that sends, publishes, deletes, or writes to an external system should usually require a checkpoint.
### 4. Prefer deterministic checks
If you can validate:
- schema
- JSON
- file existence
- duplicates
- URLs
then check them instead of relying on vibes.
### 5. Memory boundaries
Not every agent needs the full memory layer. Some should only see the task. Others need current-state memory. Only a few should see long-term personal context.
### 6. Log repeated failures
If an agent fails in the same way more than once, document it. Turn it into a checklist, a skill improvement, or a prompt rule.
## A simple Agent Design Spec template
Use this template before creating any new agent:
### Name
Short, clear, and role-based.
### Mission
What it does in one sentence.
### When to use
The trigger conditions.
### Inputs
What it receives.
### Outputs
What it must return.
### Allowed tools
Only the minimum required.
### Guardrails
What is forbidden or required.
**Example**
- **Name:** Researcher
- **Mission:** Find, compare, and summarize relevant information
- **When to use:** Research, source gathering, comparisons
- **Inputs:** Question, scope, constraints
- **Outputs:** Findings, sources, uncertainty
- **Allowed tools:** Read, search, fetch
- **Guardrails:** No guessing, no file edits, cite uncertainty
## A practical starter set of agents
If you are just getting started, these five cover a huge amount of real work:
1. **Chief-of-staff** – prioritization, planning, next-step thinking
2. **Researcher** – find and compare information
3. **Builder** – create artifacts, files, drafts, specs
4. **Fact-checker** – verify claims before delivery
5. **Memory curator** – maintain continuity and useful context
## What not to do
Avoid these traps:
- Building 12 agents on day one
- Giving everyone write access
- Giving everyone full memory
- Hoping they will “figure it out”
- Writing giant unstructured prompts
- Mixing role, policy, examples, and procedures chaotically
## How to learn from leading ecosystems
The fastest way to get better is to study systems that already expose their design patterns:
- **Anthropic Claude Code** – subagents, skills, plugin architecture, least-privilege tooling
- **Agent Skills** – open skill format and capability packaging
- **OpenAI Codex** – skills / tooling patterns for coding workflows
- **GitHub Copilot / VS Code** – agent skills, context engineering, and developer ergonomics
- **OpenHands** – open-source agent architecture for software tasks
- **AgenTopology** – topology-first thinking for multi-agent workflows
## Final principle
A working agent system beats a clever one.
Start simple:
- one orchestrator
- a few specialists
- one verifier
- strong memory boundaries
- strong permission boundaries
Then grow carefully.
That is how you build agents that are not only impressive in demos, but useful in the real world.