Tool call governance is currently in limited beta. Contact Opal support to enable it for your organization.
Requirements
Before you begin, you must:- Be an Opal Admin to create or change rules. Read-only admins can view them.
- Have tool call governance enabled for your organization, and at least one agent set up.
Opal turns on enforcement for each organization. Until it is on for yours, a rule records what it would have done and stops nothing. Once it is on, a rule stops calls from the agents whose Enforce switch is on, and calls through Anthropic’s inference hook. See Log, Enforce and conversation content.
Choose a result
Opal has no approval queue for tool calls. A call that needs confirmation is confirmed by the person using Claude Code, or it’s refused.
Choose what a rule matches
Each rule needs at least one condition. A call matches the rule only when it meets every condition. A call meets a condition when it matches any of the values you list in it. The exception is Session, where a call must match both the permission mode and the folder, if you set both.
In a pattern,
* matches any run of characters and ? matches exactly one. Patterns ignore case and must match the whole value. They aren’t regular expressions. In Tool and Arguments patterns, separate alternatives with a vertical bar, as in Bash|Shell. Server name, Agent app and Folder take one pattern. For example, a Tool of Bash|Shell and an Arguments pattern of *terraform destroy* match a shell command that runs terraform destroy.
An Arguments pattern is tried against the command or path, against every value the call sent, and against the raw input. To match text anywhere in a value, wrap it in *, as in *DROP TABLE*. To apply the rule to every call except the ones that match, turn on Apply to every call except these. Exceptions work for file paths (Read, Edit, Write and NotebookEdit) and for the domain of a web fetch, such as docs.example.com. The pattern is matched against the domain, not the whole address, and file path exceptions are case-sensitive. Shell commands and MCP calls always match.
To name specific people, groups or agents, describe them to Agent Consul, or open a call in Activity and select Make a rule from this call. The rule form can’t pick them by hand. Once a rule is saved, neither the policy list nor the editor shows who it names, only how many.
Decide what wins when rules conflict
More than one rule can match a call. Opal decides in this order.- A pause wins over everything else.
- A server you blocked on the Tools tab is blocked, whatever the rules say.
- Otherwise, the switch at the top of Policies decides: Strictest wins or In order. Only admins can change it, and it applies from the next call.
- Strictest wins is the default. The most severe result wins: Block, then Ask the developer to confirm, then Allow and flag, then Allow. An Allow rule never overrides a Block rule.
- In order lets the first matching rule in the list decide, whatever its result. An Allow rule above a Block rule lets the call through. Drag the rules into the order you want, then select Save order.
- If no rule matches, Tool defaults decide.
Set Tool defaults
Calls that no rule matches follow Tool defaults. Select Tool defaults next to Rules on the Policies tab.
A default of Ask or Block stops calls the same way a rule does. For agents that run a hook, it follows the same Enforce settings. Through Anthropic’s inference hook, a default of Ask refuses the call.
Calls that Opal flags without a rule
Opal also flags a call on its own when its arguments contain a credential that it recognizes by its shape, a US social security number, or a payment card number. It does this when no rule matches, and when an Allow rule matches. A stronger result, such as Block, still wins. Activity shows the reason, for exampleArguments contained: GitHub token. Calls through Anthropic’s inference hook are also flagged for an email address or a phone number.
Start from the recommended rules
Every organization starts with a set of recommended rules. They all use Allow and flag, so none of them stops a call. You can edit any of them, turn it off, or change its result.
If you delete a recommended rule, select Restore recommended rules to add it back. Restoring leaves the rules you edited or turned off as they are.
Create a rule
- Go to Agent Center > Policies.
- Select New policy.
- If you see Describe the rule, type what you want in plain English and select Draft rule. Agent Consul fills in the form for you to check and edit. Nothing applies until you save the rule. To skip it, select Create manually.
- Enter a Rule name. You can add a Description, which admins see in the policy list and on each call the rule decides.
- Choose a Result.
- Select Add condition, and add at least one.
- Check Would have matched to see which recent calls the rule matches.
- Select Create rule. The rule applies from the next tool call.
Test a rule
Test a rule before you rely on it.- In the rule form, Would have matched shows how many calls from the last 24 hours the rule matches, then the count for the last 7 days. It lists example calls, and shows how many of the checked calls would get a different outcome. When nothing matches, it suggests similar tool names.
- For an Arguments pattern, use Try the pattern. Type sample commands, paths or URLs, one per line, to see which ones match. Opal doesn’t save the samples.
- To try a rule on live calls without stopping anything, set the agent to Log on and Enforce off under Setup > Clients. Rules run, and Activity shows Would have blocked or Would have asked for the calls a rule would have stopped.
- Ask the agent to run a harmless command that the rule matches, such as
echo opal-test, and check Activity.
What developers see when a call is stopped
- A rule, a default or a blocked server stops a call. The agent doesn’t run the call. Opal sends the agent the reason.
- A rule or default asks the developer to confirm. Claude Code asks the person to confirm the call. Cursor and Codex can’t ask, so they refuse the call, and Opal’s reason says why. Calls through Anthropic’s inference hook are refused too.
- A pause is in force. The agent doesn’t run the call. See Pause agents for what Opal sends.
- A call is allowed or flagged. Nothing changes for the developer.
Next steps
- See what each outcome means: Read the outcome in Activity.
- Choose what each agent logs and enforces: Log, Enforce and conversation content.
- Stop agents for a while: Pause agents.