Tool Rules
A rule is a check Willow's gateway runs on every call of one tool, before the tool runs. It looks at what the assistant is about to send and either blocks the call or asks you first.
Use rules when a tool is fine most of the time but not always. For example:
- Block send-gmail-message when to ends with
@rival.com. - Ask first when amount is more than
100. - Block create-issue when project isn't
SUPPORT.
Add a rule
- Open the assistant's page and scroll to Connectors.
- Click the rules icon on an app's card. It appears once at least one tool is on.
- Fill in the rule:
- When the agent uses: the tool.
- and its argument: the field to check, like
tooramount. Pick it from the list, or type it. Use dots to reach inside an object, likemessage.to. - matches: how to compare, and the value.
- then: Block it or Ask first.
- Click Add rule.
The card shows each rule in plain words, like "Blocks when to ends with "@rival.com"".
How matching works
| Comparison | Example |
|---|---|
| contains, doesn't contain | subject contains "invoice" |
| is, isn't | status is "draft" |
| starts with, ends with, doesn't end with | to ends with "@acme.com" |
| is more than, is less than | amount is more than 100 (numbers only) |
- Matching ignores case.
- If the argument is a list, like several recipients, the rule matches when any item does.
- An app can have up to 20 rules.
Rules and approvals
Ask first works like a tool set to Ask Each Time, but only for the calls that match. Block it means the call never runs, even if you'd approve it. On Instinct's page, a tool with an Ask first rule shows as Sometimes asks first.
Rules also count toward the safety score: a risky tool with a rule loses fewer points. See Safety score.