Roles
Structured agent contracts that define how agents behave—independent of the task-specific inputs they receive.
What Is a Role?
A role is a structured contract that defines an agent's behavior. It specifies what the agent is responsible for, what it may and may not do, and what form its output must take.
Roles are not prompts. They are not written by users at request time. They are stable, tested configurations that constrain agent behavior across all invocations.
When a workflow step executes, the system binds an agent to a role. The role determines how the agent behaves. The workflow determines when the agent acts and what inputs it receives.
Role Components
Every role definition includes these elements:
Responsibility
What this agent is accountable for producing. Defines the scope of work and success criteria.
Scope
What the agent may and may not do. Establishes boundaries on behavior and output.
Biases
Intentional stylistic or epistemic orientations. How the agent should approach ambiguity or emphasis.
Constraints
Hard limits on execution. Format requirements, forbidden patterns, mandatory inclusions.
Output Schema
The structure the agent's output must satisfy. May include required sections, fields, or format specifications.
Roles vs. Prompts
In many AI systems, users write prompts that begin with role-like instructions: “You are a world-class researcher...” This pattern conflates identity, instruction, and constraints into a single user-authored string.
Esy separates these concerns:
Key Distinction
Roles and Workflows
Roles and workflows are complementary but distinct:
Workflows
Define the sequence of operations: which steps execute, in what order, with what inputs and outputs.
Workflows decide when agents act.
Roles
Define agent behavior: what responsibilities the agent has, what constraints it operates under, what outputs it produces.
Roles decide how agents behave.
A single role may be used across many workflows. A single workflow may invoke many different roles at different steps. This separation allows both to be designed, tested, and versioned independently.
Role Selection
For most users, role selection is handled automatically. When you use a pre-built workflow, roles are already assigned to each step.
Pro users designing custom workflows may select which role executes each step. This is selection from a curated set—not freeform authorship. Available roles are:
- Tested for behavioral consistency
- Documented with clear scope definitions
- Versioned to track changes over time
- Constrained to prevent scope creep
Roles Are Not Endlessly Customizable
How Roles Become Prompts
At execution time, the system generates prompts from role definitions. This is an internal process:
- 1The workflow step identifies which role should execute
- 2The role definition is retrieved (responsibility, scope, constraints, output schema)
- 3Step inputs are prepared from workflow state and user context
- 4The system constructs a prompt that encodes the role's contract plus the step's inputs
- 5The agent executes against this prompt
- 6Output is validated against the role's output schema
Users never see or edit these generated prompts. The role contract, not user prompt-writing skill, determines output quality.