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 agent 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_email 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 agent and click the Connectors tab.
- Click Rules on a connector's card. The button 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.
- A connector 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.
Rules also count toward the safety score: a risky tool with a rule loses fewer points. See Safety score.
Built-in memory and Slack tools can take rules too. See Built-in tools.