AI Agent Architecture Patterns: Tools, Planning, Memory, Permissions, and Human Approval
AI agentstool callingworkflow automationAI securityorchestration

AI Agent Architecture Patterns: Tools, Planning, Memory, Permissions, and Human Approval

NNext-Gen Cloud Editorial Team
2026-11-13
7 min read

A practical checklist for choosing AI agent patterns, defining tools, enforcing permissions, adding human approval, and handling failures.

Designing an AI agent is less about giving a model more tools and more about controlling what it can do, when it can do it, and how a failure is handled. This guide provides a reusable checklist for choosing an AI agent architecture, defining tools, managing memory, enforcing permissions, adding human approval, and tracing unreliable runs.

Overview

An AI agent combines a language model with instructions, tools, state, and an execution loop. The model may decide which action to take, but the surrounding application should define the boundaries. Treat the model as a decision-making component inside a controlled workflow rather than as an unrestricted operator.

The right architecture depends on task complexity, risk, and the amount of deterministic control required. A useful starting point is to separate five concerns:

  • Reasoning and planning: how the system interprets a request and selects the next step.
  • Tool execution: how the agent calls APIs, searches data, runs code, or changes records.
  • Memory and state: what information persists between steps or sessions.
  • Permissions: which identities, resources, and operations are available.
  • Approval and recovery: when a person must review an action and what happens after failure.

Keep these concerns observable and independently testable. A prompt can describe desired behavior, but it should not be the only security or reliability control. For context design, retrieval, and summarization decisions, see the LLM context window management guide. For broader threat review, use the LLM application security checklist.

Architecture comparison

PatternBest fitStrengthPrimary concern
Single agentSmall task set with low operational riskFast to prototype and simple to operateTool choice and reasoning can become difficult to predict
RouterDistinct request types or specialist toolsLimits each path to a relevant set of instructions and capabilitiesMisclassification can send work to the wrong path
SupervisorMulti-step work requiring specialist agentsCentral coordination with delegated subtasksMore state, latency, and cross-agent failure modes
Workflow-basedRegulated, repeatable, or high-impact processesExplicit transitions, approvals, and retriesLess flexible when requests do not match the designed flow

Start with the least complex pattern that meets the use case. A deterministic workflow with a few model-assisted steps is often easier to evaluate than a general-purpose autonomous loop. Add routing or delegation only when a clear boundary improves quality, security, or maintainability.

Checklist by scenario

For a single tool-using agent

  • Write a narrow objective and define what “done” means.
  • Limit the initial tool set to the smallest set needed for the task.
  • Set maximum turns, time, cost, and tool-call limits.
  • Return structured results from tools, including error codes and retry guidance.
  • Log the user request, prompt or instruction version, tool arguments, results, and final response.
  • Test ambiguous requests, malformed arguments, empty results, timeouts, and duplicate calls.

For a router or multi-agent system

  • Define routing categories with examples and an explicit “uncertain” route.
  • Give each specialist only the tools, context, and data it requires.
  • Specify the supervisor’s authority: delegate, approve, summarize, or execute.
  • Use a shared task identifier so events across agents can be traced.
  • Prevent agents from silently changing another agent’s work or assumptions.
  • Define a fallback path when classification confidence is low or a specialist fails.

For a workflow-based agent

  • Represent each state and transition explicitly.
  • Mark actions as read-only, reversible, or consequential.
  • Attach validation rules before transitions, not only after completion.
  • Make retries idempotent where possible, so repeating a request does not create duplicate effects.
  • Persist checkpoints so a failed run can resume without replaying unsafe actions.
  • Provide a manual pause, cancel, and resume operation.

Tool-definition template

Every tool should have a contract that a model can understand and an application can validate. Document it in a format similar to this:

{
  "name": "create_ticket",
  "description": "Create a support ticket after required fields are confirmed.",
  "inputs": {
    "title": "string, required, maximum length enforced by the server",
    "priority": "enum: low, normal, high",
    "project_id": "string, selected from the user's permitted projects"
  },
  "side_effect": "creates an external record",
  "approval": "required before execution",
  "timeout_seconds": 15,
  "errors": ["validation_error", "permission_denied", "temporary_failure"]
}

