AI Agent

Bot rules

A few short guardrails the AI agent keeps in mind in every conversation, and why fewer work better.

A bot rule is a short instruction the AI agent keeps in mind in every conversation, such as "never promise a specific delivery date" or "never give legal advice about a claim". Rules sit in the system prompt on every turn, so they hold whatever the conversation is about. That makes them the right place for a handful of guardrails, and the wrong place for almost everything else.

What you can do

  • Set hard limits that apply everywhere. Never confirm that a claim will be paid, never share details of another customer's account, never quote a price the catalog doesn't show.
  • Protect your brand with a few always-on principles, such as never commenting on competitors.
  • Scope a rule to channels, such as a "keep replies short" rule for web chat only.
  • Restore an earlier version of any rule from its version history.

Set it up

Ask Copilot or your AI agent

Add a bot rule for every channel: never confirm that a claim will be paid or say how much it will pay. Only our claims team decides that.

The most useful request is often a review rather than a new rule:

Ask Copilot or your AI agent

Review our bot rules. Move facts into knowledge articles and scenario-specific steps into workflows, and keep only the guardrails that must hold in every conversation.

In the dashboard, go to Settings -> Automation -> Knowledge -> Bot Rules.

How it works

A rule is part of the AI agent's instructions on every turn. That always-on quality is what makes a rule effective, and also what makes it costly. A bot rule should be the last tool you reach for, not the first. How the AI agent works explains why the system prompt is the AI agent's always-present memory.

Behavior and knowledge can live in three places, and they differ in when the AI agent sees them:

  • Knowledge base entries are looked up on demand: the AI agent searches for them only when they're relevant.
  • Workflows are loaded when a matching situation arises: their instructions appear only when needed.
  • Bot rules are never loaded on demand. They sit in the system prompt for every single message, relevant or not.

Every rule you add is rent the AI agent pays on every turn. Think of bot rules as the few things you'd pin to a new agent's monitor on their first day, not their entire training manual.

The core question: does the AI agent need to always know this?

Before adding a rule, ask that one question. It's the whole discipline in a sentence:

If the AI agent doesn't need it in mind all the time, don't put it in a rule. Context is valuable, finite space.

Most things you're tempted to add belong somewhere else:

If what you're adding is...Put it in...Because...
A fact the AI agent only needs sometimes (a policy detail, a product or plan nuance, an edge-case answer)The knowledge base: add or update an articleThe AI agent searches for it exactly when it's relevant, and not before
Behavior tied to a specific scenario ("when a customer wants a refund, do X")A workflowThe AI agent loads those instructions only when that situation comes up
A genuinely global behavior the AI agent must follow everywhere (safety, hard prohibitions, brand-critical tone)A bot ruleThis really does need to be always on

A few examples to make the boundary concrete:

  • "Our return window is 30 days." or "Roaming is included in the Plus plan." -> Knowledge base. It's a fact, looked up when a customer asks.
  • "When a customer reports a damaged item, collect photos before offering a refund." -> Workflow. It's a procedure for one scenario.
  • "Never promise specific delivery dates.", "Never confirm that a claim will be paid." -> Bot rule. These are always-on guardrails that apply whatever the conversation is about.

The best test for a candidate rule: would I want the AI agent thinking about this during a conversation that has nothing to do with it? If not, it's not a rule.

Why rules are limited

Bot rules have hard limits:

LimitValue
Bot rules per channel30
Length of a rule1,200 characters
Length of a rule title200 characters

The 30-rule cap counts every rule that applies on a channel: rules for all channels plus the rules scoped to that channel. A rule for all channels therefore counts toward every channel.

The limits exist because of how the AI agent works:

  • LLMs follow fewer instructions better. Overload the AI agent with always-on rules and it follows all of them less precisely. This is a well-understood property of large language models. When every rule is declared important, the AI agent can't tell which one matters most.
  • Rules compete with the real work. They share the context the AI agent uses to reason, read retrieved knowledge and run workflows. A wall of rules crowds out the actual job.

There is no priority or ordering among rules. The AI agent treats them as one flat set, all equally and always in force. That is also why contradictions between rules do so much damage: there's no tie-breaker to fall back on.

The anti-pattern: turning every idea into a rule

The most common mistake is turning every new idea, complaint or piece of feedback into another bot rule. It feels productive, and it quietly degrades the AI agent.

As rules pile up, they start to contradict each other, and the sheer volume makes the AI agent follow each one less faithfully. You end up with more rules and worse adherence, the opposite of what you wanted.

