Skip to main content

AI Agents Explained

Understand how AI agents combine models, tools, context, and actions to accomplish tasks.

By Hidden AI Concepts8 min read
Tags:AI ModelsOrchestration

Deep Understanding Hub

Understand AI agents as bounded, tool-using applications

A concept-first guide to how applications combine models, context, tools, state and controls in a repeated loop. Built for clarity, not hype.

What this covers

The agent loop, proposals, execution, observations, state, permissions and failure modes.

How to use it

Read end-to-end, or jump to the section that matches your question.

Visual aids

Conceptual diagrams and an interactive agent map support the text.

Evidence posture

Claims are grounded in the cited OWASP reference and framed with scope and limitations.

01

A model is not an agent

An agent is an application organized around a repeated cycle; the application decides which tools and actions are available.

02

Proposal is not execution

A model can suggest a query or action; application code validates and carries it out under configured permissions.

03

State is a design choice

Short-lived task state and persistent memory require separate decisions about scope, lifetime and correction.

04

Boundaries are responsibilities

Step limits, error handling, human approval and careful response design remain application responsibilities.

Agent architecture

AI Agents: Loop, Context and Control

Explore how an application can repeat a cycle of context, a chosen step, a tool action and an observation. The flows shown are conceptual patterns, not required architectures.

Map scale: 100%.

Select or focus a component or relationship to highlight its connections. Arrows show conceptual patterns, not required sequences.

Model / decisionTools / contextState / responseControl / review
System context · AI Agent

Relationships

  1. State / memory → Contextcarries forwardRetained information can be included in a later step when the application chooses to provide it.
  2. Context → Choose a stepinforms stepThe model receives the selected context and chooses a next step.
  3. Choose a step → Tool executionproposes actionA proposal is checked by application code before any tool is called.
  4. Tool execution → Observationreturns resultThe tool result becomes new context for the application to use.
  5. Observation → Contextfeeds backA loop may continue when an observation informs another step.
  6. Choose a step → Responseanswers / stopsA system may answer, ask a question, report a limitation or stop at a limit.
  7. Context → State / memorytask stateKeeping results while composing one answer is temporary task state.
  8. Permissions → Tool executionauthorizesModel instructions alone are not an enforcement boundary.
  9. Human review → Choose a stepapprovalHuman approval can be required for consequential actions.
  10. Response → Human reviewreviewed outputAgent behavior sits inside a wider AI system with data, software and operating controls.

To understand an AI agent, look at what the model receives, what the application lets it do, and how the results are handled. This article uses a practical definition and one example to explain the mechanism.

Deep dive

What Is an AI Agent?

A model computes an output from an input according to its design and learned parameters. A language model can generate text from a prompt; that alone does not give it access to files, websites, or account actions.

An application connects a model to a user and other components. It can assemble a prompt, call a model service, display the response, or call a search tool. The application determines which components are connected and handles their data.

Here, an agent means an application organized around a repeated cycle: a model or other decision procedure selects a next step, an allowed action is carried out, and the result informs whether to continue. This is HAC’s operational teaching definition, not a universal one. Research papers, products, and teams use “agent” in different ways.

A model may propose a search query, but the application executes it. Text that looks like an instruction is not automatically an authorized operation; the system determines which actions are available and under what permissions.

Deep dive

The Agent Loop

This simplified HAC teaching model describes a possible tool-using workflow, not a required architecture:

  1. Prepare context. The application collects the request and relevant information.
  2. Choose a step. The model or decision logic selects whether to answer, clarify, or request an action.
  3. Execute. The application checks that the action is available and permitted, then calls the tool.
  4. Observe. The tool result is returned as new context.
  5. Continue or stop. The system may take another step, ask a question, report a limitation, or answer.

Conceptual diagram

Conceptual five-step agent loop showing context preparation, choosing a step, executing a permitted tool call, observing the result, and continuing or stopping.
Conceptual view: a possible tool-using workflow, not a required architecture.
Diagram: Hidden AI Concepts

Consider an illustrative documentation-search assistant. A user asks, “Where does the setup guide explain how to configure a timeout?” The application gives the question and search capability to the model. The model proposes a query; the application checks permission and runs it. A tool returns two passages with titles and links. The model can compare them and draft an answer, ask which guide the user means, or report that the results are unclear.

This example was created for this article; it is not a measured system or a universal sequence. “The model searched” is shorthand: software with document access performed the search. Without that tool, a model might produce a plausible response without checking the current guide.

The result also changes what a responsible answer can say. If the search returns no matching passage, the application should not describe an unperformed search as successful. If it returns two conflicting instructions, the model should not silently treat one as authoritative unless the application has a reliable rule for resolving that conflict. It can instead report the ambiguity, link both results, or ask the user which document applies. These are choices in the application’s response design, not capabilities guaranteed by adding a model to a search tool.

Systems can combine or rearrange these steps. An application may make one model call, use fixed code, require approval, or stop after a limit. Ask what chooses and executes each step rather than relying on the label “agent.”

Deep dive

Models, Tools, Context, and State

An agent-oriented application separates three events:

  • Proposal: the model returns text or structured data suggesting a query, tool, or next step.
  • Execution: application code validates the proposal and calls an available tool under the application’s configured permissions.
  • Observation: the application receives the tool result and decides what information to provide for the next step.

A proposal is not execution. The application can reject a malformed request, disallow a tool, require confirmation, or return an error. This separation enables control but does not guarantee that checks are implemented correctly.

Conceptual diagram

