Rules are the written instructions your AI Agents follow. A rule is owned by an organization, and it carries its text in versions rather than on the rule itself.
Creating a rule requires both a name and a content : Luzmo stores that text as the first AIRuleVersion of the rule and points latest_version_id at it. The rule starts as a draft ( status: "draft" ), which means no Agent applies it yet; publish a version to make it active. The content you send is not returned on the rule, and the rule is only created if its first version is accepted, so a name or body outside the allowed length leaves nothing behind.
Creating a rule requires the Organization Editor right, i.e. the Owners and Designers of the organization.
npm install @luzmo/nodejs-sdk{
"id": "c1f4a0c2-6c9e-4f6b-9a5a-3f0d2b8f1e77",
"name": "Discount policy",
"status": "draft",
"has_unpublished_changes": false,
"latest_version_id": "9b1d2f34-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"published_version_id": null,
"published_name": null,
"published_at": null,
"organization_id": "0f2b8a6d-3c4e-4d5a-8b7c-1e2f3a4b5c6d",
"user_id": "5ec6950f-d7bb-4554-8f6a-10ea8b68c254",
"created_at": "2026-09-18T09:04:11.204Z",
"updated_at": "2026-09-18T09:04:11.204Z"
}