Skip to main content
Rules provide specific constraints and requirements that agents must follow.
Rules work alongside system prompts to enforce boundaries and compliance requirements.

Basic Usage

const response = await agentbase.runAgent({
  message: "Help with customer refund request",
  system: "You are a customer service specialist",
  rules: [
    "Never approve refunds over $500 without manager approval",
    "Always verify customer identity before processing requests",
    "Document all refund decisions with clear reasoning"
  ]
});

Combining Rules with System Prompts

const response = await agentbase.runAgent({
  message: "Help customer with billing dispute",
  system: "You are an empathetic customer service specialist focused on resolution",
  rules: [
    "Maximum refund authorization without approval: $200",
    "Always verify account ownership before discussing billing",
    "Document all billing adjustments with detailed reasoning",
    "Escalate disputes over $500 to billing supervisor"
  ]
});