
What Is an AI Agent? (And How It Differs From a Prompt Chain)
An AI agent is a persona-plus-model configuration that decides, turn by turn, which of its assigned tools to call and in what order, rather than following a path a human wired in advance. On PromptHub, that means a system prompt, a model configuration, and a tool set drawn from your Prompts, Chains, Skills, and published PlugIn versions, run through a bounded reasoning loop instead of a fixed sequence of steps. The rest of this post breaks down what an Agent is built from, how its execution loop actually runs, and when you should reach for a prompt chain instead.
An AI agent is a persona-plus-model configuration that decides, turn by turn, which of its assigned tools to call and in what order, rather than following a path a human wired in advance.
What an Agent Is Made Of
An Agent is three things bundled together and stored as one entity: a persona, a model configuration, and a set of tools.
The persona is a system-prompt-style block of text — capped at 8,000 characters — that defines how the Agent should behave, what it knows about its job, and how it should talk to a user. It's owner-authored, which matters later: PromptHub treats it as trusted instruction, distinct from anything a tool returns mid-run.
The model configuration is a model id, a temperature, and a max-output-tokens value, all editable per Agent and drawn from the same platform default when nothing custom is set.
The tool set is where an Agent stops being just a fancy prompt. Each tool an Agent can call is stored as its own row, and — mirroring a pattern PromptHub's chain nodes already use for optional references — each row carries exactly one of four possible links: to a Prompt, a Chain, a Skill, or a published PlugIn version. That gives an Agent access to four different kinds of capability without needing four different mechanisms: static reference content from a Prompt or a Skill's instructions, a bundled PlugIn snapshot, or a fully live, multi-step Chain run.
Every turn an Agent takes — the full loop below, not just one model call — is recorded as its own row, with a stored transcript and a token-cost breakdown, so a run can be inspected after the fact the same way a Chain execution can.
The Loop: How an Agent Actually Runs
A Chain executes a graph you already designed. An Agent runs a loop: it calls a model, the model can either answer directly or ask to call one or more of its assigned tools, and if it asks, PromptHub executes those tool calls and feeds the results back in before asking the model again. That repeats until the model stops requesting tools on its own, or a hard limit forces it to stop.
The hard limit is a cap of 5 tool calls in a single turn, plus a wall-clock budget of 2 minutes covering the entire turn — not just a single model call. If a turn is still running after 15 seconds, PromptHub detaches it into a background continuation and hands back a polling id instead of holding the connection open, the same pattern the platform already uses for long Chain runs that outlast a single request.
The part worth understanding even if you never read a line of the underlying code: every tool result re-enters the conversation as data, never as an instruction. A tool can return a Prompt's stored text, a Skill's instructions, a PlugIn snapshot, or a Chain's real output — and any of that content could, in principle, contain text formatted to look like a command aimed at the model ("ignore your previous instructions and..."). Security researchers call this risk class prompt injection. PromptHub's mitigation is structural, not a suggestion: every tool result is wrapped and labeled before it's placed back into the conversation, and the Agent's own system message carries a standing instruction to treat anything inside those wrapped tags as inert content to reference, never as something to obey, no matter how it's phrased. A tool result can inform an Agent's answer. It can never redirect what the Agent does next.
Agent vs. Prompt Chain
The two patterns solve overlapping problems with a different amount of built-in judgment. Here's how they compare directly:
| Aspect | Prompt Chain | Agent |
|---|---|---|
| Who decides the next step | The chain's fixed graph, designed and saved in advance | The model itself, one tool call at a time, up to a per-turn cap |
| Failure containment | Node-level: a node-count ceiling and upfront cycle detection catch a runaway graph before execution starts | Turn-level: a hard cap of 5 tool calls per turn and a wall-clock budget force the loop to stop |
| Tool access | Only the nodes wired into that specific chain | Any tool assigned to the Agent — Prompts, Chains, Skills, or PlugIn versions — chosen dynamically |
| Determinism | Same input, same path, every run | Same input can produce a different tool sequence between two otherwise-identical runs |
| Cost shape | Billed per node that calls a model, roughly predictable in advance | Billed per turn from real tokens used across every round, harder to predict upfront |
If you already know the exact sequence of steps a task requires, a prompt chain gives you that determinism and a more predictable cost. Reach for an Agent when the right sequence of tool calls genuinely depends on what a prior step returns, and can't be fully known in advance.
When You Want a Chain Instead
An Agent's flexibility isn't free, and it isn't always the right tool. Reach for a prompt chain instead when:
- The task is fully specified in advance. If you can draw the exact sequence of steps on a whiteboard today, a chain encodes that sequence directly — there's no judgment call left for a model to get wrong.
- You need strict, repeatable determinism. A chain given the same input takes the same path every time. An Agent, choosing its own next tool call from a model's output, can legitimately take a different path between two otherwise-identical runs.
- Cost predictability matters more than flexibility. A chain's cost is roughly the number of AI-calling nodes it has; an Agent's cost depends on how many rounds the model actually needs, which you can bound but not predict exactly in advance.
- You're debugging or auditing a fixed process. A chain's node-by-node execution is easier to step through after the fact than a model's own reasoning about which tool to call next.
None of this is exclusive. PromptHub also supports a chain node that itself invokes an Agent, for the cases that genuinely need both a designed skeleton and a step where real judgment is required.
Both patterns are fully supported on PromptHub today, including that hybrid node for when a design needs both determinism and judgment in the same run. Create a free account to build either one against your own Prompts, Skills, and PlugIns.