# Rulebricks

```json
{
  "name": "Rulebricks",
  "slug": "rulebricks",
  "url": "https://composio.dev/toolkits/rulebricks",
  "markdown_url": "https://composio.dev/toolkits/rulebricks.md",
  "logo_url": "https://logos.composio.dev/api/rulebricks",
  "categories": [
    "workflow automation"
  ],
  "is_composio_managed": false,
  "updated_at": "2026-11-19T05:35:44.067Z"
}
```

![Rulebricks logo](https://logos.composio.dev/api/rulebricks)

## Description

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Rulebricks MCP or direct API to build rules, test decision flows, execute published decisions, and inspect outcomes through natural language.

## Summary

Rulebricks is a decision automation platform for building, testing, publishing, and running business rules.
It helps teams turn complex decisions into consistent, trackable workflows.

## Categories

- workflow automation

## Toolkit Details

- Tools: 59

## Images

- Logo: https://logos.composio.dev/api/rulebricks

## Authentication

- **Api Key**
  - Type: `api_key`
  - Description: Api Key authentication for Rulebricks.
  - Setup:
    - Configure Api Key credentials for Rulebricks.
    - Use the credentials when creating an auth config in Composio.

## Suggested Prompts

- Execute a customer eligibility decision flow
- Test pricing rules with sample inputs
- List published Rulebricks decision flows

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `RULEBRICKS_BULK_SUBMIT_CONTEXT_DATA` | Bulk Submit Context Data | Merge a non-empty batch into a Rulebricks context and execute ready bound rules or flows. External effects and partial writes may occur; retrying after an uncertain response can repeat effects. Returns per-instance outcomes. |
| `RULEBRICKS_CASCADE_CONTEXT_INSTANCE` | Cascade Context Instance | Re-evaluate registered pending rule and flow work for a Rulebricks context instance after dependencies may have become available. Flows may invoke external actions, and retrying an uncertain request can repeat their effects. |
| `RULEBRICKS_COUNT_DECISION_LOGS` | Count Decision Logs | Count decision logs matching asset, status, trace, payload-content, or time-range filters without returning log payloads. |
| `RULEBRICKS_CREATE_ASSET_TEST` | Create Asset Test | Create a saved test case for a Rulebricks rule or flow with an input, expected response, comparison policy, and criticality. |
| `RULEBRICKS_CREATE_CONTEXT` | Create Context | Create a Rulebricks context with stored and derived fields, an identity fact, retention settings, and access controls. |
| `RULEBRICKS_CREATE_CONTEXT_RELATIONSHIP` | Create Context Relationship | Create a has-many, has-one, or belongs-to relationship from one Rulebricks context to another. |
| `RULEBRICKS_CREATE_FOLDER` | Create Folder | Create a folder for rule, flow, or context assets; the asset type defaults to rule. |
| `RULEBRICKS_CREATE_USER` | Create User | Create a new user directly with a password, bypassing the email invitation flow. The user can immediately log in with the provided credentials. The provider-issued API key is omitted from the response. |
| `RULEBRICKS_CREATE_USER_GROUP` | Create User Group | Create a new user group in your Rulebricks organization. |
| `RULEBRICKS_DELETE_ASSET_TEST` | Delete Asset Test | Permanently delete one saved test case from a Rulebricks rule or flow. |
| `RULEBRICKS_DELETE_CONTEXT` | Delete Context | Delete a Rulebricks context and all of its live instances, returning affected bindings and pending evaluations. |
| `RULEBRICKS_DELETE_CONTEXT_INSTANCE` | Delete Context Instance | Permanently delete one Rulebricks context instance and its history, cancel its pending evaluations, and re-evaluate dependent context instances. Ready dependent rules or flows may execute; flows may invoke external actions. |
| `RULEBRICKS_DELETE_CONTEXT_RELATIONSHIP` | Delete Context Relationship | Delete a specific relationship owned by a Rulebricks context. |
| `RULEBRICKS_DELETE_FLOW` | Delete Flow | Permanently delete one Rulebricks flow by ID. |
| `RULEBRICKS_DELETE_FOLDER` | Delete Folder | Delete one folder by ID without deleting the assets it contains. |
| `RULEBRICKS_DELETE_OBJECT` | Delete Object | Delete a workspace object by ID or exact name and archive, delete, or detach its generated values. |
| `RULEBRICKS_DELETE_RULE` | Delete Rule | Permanently delete one Rulebricks rule by ID. |
| `RULEBRICKS_DELETE_VALUE` | Delete Value | Delete one vocabulary value by ID and replace references from other values with its content; rule or flow references and object-managed namespaces can block deletion. |
| `RULEBRICKS_EXECUTE_ASSETS_IN_PARALLEL` | Execute Assets in Parallel | Execute multiple published Rulebricks rules or flows in parallel from one named map. Each entry is independent, so successful results are returned alongside reserved `$error` details for entries that fail. Flows may invoke external actions, and retrying an uncertain request can repeat their effects. A successful call uses the organization's monthly execution allowance for each entry. |
| `RULEBRICKS_EXECUTE_BULK_RULE` | Execute Bulk Rule | Execute one published Rulebricks rule against up to 1000 ordered input objects and return one aligned result per input. A successful call uses the organization's monthly execution allowance for each input. |
| `RULEBRICKS_EXECUTE_FLOW` | Execute Flow | Execute a published Rulebricks flow once or in bulk and return the ordered flow-defined output and execution ID for querying its decision logs. A flow may invoke external actions, and retrying an uncertain request can repeat their effects. A successful execution uses the organization's monthly execution allowance. |
| `RULEBRICKS_EXECUTE_RULE` | Execute Rule | Execute a published Rulebricks rule with its input payload and return the rule-defined decision output. A successful execution uses the organization's monthly execution allowance. |
| `RULEBRICKS_EXPORT_FLOW` | Export Flow | Export one flow as a Rulebricks Flow Schema document that can be round-tripped through the flow import endpoint. Provide flow_id or flow_slug; at least one is required, and the provider accepts both together. |
| `RULEBRICKS_EXPORT_MANIFEST` | Export Asset Manifest | Export selected Rulebricks rules, flows, contexts, or values with their resolved dependencies, or preview the export. Provide at least one of root_ids, root_collection, root_collections, or all_values=true for value catalogs; selectors may be combined. |
| `RULEBRICKS_EXPORT_RULE` | Export Rule | Export one rule by ID as a raw rule document that can be round-tripped through the Rulebricks rule import endpoint. |
| `RULEBRICKS_GET_CONTEXT` | Get Context | Retrieve a Rulebricks context by ID, including its schema, bindings, access controls, and relationships. |
| `RULEBRICKS_GET_CONTEXT_INSTANCE` | Get Context Instance | Retrieve the current base facts, derived facts, status, and selected execution or relationship data for one Rulebricks context instance. |
| `RULEBRICKS_GET_CONTEXT_INSTANCE_HISTORY` | Get Context Instance History | Retrieve newest-first historical values for all fields or one selected field on a Rulebricks context instance. |
| `RULEBRICKS_GET_OBJECT` | Get Object | Fetch one workspace object (JSON Schema) by its ID or exact name. |
| `RULEBRICKS_GET_USAGE` | Get Usage | Return the organization's current plan and monthly Rulebricks execution usage, limit, and remaining allowance. |
| `RULEBRICKS_IMPORT_FLOW` | Import Flow | Create or update a flow from a Rulebricks Flow Schema document; imported flows publish by default unless publish (provider field _publish) is false. |
| `RULEBRICKS_IMPORT_MANIFEST` | Import Asset Manifest | Atomically create or update rules, flows, contexts, and values from a Rulebricks manifest. Override updates conflicts in place while preserving prior versions, release pins, context records, IDs, folders, and access groups. Use PREVIEW_IMPORT_MANIFEST to inspect the write-free plan first. |
| `RULEBRICKS_IMPORT_RULE` | Import Rule | Create a rule from a complete raw rule document, or partially update an existing rule when the document includes its ID. |
| `RULEBRICKS_INVITE_USER` | Invite User | Invite a new user to the organization or update role or user group data for an existing user. |
| `RULEBRICKS_LIST_ASSET_TESTS` | List Asset Tests | List saved test cases for a Rulebricks rule or flow, including expected responses and latest execution state. |
| `RULEBRICKS_LIST_CONTEXT_RELATIONSHIPS` | List Context Relationships | List incoming and outgoing relationships configured for a Rulebricks context. |
| `RULEBRICKS_LIST_CONTEXTS` | List Contexts | List contexts visible to the connected API key, optionally filtered or paginated by the provider's opaque cursor. |
| `RULEBRICKS_LIST_FLOWS` | List Flows | List flows visible to the connected API key, optionally selecting an exact asset version or filtering by identifier, search, folder, labels, group, or name. |
| `RULEBRICKS_LIST_FOLDERS` | List Folders | List asset folders visible to the connected API key, optionally filtered by user group or name. |
| `RULEBRICKS_LIST_OBJECTS` | List Objects | List workspace objects (JSON Schemas) visible to the connected API key's user groups. |
| `RULEBRICKS_LIST_PENDING_CONTEXT_EVALUATIONS` | List Pending Context Evaluations | List rule and flow evaluations registered as pending for one Rulebricks context instance, including their missing dependencies. |
| `RULEBRICKS_LIST_RULES` | List Rules | List rules visible to the connected API key, optionally selecting an exact asset version or filtering by identifier, search, folder, labels, group, or name. |
| `RULEBRICKS_LIST_USER_GROUPS` | List User Groups | List all user groups available in your Rulebricks organization. |
| `RULEBRICKS_LIST_USERS` | List Users | List all users (including the admin and all team members) in the organization with their email, name, role, user groups, and join date. Provider-issued API keys are omitted from the response. |
| `RULEBRICKS_LIST_VALUES` | List Values | Return one page of vocabulary values visible to the connected API key, with optional name, prefix, type, group, and usage filters. |
| `RULEBRICKS_PREVIEW_IMPORT_MANIFEST` | Preview Asset Manifest Import | Return the server-authoritative plan for importing Rulebricks rules, flows, contexts, and values without writing any assets. |
| `RULEBRICKS_PREVIEW_SYNC_VALUES` | Preview Value Collection Sync | Preview the created, updated, unchanged, archived, and deleted values for one complete single-request collection synchronization without writing changes. |
| `RULEBRICKS_PREVIEW_UPSERT_OBJECT` | Preview Object Upsert | Validate and preview creating or updating a workspace object and synchronizing its JSON Schema enum values without writing any changes. |
| `RULEBRICKS_QUERY_DECISION_LOGS` | Query Decision Logs | Return one page of decision logs filtered by assets, status, trace, payload content, or time range. Check limited even when no next cursor is returned; a limited page does not cover all matching history. |
| `RULEBRICKS_REPLACE_VALUE_METADATA` | Replace Value Metadata | Replace or clear all custom metadata for one vocabulary value by ID without resending its value payload. The API key must have edit-values permission. |
| `RULEBRICKS_RUN_ASSET_TESTS` | Run Asset Tests | Run all saved tests, or only critical tests, against the latest draft of a Rulebricks rule or flow and return pass totals and failure diagnostics. Version targeting is not supported. |
| `RULEBRICKS_SOLVE_CONTEXT_ASSET` | Solve Context Asset | Persist optional facts and execute one rule or flow bound to a Rulebricks context instance, or register it pending when dependencies are missing. Flows may cause external effects; retrying an uncertain outcome can repeat them. |
| `RULEBRICKS_SUBMIT_CONTEXT_DATA` | Submit Context Data | Merge facts into one Rulebricks context instance. This may immediately execute bound rules or flows and cause their external effects; returns the resolved state and triggered evaluations. |
| `RULEBRICKS_SYNC_VALUES` | Sync Value Collection | Synchronize one vocabulary collection to a desired set. Chunks commit independently and must run sequentially under one fresh sync_id; finalize only after every chunk succeeds and do not overlap collection pipelines. Completion archives or deletes omitted members. This action always writes. |
| `RULEBRICKS_UPDATE_CONTEXT` | Update Context | Update a Rulebricks context's name, schema, identity, retention, execution behavior, folder, or access groups. Changing identity_fact on a context with live instances changes how future writes resolve them. |
| `RULEBRICKS_UPDATE_FOLDER` | Update Folder | Update an existing folder's required name and optional description by ID without changing its asset type. |
| `RULEBRICKS_UPLOAD_MANIFEST_PART` | Upload Manifest Part | Upload one plain UTF-8 or gzip-compressed part of a Rulebricks manifest larger than 4 MiB. Reuse one upload_id, send parts in zero-based order, then pass that ID and the total part count as manifest_upload to IMPORT_MANIFEST. Parts expire after 24 hours. |
| `RULEBRICKS_UPSERT_OBJECT` | Upsert Object | Create a workspace object by name or update one by ID or name, then synchronize values generated from its JSON Schema enums. Generated values removed from the submitted schema are archived. This action always writes. |
| `RULEBRICKS_UPSERT_VALUES` | Create or Update Values | Create new vocabulary values or update existing values by name, including nested values and per-value metadata. |

## Supported Triggers

None listed.

## Installation and MCP Setup

### Path 1: SDK Installation

#### Path 1, Step 1: Install Composio

Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
```python
pip install composio composio_openai openai
```

```typescript
npm install @composio/core @composio/openai openai
```

#### Path 1, Step 2: Create a Composio session

Initialize Composio with the OpenAI Responses provider and create a session scoped to Rulebricks
```python
import json
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
client = OpenAI()

session = composio.create(user_id="your-user-id", toolkits=["rulebricks"])
tools = session.tools()
```

```typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["rulebricks"] });
const tools = await session.tools();
```

#### Path 1, Step 3: Run Rulebricks tools with your agent

Send a request, execute the Rulebricks tool calls through the session, and print the final answer
```python
response = client.responses.create(
    model="gpt-5.6-sol",
    tools=tools,
    input=[{"role": "user", "content": "Execute the published customer eligibility decision flow for a customer with an annual income of $85000, a credit score of 740, and an existing account history of 3 years."}],
)

while True:
    tool_calls = [o for o in response.output if o.type == "function_call"]
    if not tool_calls:
        break
    results = composio.provider.handle_tool_calls(response=response, session=session)
    response = client.responses.create(
        model="gpt-5.6-sol",
        tools=tools,
        previous_response_id=response.id,
        input=[
            {"type": "function_call_output", "call_id": call.call_id, "output": json.dumps(results[i])}
            for i, call in enumerate(tool_calls)
        ],
    )

print(response.output_text)
```

```typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Execute the published customer eligibility decision flow for a customer with an annual income of $85000, a credit score of 740, and an existing account history of 3 years." }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
```

### Path 2: MCP Server Setup

#### Path 2, Step 1: Install Composio

Install the Composio SDK and your agent framework
```python
pip install composio claude-agent-sdk
```

```typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
```

#### Path 2, Step 2: Create a session with MCP enabled

Create a session scoped to Rulebricks and read its MCP URL and headers
```python
from composio import Composio

composio = Composio()
session = composio.create(user_id="your-user-id", toolkits=["rulebricks"], mcp=True)
```

```typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["rulebricks"],
  mcp: true,
});
```

#### Path 2, Step 3: Connect your agent to the MCP server

Pass the session's MCP URL and headers to your agent and run a Rulebricks request
```python
import asyncio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions, AssistantMessage, TextBlock

options = ClaudeAgentOptions(
    mcp_servers={
        "composio": {
            "type": "http",
            "url": session.mcp.url,
            "headers": session.mcp.headers,
        }
    },
    system_prompt="You are a helpful assistant with access to Rulebricks tools.",
    tools=[],
    allowed_tools=["mcp__composio__*"],
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query("Execute the published customer eligibility decision flow for a customer with an annual income of $85000, a credit score of 740, and an existing account history of 3 years.")
        async for message in client.receive_response():
            if isinstance(message, AssistantMessage):
                for block in message.content:
                    if isinstance(block, TextBlock):
                        print(block.text)

asyncio.run(main())
```

```typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Execute the published customer eligibility decision flow for a customer with an annual income of $85000, a credit score of 740, and an existing account history of 3 years.",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
```

## Why Use Composio?

### 1. AI Native Rulebricks Integration

- Supports both Rulebricks MCP and direct API integrations
- Structured, LLM-friendly schemas for executing rules and decision flows reliably
- Access practical tools for testing, publishing, and inspecting Rulebricks decisions

### 2. Managed Auth

- Securely stores and uses your Rulebricks API key without hard-coding it in agent prompts
- Central place to manage and revoke Rulebricks access
- Separate credentials by user, workspace, or environment

### 3. Agent Optimized Design

- Tools use clear inputs and outputs that help agents work with business rules and decision flows
- Execution logs make it easier to see what ran, when it ran, and which inputs produced each result

### 4. Enterprise Grade Security

- Control which agents and users can access Rulebricks tools
- Use scoped access to protect rules, decision flows, and deployments
- Maintain an audit trail of agent actions for review and compliance

## Use Rulebricks with any AI Agent Framework

Choose a framework you want to connect Rulebricks with:

- [ChatGPT](https://composio.dev/toolkits/rulebricks/framework/chatgpt)
- [Claude Cowork](https://composio.dev/toolkits/rulebricks/framework/claude-cowork)
- [Hermes](https://composio.dev/toolkits/rulebricks/framework/hermes-agent)
- [Atomic Agent](https://composio.dev/toolkits/rulebricks/framework/atomic-agent)

## Related Toolkits

- [0CodeKit](https://composio.dev/toolkits/0codekit) - 0CodeKit is a utility API platform for AI, document, image, and data workflows. Use it to convert, validate, generate, store, and automate data without custom backend code.
- [Airtop](https://composio.dev/toolkits/airtop) - Airtop is a cloud browser platform for AI-powered web automation. Use it to navigate sites, extract data, and run reusable browser workflows.
- [Apify MCP](https://composio.dev/toolkits/apify_mcp) - Apify MCP is the official MCP server for Apify's web scraping and browser automation platform. Use it to run actors, collect structured web data, and automate crawling workflows.
- [Apilio](https://composio.dev/toolkits/apilio) - Apilio is a home automation platform that lets you connect and control smart devices from different brands. It helps you build flexible automations with complex conditions, schedules, and integrations.
- [Basin](https://composio.dev/toolkits/basin) - Basin is a no-code form backend for quickly setting up reliable contact forms. It lets you collect and manage form submissions without writing any server-side code.
- [Bika.ai](https://composio.dev/toolkits/bika) - Bika.ai is an AI automation database platform for managing spaces, teams, records, automations, and outgoing webhooks. It helps teams organize structured data and automate database-driven workflows in one place.
- [Botster](https://composio.dev/toolkits/botster) - Botster is a web automation service for running configurable data collection bots. Use it to collect structured web data without building and maintaining scrapers yourself.
- [Bouncer](https://composio.dev/toolkits/bouncer) - Bouncer is an email validation platform that verifies the authenticity of email addresses in real-time and batch. It helps boost deliverability and reduce bounce rates for your communications.
- [BrowserAct](https://composio.dev/toolkits/browseract) - BrowserAct is a hosted browser-automation service for running web workflows. Use it to execute repeatable browser tasks with templates, proxies, and APIs.
- [Celigo](https://composio.dev/toolkits/celigo) - Celigo is an integration platform as a service for connecting apps, data, and business workflows. It helps teams automate cross-system processes without building every integration from scratch.
- [CheckFlow](https://composio.dev/toolkits/checkflow) - CheckFlow is a workflow and checklist platform for repeatable processes, tasks, templates, teams, data sets, and automation. Use it to standardize operations, track process execution, and keep teams aligned.
- [Conveyor](https://composio.dev/toolkits/conveyor) - Conveyor is a platform that automates security reviews with a Trust Center and AI-driven questionnaire automation. It streamlines compliance and vendor security processes for faster, hassle-free reviews.
- [CrewAI](https://composio.dev/toolkits/crew_ai) - CrewAI is a platform for running deployed automations and managing AMP control-plane resources. Use it to automate workflows and centrally control SaaS automation resources.
- [Cronfree Time Scheduler](https://composio.dev/toolkits/cronfree_time_scheduler) - Cronfree Time Scheduler is an API-based scheduler for recurring webhook calls. Use it to create and remove timezone-aware schedules without running cron.
- [Crowdin](https://composio.dev/toolkits/crowdin) - Crowdin is a localization management platform that streamlines translation workflows and collaboration. It helps teams centralize multilingual content, boost productivity, and automate translation processes.
- [Databox](https://composio.dev/toolkits/databox) - Databox is a business analytics platform that connects your data from any tool and device. It helps you track KPIs, build dashboards, and discover actionable insights.
- [Detrack](https://composio.dev/toolkits/detrack) - Detrack is a delivery management platform for real-time tracking and proof of delivery. It helps businesses automate notifications and keep customers updated every step of the way.
- [Dify](https://composio.dev/toolkits/dify) - Dify is a platform for running and managing published workflow apps via a Service API. Use it to execute workflows and inspect configuration and run history quickly.
- [Digital Humani](https://composio.dev/toolkits/digital_humani) - Digital Humani is a reforestation API for browsing planting projects, submitting tree requests, and tracking planted trees. It helps teams connect climate action directly to products, campaigns, and customer experiences.
- [Dnsfilter](https://composio.dev/toolkits/dnsfilter) - Dnsfilter is a cloud-based DNS security and content filtering solution. It helps organizations block online threats and manage safe internet access with ease.

## Frequently Asked Questions

### Do I need my own developer credentials to use Rulebricks with Composio?

Yes, Rulebricks requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

### Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. [Learn more](https://docs.composio.dev/tool-router/overview).

### Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. [Learn more](https://trust.composio.dev).

### What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
