Thin Harness, Fat Skills: AI Agent Architecture and Implementation Guide
Learn how to separate an AI agent’s execution infrastructure from its domain-specific capabilities. This guide explains skill packaging, on-demand loading, permission controls, testing, and version governance, with a document review example showing how a thin harness and well-defined skills improve maintainability without weakening system-level safeguards.
1. The Design Principle: The Harness Runs the Agent, Skills Define the Work
An AI agent must do more than understand user requests. It also needs to call tools, process external information, and adjust its next actions based on execution results. As business requirements grow, putting every rule, procedure, and example into a single prompt can turn the system into an unwieldy collection of instructions.
“Thin Harness, Fat Skills” describes a separation of responsibilities, not simply a reduction in framework code:
- The execution harness handles general runtime mechanisms: task orchestration, context management, tool invocation, permission checks, state tracking, and error handling.
- Skills encapsulate domain-specific knowledge: applicability criteria, workflows, validation rules, reference materials, and executable scripts.
- The model interprets tasks, selects relevant capabilities, and uses execution feedback to reason and produce results within a controlled environment.
“Thin” and “fat” refer to how responsibilities are distributed, not file sizes or line counts. A harness with strict security controls can still be thin if it does not contain extensive business logic. A skill package does not need to be large; it needs to fully encapsulate a particular capability.
The principle is straightforward: keep mechanisms that must remain consistent across the system in the harness, and place business-specific knowledge and workflows in skills.
2. What Is a Skill? More Than a Prompt
A skill is a modular capability package that provides the instructions, procedures, and resources an agent needs for a class of tasks. File organization and loading mechanisms vary by implementation; there is no mandatory universal directory structure.
The following layout illustrates the idea:
skill-package/├── description.md # Purpose, applicability, and input/output specifications├── procedure.md # Execution steps, branches, and error handling├── references/ # Domain rules and reference materials├── scripts/ # Repeatable deterministic operations├── templates/ # Output templates and examples└── tests/ # Test inputs and expected results
This structure is illustrative, not a format requirement for any particular product.
Description Layer: Determine Whether the Skill Applies
A skill description should answer three questions:
- What problem does it solve?
- What inputs does it require?
- Which scenarios are outside its scope?
For example, a data quality checking skill might detect missing fields, duplicate records, and formatting errors. It should not automatically be responsible for judging whether the underlying business information is true. Without an explicit boundary, the model may mistake structural completeness for factual reliability.
Procedure Layer: Turn Experience into Executable Steps
A procedure should do more than tell the agent to “check carefully.” It should specify the order of checks, conditional branches, and stopping rules. For example:
- Validate that the input structure is complete.
- Run basic checks against the field definitions.
- Classify records with anomalies.
- Determine whether the anomalies require human confirmation.
- Return the findings with references to the supporting evidence.
Explicit procedures make failures easier to reproduce, workflows easier to test, and execution deviations easier to trace.
Resource Layer: Supply the Knowledge Needed to Complete the Task
Reference materials can include field definitions, business rules, output templates, and historical examples. Stable, deterministic operations—such as field normalization or statistical calculations—can be handled by scripts. The model can handle semantic interpretation and explanation.
This division reduces unnecessary model involvement in repetitive calculations and formatting. However, scripts still require testing and permission controls. Being part of a skill package does not make them inherently trustworthy.
3. Why Business Capabilities Should Not All Live in the Harness
Business Changes Increase Maintenance Costs
When order review, report generation, data cleaning, and other business logic are concentrated in the harness, changing one rule can affect the entire system. Developers may struggle to identify which prompt fragments are relevant to a task or whether an error comes from routing, the business workflow, or output requirements.
Separating capabilities into skills allows them to be updated, evaluated, and released independently, reducing coupling between unrelated tasks.
Loading Everything Creates Context Interference
An agent has limited context capacity and attention. Loading many irrelevant rules consumes context space and can introduce conflicting instructions.
For example, a concise-response skill may require compressed output, while an audit-report skill requires complete supporting evidence. If both remain in context at all times, the model must repeatedly determine which rule takes precedence, making behavior less consistent.
Reusable Capabilities Should Be Independent of Entry Points
The same business capability may serve an interactive assistant, a batch job, and an internal approval workflow. Binding it tightly to one entry point leads to duplicate implementations and inconsistent rules.
Independent skills support reuse, but only if they do not rely on undeclared global variables, hidden context, or assumed permissions.
4. What a Thin Harness Must Still Handle
A harness should remain business-neutral without surrendering system-level control.
Task and State Management
The harness needs to track the current objective, completed steps, pending work, and important execution results. For multi-turn tasks, it should also distinguish user input, model judgments, tool responses, and external materials rather than treating all sources as equally trustworthy.
Long workflows can use an explicit state machine when needed. If execution fails, the system can identify where it stopped instead of relying on the model to reconstruct progress from scratch.
Tool and Permission Management
A skill can declare that it needs to read materials, run calculations, or write results. The harness must decide whether those actions are allowed based on identity, resource scope, and operational risk.
High-risk actions—such as deletion, publication, payments, or bulk changes—must not be authorized solely by an instruction in a skill. The skill expresses the intended operation; the harness verifies permission to execute it.
Execution Budgets and Termination Conditions
The harness should limit tool calls, runtime, resource consumption, and retries to prevent execution loops.
Failures also need to be classified as retryable or non-retryable. A temporary connection failure may justify a retry. Insufficient permissions, missing inputs, or conflicting rules usually require the agent to stop and request resolution.
Logging and Result Validation
The system should record skill selection, skill versions, key tool calls, and result summaries. Logs must balance traceability with data protection rather than indiscriminately retaining sensitive source content.
The harness can perform general structural validation on final outputs. Domain correctness requires skill-specific rules, deterministic checks, or human review.
5. What a Fat Skill Should—and Should Not—Contain
A fat skill provides a complete expression of a business capability. It does not bundle every possible function into one package.
A mature skill typically defines:
- Input contract: Required fields, optional information, data types, and handling of missing values.
- Output contract: Output structure, conclusion categories, and evidence requirements.
- Scope: Supported tasks and explicitly excluded scenarios.
- Execution procedure: The normal workflow, conditional branches, and failure handling.
- Permission requirements: Required operation types and resource scope.
- Validation methods: How to determine whether the task is complete and the result is trustworthy.
- Test cases: Normal, invalid, boundary, and adversarial inputs.
- Version information: Metadata for tracking rule changes and execution differences.
Skills must not bypass auditing, expand access scope, or change global security policies. If multiple skills need the same authentication, retry, or logging behavior, the harness or shared infrastructure should provide it instead of each skill implementing it independently.
6. On-Demand Loading: Discover, Expand, Execute
A thin-harness, fat-skills architecture usually benefits from layered loading rather than placing every skill’s full content in context upfront.
Stage 1: Load a Compact Index
First, provide skill names, purposes, applicability criteria, and required inputs. The model or routing logic can use this information to identify candidate capabilities.
Descriptions need to distinguish skills clearly. “Check whether document totals match line-item amounts” is easier to route accurately than “process documents.”
Stage 2: Read Relevant Operating Instructions
After selecting a candidate skill, load its detailed procedure and necessary reference materials. If several skills depend on one another, define their execution order rather than leaving the model to combine all steps freely.
Stage 3: Read Resources or Run Scripts as Needed
Scripts can run directly in a controlled execution environment and return results without placing their complete source code in the model’s context. Reference materials should likewise be read according to task requirements.
On-demand loading does not necessarily reduce total cost. Routing, retrieval, and repeated reads introduce overhead. Its value depends on the number of skills, task complexity, and evaluation results.
7. Practical Example: Separating a Business Document Review Workflow
Suppose an agent must review a business document, check field completeness and amount consistency, and produce a list of issues.
The harness receives the document, verifies access permissions, manages execution state, provides controlled reading and calculation capabilities, and maintains audit records.
The review skill defines required fields, reconciliation methods, issue classification rules, and the report template.
An illustrative workflow is:
Receive the review request↓Verify document access permissions↓Select the document review skill↓Read review rules and output requirements↓Extract relevant fields↓Check structure and reconcile amounts↓Explain anomalies and cite supporting evidence↓Validate the output structure↓Return results and request human confirmation if needed
Amount reconciliation is best handled through deterministic calculations. The model is better suited to explaining anomalies and organizing the report. If a field cannot be read, the system should mark it as “uncertain” or “missing information,” not invent a value.
When review rules change, the skill can be updated and retested without embedding those rules in the general-purpose harness. This is the maintenance benefit of separating responsibilities.
8. Security Governance: Skill Content Does Not Grant Authorization
Skills may be written internally, derived from existing materials, or imported from external sources. Regardless of origin, they need trust management.
First, distinguish instructions from data. Text such as “ignore the review rules” inside a business document is content to process, not an instruction that can override the system’s execution constraints.
Second, apply least-privilege controls to scripts. Read, write, and external-access capabilities should be authorized separately. Sensitive operations may require an isolated environment and human confirmation.
Finally, establish a review and release process for skills. Instructions, scripts, and reference materials should be managed as a traceable versioned set. This prevents updated documentation from being paired with scripts that still implement old rules.
Releases should include testing, limited-scope validation, and rollback preparation. Recording the version used for each execution helps explain why the same input may produce different results at different times.
9. How to Evaluate the Architecture
Fluent answers are not enough. Evaluation should cover the entire execution chain.
Key areas include:
- Skill selection accuracy: Does the agent choose the right capability and recognize when it does not apply?
- Task completion quality: Does the result satisfy business requirements and include sufficient evidence?
- Safety: Are there unauthorized tool calls or unconfirmed high-risk operations?
- Runtime cost: Are context usage, call counts, and execution time reasonable?
- Maintainability: Does changing one skill require extensive changes to harness code?
- Reproducibility: Can versions and logs be used to locate and investigate problems?
Tests should cover missing inputs, conflicting rules, tool failures, repeated execution, and malicious instructions. Model-driven workflows can be nondeterministic, so critical tasks require repeated testing rather than treating one successful run as proof of stability.
10. Implementation Principle: Thin in Business Coupling, Rich in Capability Definition
Thin Harness, Fat Skills is a separation-of-responsibilities principle, not a fixed template for every system. Simple tasks with few skills and stable workflows may not need an elaborate skill management system. Its value becomes clearer as capabilities expand, more contributors become involved, and audit requirements increase.
Start with one frequently used task. Define its inputs, outputs, and failure conditions, then extract its business workflow. Add on-demand loading, permission controls, testing, and version governance as needed.
The goal is neither the smallest possible harness nor the largest possible skill library. It is a system with clear engineering boundaries: the harness provides reliable execution infrastructure, skills express verifiable business capabilities, and the model interprets tasks and makes decisions within explicit constraints.
