CAIN-42 CAIN Studio

API reference · schema

ToolRuleRequest

8 fields · used by 3 operations

Last reviewed 2026-10-02

Fields

FieldTypeMeaning
name requiredstring
effect requiredstringallow | deny | require_approval | modify (AARM MODIFY: the call proceeds with the transform applied; other rules judge the result)
priorityintegerlower runs first; first match wins
default 100
match_pathstring or nullglob, e.g. /tools/payments/*
match_servicestring or null
match_agentstring or nullglob over agent_id
conditionsarray of ToolRuleCondition
transformarray of ToolRuleTransformmodify rules only: steps applied in order

Smallest valid example

{
  "name": "name",
  "effect": "effect",
  "priority": 100
}

Used by 3 operations

POST/fabric/tool-rulesAdd a tool rule
POST/fabric/tool-rules/testWhich rule would decide this call? (no evidence, no quota)
PUT/fabric/tool-rules/{rule_id}Change a tool rule (its version increments)

Nested schemas

ToolRuleCondition · ToolRuleTransform

JSON Schema

Show the raw definition
{
  "properties": {
    "name": {
      "type": "string",
      "title": "Name"
    },
    "effect": {
      "type": "string",
      "title": "Effect",
      "description": "allow | deny | require_approval | modify (AARM MODIFY: the call proceeds with the transform applied; other rules judge the result)"
    },
    "priority": {
      "type": "integer",
      "title": "Priority",
      "description": "lower runs first; first match wins",
      "default": 100
    },
    "match_path": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Match Path",
      "description": "glob, e.g. /tools/payments/*"
    },
    "match_service": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Match Service"
    },
    "match_agent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Match Agent",
      "description": "glob over agent_id"
    },
    "conditions": {
      "items": {
        "$ref": "#/components/schemas/ToolRuleCondition"
      },
      "type": "array",
      "title": "Conditions"
    },
    "transform": {
      "items": {
        "$ref": "#/components/schemas/ToolRuleTransform"
      },
      "type": "array",
      "title": "Transform",
      "description": "modify rules only: steps applied in order"
    }
  },
  "type": "object",
  "required": [
    "name",
    "effect"
  ],
  "title": "ToolRuleRequest"
}

Try CAIN-42 on your own agents

Create a free account and every new account starts with a 7-day trial of the full platform. Or try the sandbox first, with no account at all.

Create a free account →  ·  Try the sandbox  ·  See the whole ecosystem