Skip to content
Last updated

🔨 In Development — This section is still being developed and may change.
Create a new rule that defines AI behavior, formatting guidelines, safety constraints, or other instructions that can be applied to assistants.
POSThttps://api.freddy.aitronos.com/v1/rules

Rules are reusable instruction sets that control AI assistant behavior. They support priority-based application, context-aware selection, and automatic compression to fit within neuron budgets.

Request Body

name string required

Human-readable name for the rule. Used for identification in lists and logs. Example: "Professional Communication Standard", "Safety Guidelines".

content string required

The actual rule content or instructions. Can be plain text or markdown. This content is injected into the system message when the rule is applied. Maximum length: 50,000 characters.

category string optional

Categorizes the rule for organization and filtering. Common categories: safety, professional, creative, technical, formatting, compliance, custom.

description string optional

Optional description explaining the rule's purpose, use cases, and when it should be applied. Helps with rule management and team collaboration.

priority integer optional · Defaults to 3

Rule priority level (1-5) determining application strategy. Lower numbers = higher priority. Values: 1 (Critical - always applied), 2 (High - thread-sticky), 3 (Standard - contextual), 4 (Low - budget-dependent), 5 (Optional - opportunistic).

characterLimit integer optional · Defaults to 10000

Maximum characters allowed for this rule's content. Used for automatic truncation and compression when context budget is limited. Range: 100-50000.

scope string optional · Defaults to organization

Visibility and access scope for the rule. Values: organization (all users in org), team (specific team), user (private to creator).

metadata object optional

Custom key-value pairs for tagging, filtering, and organizing rules. Example: {"department": "legal", "version": "2.1", "language": "en"}.

Bash
curl https://api.freddy.aitronos.com/v1/rules \
  -H "Authorization: Bearer $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Content Safety Guidelines",
    "category": "safety",
    "priority": 1,
    "content": "You must never generate content that:\n- Contains harmful or dangerous information\n- Violates privacy or confidentiality\n- Includes discriminatory or offensive language\n- Promotes illegal activities\n\nAlways prioritize user safety and ethical guidelines.",
    "description": "Critical safety rules that must always be applied"
  }'

Response

{
  "id": "rule_abc123",
  "object": "rule",
  "name": "Content Safety Guidelines",
  "category": "safety",
  "content": "You must never generate content that...",
  "description": "Critical safety rules that must always be applied",
  "priority": 1,
  "characterLimit": 10000,
  "scope": "organization",
  "metadata": {},
  "organizationId": "org_xyz789",
  "createdBy": "user_123",
  "createdAt": "2024-10-04T12:00:00Z",
  "updatedAt": "2024-10-04T12:00:00Z",
  "processingStatus": "completed",
  "validationStatus": "valid",
  "rulesCount": 5,
  "characterCount": 342
}