Roles

Roles are reusable prompt injection templates. A role's description is injected into the agent's system prompt, shaping how it behaves during execution.

Overview

Roles are reusable prompt injection templates. The description field of a role is injected verbatim into the agent's LLM system prompt. This directly shapes how the agent behaves during execution. Write it as instructions the model should follow, not as a narrative for humans.

For example, a description like "You are an impatient power user who uses keyboard shortcuts and skips optional steps" will cause the agent to navigate faster and avoid filling optional fields. A description like "You are a screen reader user who relies entirely on keyboard navigation" will test your application's accessibility.

Three default roles are created for each tenant: Discovery Explorer, Functional QA, and UX Auditor. These cannot be deleted but their descriptions can be customized.

POST /api/v1/roles

Create a new role

Parameters

ParameterTypeInRequiredDescription
namestringbodyYesRole name
descriptionstringbodyYesRole description (injected into the test run system prompt)

Status Codes

CodeDescription
201Role created
400Validation error
401Unauthorized
409Duplicate role name

Response Body

{
  "id": "dd0e8400-e29b-41d4-a716-446655440000",
  "tenant_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Power User",
  "description": "You are an impatient power user who uses keyboard shortcuts",
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:30:00Z"
}
POST /api/v1/roles
cURL
Response
GET /api/v1/roles

List roles

Parameters

ParameterTypeInRequiredDescription
limitintegerqueryNoNumber of results to return (default: 20)
cursoruuidqueryNoCursor for pagination

Status Codes

CodeDescription
200OK
401Unauthorized

Response Body

{
  "roles": [
    {
      "id": "dd0e8400-e29b-41d4-a716-446655440000",
      "tenant_id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Power User",
      "description": "You are an impatient power user who uses keyboard shortcuts",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    }
  ],
  "next_cursor": "ee0e8400-e29b-41d4-a716-446655440000"
}
GET /api/v1/roles
cURL
Response
GET /api/v1/roles/{id}

Get role by ID

Parameters

ParameterTypeInRequiredDescription
iduuidpathYesRole ID

Status Codes

CodeDescription
200OK
400Invalid UUID
401Unauthorized
404Role not found

Response Body

{
  "id": "dd0e8400-e29b-41d4-a716-446655440000",
  "tenant_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Power User",
  "description": "You are an impatient power user who uses keyboard shortcuts",
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:30:00Z"
}
GET /api/v1/roles/{id}
cURL
Response
DELETE /api/v1/roles/{id}

Delete a role

Deletes a role.

Parameters

ParameterTypeInRequiredDescription
iduuidpathYesRole ID

Status Codes

CodeDescription
204Role deleted
400Invalid UUID
401Unauthorized
404Role not found
DELETE /api/v1/roles/{id}
cURL
Response