Skip to main content
Every agent has five layers. When one misbehaves, the layer tells you where to look.

Quick tour of all five layers

1

Layer 1 · Prompt

Say it clearly — role, instructions, output format.
2

Layer 2 · Context

Put the right thing in the window — memory, knowledge, compression.
3

Layer 3 · Harness

Let it act and check it — tools, guardrails, approval.
4

Layer 4 · Loop

Decide when to stop — iteration caps, budgets, completion checks.
5

Layer 5 · Graph

Wire agents together — routing, parallelisation, orchestration.

The five layers in depth

Role, instructions, examples, output format.
Learn more: Agents, Output, Templates.
Write, select, compress, isolate — the four context operations, one parameter each.
Isolate is handoffs=[specialist] — a sub-agent inherits the last few messages and the intersection of your tools, not your whole transcript.
Learn more: Context, Memory, Knowledge, Handoffs.
Agent = Model + Harness. Tool dispatch, plus the guides that steer before acting and the sensors that observe after.
Learn more: Tools, MCP, Guardrails, Approval, Hooks.
Hard iteration caps, budget ceilings, no-progress detection and completion checks — every brake is explicit.
Doom-loop detection is on by default. Repeated identical tool calls and A→B→A→B oscillation get caught — while a poller whose output keeps changing does not.
Learn more: Execution, Reflection, Autonomy, Budget, Doom-Loop Detection.
Topology as a versionable artifact: prompt chaining, routing, parallelisation, orchestrator-worker.
The same graph is expressible in YAML with no Python at all.
Learn more: AgentFlow, Conditions, Process.
The harness is commoditising; where the agent executes is the next multiplier. Rather than burning your laptop’s CPU, hand an agent a short-lived cloud sandbox — repo, tools and tests run there.
Sandboxes shut themselves down when idle (auto_shutdown, idle_timeout_s), and a post-setup snapshot is reused so the next run skips the image pull and dependency install. Commit a .praisonai/environment.yaml and the environment travels with the repo.
Manage running sandboxes from the CLI — both commands take required positional arguments:
Learn more: Managed Agents, E2B, Modal, Daytona, Docker, Local.

Which layer is my bug in?


Layer 1 · Prompt

Role, instructions, and output format.

Layer 2 · Context

Memory, knowledge, and compression.

Layer 3 · Harness

Tools, guardrails, and approval.

Layer 4 · Loop

Iteration caps, budgets, and completion checks.

Layer 5 · Graph

Routing, parallelisation, and orchestration.

⬡ Managed Agents

Where the agent actually runs.
Stack framing adapted from The Five-Layer Agent Stack and Agent Harnesses vs Orbs.