The AI Triad: Sub-Agent, Skill, and Worker#
Modern agentic architectures separate identity, capability, and execution into three complementary primitives:
Sub-Agent (Role)
The persona, domain identity, and reasoning model delegated to tackle the work.
Example:
Security Auditor
Skill (SKILL.md)
Modular procedural knowledge, reference documentation, and executable scripts that extend what an agent knows how to do.
Example:
owasp-audit skill instructions
AI Worker (worker.md)
The self-contained, bounded execution contract with explicit inputs, outputs, hard timeouts, and tool whitelists.
Example:
pr-security-review.worker.md
Sub-Agent vs AI Worker: Side-by-Side#
Why do we need a separate worker.md contract instead of just creating another sub-agent?
| Dimension | Sub-Agent (Role) | AI Worker (worker.md) |
|---|---|---|
| Core Nature | An actor / persona with an active reasoning loop. | A bounded work contract for a single task. |
| Autonomy | High: decides what steps to take, what tools to call, and when it is finished. | Bounded: executes only the contract defined in worker.md. No open-ended looping. |
| Execution Model | Loop: Think → Act → Observe → Repeat |
Pipeline: Validate Input → Execute Task → Verify Output |
| Resource Limits | Unpredictable token usage and step counts. | Hard limits: strict timeout (e.g. 30s), cost budget, and tool whitelist. |
| Deliverable | Conversational explanation, summary, or report. | Strict, schema-validated JSON with trace metadata. |
| Software Parallel | A background daemon or long-running worker thread. | An AWS Lambda function, Celery task, or Temporal activity. |
How They Fit Together in Production#
Orchestrator / Caller (FastAPI, Temporal, LangGraph)
│
invokes callable contract
▼
AI Worker (worker.md) [The Contract: inputs, outputs, deadlines, tool gating]
│
executed by runner using
▼
Runner Implementation [Deterministic script, single LLM call, or bounded sub-agent]
+
Skills (SKILL.md) [Procedural instructions & tool definitions]
worker.md file declares explicit limits (such as timeout_ms, max_cost_usd, and allowed_tools). The runner harness is responsible for actively enforcing those limits through deadline timers, cost quotas, sandbox boundaries, and schema validation.
How AI Workers Work#
Workers execute via a three-phase bounded execution contract, eliminating runaway loops and cost spikes:
Input Schema Validation
The runtime verifies input payloads against strict schemas, checks quota/rate limits, and gates permissions before calling any model.
Sandboxed Resource Ceilings
Workers run with strict timeouts, token budgets, and tool whitelists. No open-ended planning loops or arbitrary self-delegation.
Structured Response Envelope
Results are validated against output schemas and wrapped in a deterministic envelope stamped with trace IDs, execution duration, and token metrics.
Get Started with worker.md#
Quickstart Guide
Understand the core execution model and create your first worker specification in 3 minutes.
Format Specification
The complete technical specification for WORKER.md files, frontmatter schemas, constraints, and lifecycle.
Worker vs Agent
Architectural boundaries: when to use autonomous agents vs. deterministic, bounded workers.
Worker Marketplace
Verified, production-ready worker packages with SLAs, evals, and dual-rail Stripe & crypto billing.
Worker Registry
Explore 60+ open-source worker frameworks, platforms, and repo-derived worker examples.
Core Architectural Reference#
Evergreen guides and patterns for engineering production-ready AI workers:
Worker vs Agent
Boundaries, autonomy levels, and risk trade-offs in multi-agent stacks.
Monetization
Packaging models, enterprise SLAs, and marketplace opportunities for workers.
Architecture
Timeouts, retries, idempotency tokens, and isolation boundaries.
Design Patterns
Validator, Aggregator, Router, and Queue-based worker topologies.
Worker Protocol
JSON schema request/response envelope for IPC and HTTP tool calls.
Orchestration
How agents coordinate pipelines of decoupled single-purpose workers.
Examples
Practical specs: code review, data validation, web scraping, and Lambda.
Glossary
Definitions of bounded execution, idempotency, retries, and contracts.
Frequently Asked Questions#
FAQ#
Is this a framework or a standard?
No. It is a design pattern and a shared vocabulary. You can implement workers with any model, runtime, or platform.
When should I use a worker instead of an agent?
Use a worker for bounded, auditable execution (do X with these inputs). Use an agent when you need autonomous planning and goal selection.
What belongs in a worker contract?
Inputs, outputs, status codes, constraints (timeouts, tools), and observability fields like trace IDs and attempt counters.
Do workers need to be deterministic?
They do not need to be perfectly deterministic, but they should be repeatable enough that teams can test, monitor, and reason about them.