Nodes/ComfyUI Griptape Nodes/Griptape Create: Rules
ComfyUI Node

Griptape Create: Rules

Teach Your Agent How to Behave in One Text Box

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Create: Rules
    • RULES
    • NAME
    nameMy rules
    rulesAlways be kind and friendly Keep resposnses brief, but not curt

    Griptape Create: Rules is where you tell your agent who it is. Give it a name and a list of instructions - one per line - and it packages them into a RULESET that constrains how the agent behaves. This is the pack's personality node: tone, formatting, guardrails, "never do X" rules all live here. No API key, no LLM call - it just turns your text into the Griptape structure the agent consumes.

    What it's for

    Griptape agents are only as well-behaved as their rules. The README frames rules as controlling "agent behavior and personality," and this node is the primary way you author them in ComfyUI. The default text in the node is a good template: "Always be kind and friendly / Keep responses brief, but not curt." Two lines, two rules, instant behavior.

    The pattern: Create Rules makes a ruleset → Griptape Combine: Rules List merges several of them → the combined RULESET goes into an agent's rulesets input. If you only need one set of rules, you can skip the combine step and wire this node's output straight in.

    How it works

    Every line in the multiline rules field becomes a separate Rule, and those rules get bundled into a Ruleset named after your name field:

    rules = rules.split("\n")
    for rule in rules:
        my_rules.append(Rule(rule))
    ruleset = [Ruleset(name=name, rules=my_rules)]
    

    So the line break is the separator - each line is one instruction. Keep rules as short, declarative sentences and the agent can actually follow them; paragraphs get mushy.

    Inputs and output

    • name (STRING, default "My rules") - the ruleset's name. Give it something meaningful ("writing style", "safety constraints") - it shows up in debugging and in combined rulesets.
    • rules (STRING, multiline) - one rule per line. Default: "Always be kind and friendly / Keep responses brief, but not curt".
    • Outputs: RULES (RULESET) - the bundled rules, and NAME (STRING) - the ruleset name, passed through for convenience.

    Installation

    Part of ComfyUI Griptape Nodes:

    • ComfyUI Manager: search "Griptape" → install.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/griptape-ai/ComfyUI-Griptape, restart ComfyUI.

    Gotchas

    • Each line = one rule. If you paste a big paragraph, it becomes one giant rule, and models handle short discrete rules far better.
    • Rules are advisory, not enforced. A strong model follows them; a weak one ignores them. If your agent "forgets" the rules, that's a model choice, not this node's fault.
    • The default ruleset name is "My rules" - rename it, or your debugging logs will be full of anonymous rulesets.

    For a beginner, this is the highest-leverage node in the pack after Create Agent itself. Ten minutes writing good rules changes an agent more than any parameter tuning will.

    CategoryGriptape/Agent Rules

    Inputs (2)

    NameTypeDefaultDescription
    nameSTRINGMy rules
    rulesSTRINGAlways be kind and friendly Keep resposnses brief, but not curt

    Outputs (2)

    NameTypeDescription
    RULESRULESET
    NAMESTRING