Descriptions should explain constraints and side effects, not merely repeat a function name. Validate every argument on the server. Never rely on the model to enforce authorization, ownership, or data boundaries.

For high-impact actions with human approval

  • Pause before sending messages, changing records, spending funds, publishing content, or deleting data.
  • Show the proposed action, exact arguments, affected resources, and relevant evidence to the reviewer.
  • Require an explicit approve, reject, or edit decision.
  • Expire stale approvals when the underlying data or arguments change.
  • Record who approved the action, when, and which version of the workflow produced it.

What to double-check

Permissions and data boundaries

Use least privilege for both the agent and each individual tool. Separate read and write credentials, scope access to the current user or tenant, and avoid exposing broad database or shell access through a convenient wrapper. Check authorization at execution time because a prior model decision or cached result is not proof of permission.

Review data sent to models and external services. Identify secrets, personal information, internal instructions, and untrusted document content. Retrieved text can contain instructions that conflict with the task; treat it as data to analyze, not as authority. The AI agent development guide provides a companion view of reliable tool-using patterns.

Failure handling

  1. Classify the failure: distinguish invalid input, denied permission, unavailable service, malformed output, and uncertain results.
  2. Stop unsafe progress: do not continue automatically after a failed consequential action.
  3. Retry selectively: retry temporary failures with a bounded policy; do not repeat validation or authorization failures.
  4. Recover context: reload the last trusted checkpoint and avoid assuming that an interrupted action did not occur.
  5. Escalate clearly: give the user or operator the run identifier, failed step, safe next option, and any action requiring verification.
  6. Capture the trace: retain enough structured information to reproduce the decision without storing unnecessary sensitive content.

Evaluate the complete workflow, not only the final answer. Test tool-selection accuracy, argument validity, refusal behavior, permission enforcement, approval gates, latency, cost, and recovery. A dedicated LLM evaluation framework can help organize these checks, while a versioned prompt and evaluation dataset make regressions easier to identify.

Common mistakes

  • Starting with autonomy: A broad agent may hide unclear requirements. Begin with a narrow workflow and expand only after measuring it.
  • Using prompts as permissions: “Do not access customer records” is not an access-control mechanism. Enforce the rule in the tool and service layer.
  • Giving tools vague names and descriptions: Ambiguous contracts increase incorrect calls. State inputs, outputs, side effects, and failure conditions.
  • Allowing unbounded loops: Set limits for turns, tool calls, elapsed time, tokens, and spending.
  • Skipping idempotency: A retry can create duplicate tickets, payments, messages, or updates. Use request keys and verify external state.
  • Hiding uncertainty: If the agent cannot verify a result, expose that state and route it to a person or a safer fallback.
  • Logging only the final answer: Without prompts, tool arguments, results, versions, and approvals, debugging becomes guesswork.
  • Changing prompts without regression tests: Store prompts as versioned assets and test representative cases before release. See the prompt version control guide for a practical workflow.

When to revisit

Review the architecture before seasonal planning cycles, major workflow changes, and any expansion of the agent’s tools or data access. Revisit it after changing the model, SDK, tool-calling convention, retrieval source, prompt, approval policy, or authentication design. Provider capabilities and framework APIs can change, so verify examples and integration assumptions after major releases rather than treating them as permanent.

Use this short operational review:

  1. List every tool, side effect, credential, data source, and approval gate.
  2. Compare current permissions with what each scenario actually needs.
  3. Replay recent failures and one representative sample from each important workflow.
  4. Check whether traces identify the responsible prompt, model, tool, user, and workflow version.
  5. Run adversarial tests for prompt injection, data leakage, confused-deputy behavior, malformed arguments, and repeated actions.
  6. Confirm that pause, cancellation, rollback, escalation, and manual recovery still work.
  7. Update documentation, test cases, and runbooks before enabling new capabilities.

A reliable AI agent is not defined by how independently it acts. It is defined by whether its actions are bounded, explainable, reversible where possible, and easy to stop. Choose the simplest architecture that fits the task, make every tool explicit, enforce permissions outside the model, and treat evaluation and review as ongoing parts of AI workflow automation.

Related Topics

#AI agents#tool calling#workflow automation#AI security#orchestration
N

Next-Gen Cloud Editorial Team

AI Development Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.