> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentbase.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Rules

> Set specific constraints and requirements for agent behavior

> Rules provide specific constraints and requirements that agents must follow.

Rules work alongside system prompts to enforce boundaries and compliance requirements.

## Basic Usage

```javascript theme={null}
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

```javascript theme={null}
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"
  ]
});
```