Strong setups typically run on about 15 to 20 sharp rules, each clearly earning its always-on slot. The cap of 30 is a ceiling, not a goal: racing toward it is a warning sign.

This doesn't limit you to simple setups. Octocom runs complex AI agents for large retailers, insurers and telecoms, and they work within about 20 rules. The complexity doesn't disappear. It moves to where it belongs. Scenario-specific behavior goes into workflows, which can do far more and load on demand, and factual depth goes into the knowledge base. Rules stay reserved for the handful of things that must always hold.

It's the same with people. Hand someone a hundred-page rulebook and they'll follow it poorly; give them a handful of clear principles and they'll live by them. A small, sharp set of rules is easier to follow, for an LLM exactly as for a person.

A bot rule should be your last resort. Before adding one, ask whether a workflow or a knowledge base article does the job better. If it can, use that. Reach for a rule only when the behavior is genuinely global and must always hold.

Common gotchas

Most failed bot rules aren't badly written. They ask for something a rule can't deliver. These are the five we see most often. The first three come straight from how the core loop works.

1. A rule can't give the AI agent a new capability

People write rules like "call the order lookup tool when a customer asks about an order", expecting the rule to enable that tool. It won't.

Actions are switched on only by workflows. See where tools come from. If the workflow that includes an action isn't in play, no rule can summon it. A rule can shape how the AI agent uses a capability it already has, never whether it has one.

2. A rule can't make the AI agent act outside the core loop

A classic: "if you don't have the answer now, follow up in a few hours." Scheduling, waiting and acting between messages can't be governed by a bot rule, because they happen outside the per-message loop.

Octocom does these things through dedicated features instead: follow-ups, event handlers and recurring jobs.

3. A rule can't forbid intrinsic LLM behavior

"Never make mistakes", "never hallucinate", "always be 100% accurate": these don't work. They aren't behaviors the model can switch off. They're properties of how language models work.

A rule like this mostly burns a slot. Accuracy comes from better knowledge and workflows, from putting must-hold logic in code, and from checks such as Bot QA, not from forbidding errors in prose.

4. Vague rules get vaguely followed

The AI agent fills any gap with its own judgment. "If the customer is aggressive, do X" works, but "aggressive" is left for the AI agent to define, and that is often culturally loaded.

If precision matters, define your terms. Is all-caps aggressive? Are explicit threats? Spell it out. The same goes for fuzzy style instructions: "write shorter" is much weaker than "keep paragraphs under about three sentences." The more measurable the instruction, the more reliably it's followed.

5. You can't micro-control phrasing

You can steer the AI agent away from specific words, and you can set a general tone in the writing style. You can't dictate the exact structure of every sentence.

A rule written to fix one sentence you didn't like, such as "don't phrase it like this, phrase it like that", spends a slot on a single example and usually won't generalize. Give abstract principles about how you want the AI agent to write, not one-off corrections.

A useful filter: if a rule tries to grant a capability, cancel an LLM trait or pin down something you haven't defined, it probably won't do what you hope.

Writing good bot rules

Once you're sure something belongs in a rule, keep it sharp:

  • One rule, one purpose. If a rule needs an "and" to do two jobs, it's probably two rules, or it belongs in a workflow.
  • Give it a clear, specific title. It's how both you and the AI agent tell rules apart.
  • Avoid overlap and contradiction with other rules and with your workflows.
  • Scope by channel instead of writing per-channel prose. A rule with no channels set applies everywhere; otherwise it applies only on the channels you choose, for example a "keep replies short" rule for web chat. Don't cram "on email do X, on chat do Y" into one rule.
  • Stay well inside the length limit. A rule close to 1,200 characters is likely knowledge base material in disguise.
  • Be explicit, not impressionistic. See gotchas 4 and 5.
  • Put voice in the writing style. Tone and formatting preferences belong in the writing style, not in rules.

Managing bot rules

  • In the dashboard: Settings -> Automation -> Knowledge -> Bot Rules. Create, edit, scope to channels and archive rules there.
  • With Copilot or MCP: list_bot_rules, create_bot_rule, update_bot_rule and archive_bot_rule through Octocom MCP.
  • With the REST API: GET, POST, PATCH and DELETE /rest/v1/bot-rules. See the REST API.
  • Version history: rules keep their versions. Use list_bot_rule_versions and restore_bot_rule_version to recover an earlier version or undo an archive. Review the current rule before restoring a version that replaces later edits.

On this page