Agent scaffolding is the set of instructions, schemas, tools, memory rules, examples, and context structures that shape how an AI agent behaves. It is the model-facing configuration that tells the agent what role it has, what actions are available, what constraints apply, and how outputs should be formatted.
Scaffolding usually includes:
- a system message or developer instructions;
- tool names, descriptions, and argument schemas;
- structured output contracts;
- examples or rubrics for task quality;
- memory and retrieval policies;
- handoff descriptions for specialist agents; and
- safety, approval, and completion criteria.
The distinction between scaffolding and an agent harness is useful. Scaffolding is what the model sees or is configured with. The harness is the runtime code that runs the loop, dispatches tools, persists state, and enforces controls.
Scaffolding is a practical part of context engineering. Poor scaffolding can overload the context window, create ambiguous tool choices, or hide the success criteria needed for reliable execution. Effective scaffolding is specific, minimal, versioned, and evaluated against real tasks.
In multi-agent systems, each sub-agent should have its own scaffolding. A code-review agent, a planning agent, and a retrieval agent need different instructions, tools, and output contracts. Sharing one broad prompt across all roles usually reduces reliability.
Scaffolding should not be treated as a security boundary. A model can ignore or misread instructions, and untrusted context can contain malicious instructions. High-impact behavior still requires independently enforced agent guardrails.
Hugging Face's agent terminology glossary popularized the practical distinction between model, scaffold, harness, and agent in modern LLM systems.
The LLM Knowledge Base is a collection of bite-sized explanations for commonly used terms and abbreviations related to Large Language Models and Generative AI.
It's an educational resource that helps you stay up-to-date with the latest developments in AI research and its applications.