Skip to content
Last updated

Rules are reusable instructions that define AI behavior, enforce guardrails, maintain brand voice, and ensure compliance across your organization's AI applications.

What are Rules?

Rules are declarative policies that modify how AI assistants behave and respond. They can enforce:

  • Behavioral guidelines - Tone, style, and communication standards
  • Safety guardrails - Content policies and prohibited topics
  • Compliance requirements - Industry regulations and legal constraints
  • Brand voice - Consistent messaging and formatting
  • Context-specific instructions - Situational behavior modifications

Key Features

Reusable and Centralized

Create once, apply to multiple assistants, users, models, or vector stores. Rules are stored centrally and referenced by ID.

Priority-Based Application

Control rule precedence with a 1-100 priority scale. Higher priority rules are applied first, ensuring critical safety rules take precedence.

Fine-Grained Access Control

Three-tier access system (owner, edit, view) enables team collaboration while maintaining security.

Flexible Attachments

Attach rules to different entity types with independent configurations:

  • Assistants
  • Vector stores
  • Users
  • Models
  • Organizations

Version Tracking

Automatic version incrementing on updates helps track changes and maintain audit trails.

How Rules Work

1. Create a Rule

Define your rule with content, category, and type:

curl -X POST https://api.aitronos.com/v1/organizations/org_123/rules \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -d '{
    "name": "Professional Communication",
    "content": "Always maintain professional tone...",
    "category": "professional",
    "rule_type": "behavior"
  }'

2. Attach to Entities

Apply the rule to assistants, users, or other entities:

curl -X POST https://api.aitronos.com/v1/rules/rule_abc/attachments \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -d '{
    "entity_type": "assistant",
    "entity_id": "asst_123",
    "priority": 80
  }'

3. Rules Apply Automatically

When the entity (assistant, user, etc.) is used, attached rules are automatically included in the context based on priority order.

Rule Categories

  • safety - Safety and compliance rules
  • professional - Professional conduct and tone
  • creative - Creative writing and style guidelines
  • technical - Technical constraints and requirements
  • custom - Organization-specific rules

Rule Types

  • behavior - Behavioral guidelines and tone
  • guardrails - Safety boundaries and restrictions
  • formatting - Output formatting and structure
  • context - Context-specific instructions
  • content_policy - Content policies and restrictions
  • constraint - Hard constraints and limitations

Priority System

Rules use a 1-100 priority scale (higher = applied first):

Priority RangeUse CaseExample
90-100Critical safety rules"Never share PII"
70-89High priority compliance"Follow GDPR requirements"
50-69Standard behavior"Professional tone"
30-49Low priority style"Use active voice"
1-29Optional preferences"Prefer concise responses"

Quick Start Example

Create a rule with attachments in a single request:

curl -X POST https://api.aitronos.com/v1/organizations/org_123/rules \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Support Standards",
    "content": "Be empathetic, professional, and solution-focused. Always acknowledge customer concerns and provide clear next steps.",
    "category": "professional",
    "rule_type": "behavior",
    "attachments": [
      {
        "entity_type": "assistant",
        "entity_id": "asst_support",
        "priority": 80
      }
    ]
  }'

Best Practices

Keep Rules Focused

Each rule should have a single, clear purpose. Avoid "mega-rules" that try to cover everything.

Use Descriptive Names

Names should clearly indicate the rule's purpose: "PII Protection Policy" not "Rule 1".

Set Appropriate Priorities

Reserve 90-100 for critical safety rules. Use 50-69 for standard guidelines.

Test Before Production

Test rules in staging environments before applying to production assistants.

Monitor Usage

Use analytics to track rule adoption and effectiveness across your organization.

Version Carefully

Rules auto-increment versions on updates. Document changes for team awareness.

Common Use Cases

Consistent Brand Voice

Apply the same communication style across all customer-facing assistants.

Safety and Compliance

Enforce industry regulations (HIPAA, GDPR, etc.) across all AI interactions.

Context-Specific Behavior

Apply different rules to support vs. sales assistants while maintaining shared safety rules.

Team Collaboration

Share rules with team members using access controls for collaborative rule management.