Conceptual diagram separating a model proposal, application validation and tool execution, and the observation returned as new context.
Conceptual view: a proposal becomes an action only through application code and configured permissions.
Diagram: Hidden AI Concepts

Context is information available to the model during a processing step, such as the request, selected conversation history, tool descriptions, and results. The application chooses what to include; omitted information cannot guide that step unless obtained another way.

State is information the application keeps to coordinate work. Short-lived state might track reviewed search results. Persistent memory retains information beyond a run so it can affect a later one. The application must store and retrieve it and manage its scope and lifetime; including earlier conversation messages as context is not necessarily durable memory.

For example, keeping the search results while composing one answer is temporary task state. Remembering a user’s preferred documentation version next week would be persistent memory and requires a separate decision about whether to retain that preference, how to update it, and how to let the user correct or remove it. A system should not imply that it will remember something merely because it appeared earlier in a conversation.

Conceptual diagram

Conceptual diagram distinguishing context chosen for a processing step, application-held state with a chosen lifetime, and tools whose access comes from implementation and credentials.
Conceptual view: context, state and tools are different responsibilities in an agent-oriented application.
Diagram: Hidden AI Concepts

Tools expose capabilities through software interfaces, such as searching documents or retrieving a record. Their behavior and access come from implementation and credentials, not the model’s wording. A search limited to public setup documents should not gain access to private files because the model asks.

Orchestration is application logic that prepares context, interprets responses, invokes permitted tools, handles errors, and decides when to return control. The model, code, and a human may each have different roles. These categories are explanatory, not a standard component list.

Deep dive

Control, Permissions, and Failure Modes

The ability to call a tool differs from authority to use it. Policy may restrict who can request an operation, which records it can affect, or when a person must approve it. Model instructions alone are not an enforcement boundary.

For documentation search, HAC recommends restricting the collection, limiting calls, validating inputs and results, and reporting errors clearly. For systems that can change data or affect people, decide which actions need confirmation, use the least authority needed, and plan how to investigate and recover from mistakes. These are design recommendations, not guarantees of the agent pattern.

Failures can occur at each boundary: the model may propose an irrelevant query; a tool may time out or return stale material; the application may misread a result; or an answer may overstate what the evidence shows. Repeating the loop can compound errors. Define how to stop, report failures, check consequential results, and request human help when needed.

Step limits and timeouts serve different purposes: a step limit bounds how many decisions can be made, while a timeout bounds how long the application waits for work. Neither proves that a result is correct. A useful failure path makes clear whether a tool was called, whether it returned usable information, and whether the final response is based on that information. For actions with side effects, retrying after an uncertain response can duplicate an operation; the application should account for this before retrying rather than assume that every tool call is harmless to repeat.

Prompt injection is a risk when applications process instructions alongside user input or external content. OWASP describes direct injection through user input and indirect injection through material such as websites or files. It says retrieval-augmented generation and fine-tuning do not fully mitigate the vulnerability; its guidance includes least-privilege access, separating external content, and human approval for high-risk actions.[1] These measures may reduce exposure or impact, but are not a complete solution.

For example, a search result might try to redirect the model. Treat retrieved material as data, not as permission to override access rules. Separating trusted instructions from external content and enforcing authorization in code are HAC recommendations; they cannot ensure that every response follows the intended instruction hierarchy.

Before an agent acts, its owner should know what actions are exposed, what permissions they use, what information persists, how many steps are allowed, how errors are handled, and which actions need approval. Controls depend on the task and consequences; calling a workflow an “agent” is not a security assessment.

Conceptual diagram

Conceptual control boundary showing policy and permissions, application code checks, human approval, and failure modes such as ambiguous results, uncertain retries and prompt injection.
Conceptual view: model instructions alone are not an enforcement boundary.
Diagram: Hidden AI Concepts

Deep dive

When an Agent Is—and Is Not—Useful

An agent loop can help when a task requires choosing actions based on information gathered along the way. In the example, searching and examining results may be more appropriate than asking a model to answer from existing context alone.

A direct response is simpler when the task is clear and needs no new information or action. A fixed workflow may suit known steps. A repeated loop can add model calls, latency, tool failures, state, and outputs to check. These are trade-offs, not proof that one approach is universally faster or more reliable.

Evaluate the workflow against the task: does each step add needed information or capability? Can the system recognize missing or failed results, and can its outputs and actions be checked? More steps do not automatically mean more capability.

HAC recommends the least complex design that meets requirements and can be evaluated and operated responsibly. This is an engineering principle, not a universal empirical law. Use a bounded loop when intermediate observations and conditional actions justify its cost.

Deep dive

Conclusion

An agent-oriented system connects decisions to actions and observations. The model may propose a step; the application controls tools, validates requests, executes permitted operations, manages context and state, and decides whether to continue.

Suggestion is not authority: a proposed action is not necessarily allowed to execute. Boundaries, step limits, error handling, and review of consequential actions are design responsibilities. Use an agent when the additional loop provides necessary, testable value.

Deep dive

References

  1. OWASP GenAI Security Project. “LLM01: Prompt Injection.” OWASP Top 10 for LLM Applications. https://genai.owasp.org/llmrisk/llm01-prompt-injection/ (accessed 2026-10-18).

Continue exploring

Explore the broader topics connected to this article.

Continue with these related articles.

Continue exploring related ideas and concepts.

Continue reading

Continue exploring Hidden AI Concepts.

Recent editorial content

Discover more of the latest editorial content.