Tool Policy
Abstract capability-based tool policy system for controlling agent permissions
Weave uses an abstract tool policy system to control what agents can do. Instead of listing specific tool names, you declare permissions for five high-level capabilities. Adapters then map these abstract capabilities to the concrete tools available in each harness.
The Five Capabilities
Section titled “The Five Capabilities”All tool policy in Weave is expressed using five abstract capabilities:
| Capability | Meaning |
|---|---|
read |
Read access to files, memory, or other data sources |
write |
Write access to files, memory, or other data sinks |
execute |
Execution of commands, scripts, or processes |
delegate |
Spawning sub-agents or delegating work to other agents |
network |
Outbound network access (HTTP, WebSocket, etc.) |
These capabilities are harness-agnostic. The engine evaluates policy using only these five keys. Adapters translate them into concrete tool allow/deny/prompt decisions for the specific harness they target.
Permission Values
Section titled “Permission Values”Each capability can be set to one of three values:
allow- Grant the capability without promptingdeny- Block the capability entirelyask- Require user approval before granting (default)
Default Behavior
Section titled “Default Behavior”When a capability is not explicitly declared in a tool_policy block, it defaults to ask. This ensures that agents never silently gain permissions you did not configure.
If you omit the entire tool_policy block, all five capabilities default to ask.
Declaring Tool Policy
Section titled “Declaring Tool Policy”Tool policy is declared in the tool_policy block of an agent or category definition:
agents: researcher: prompt: You are a research assistant. tool_policy: read: allow write: deny execute: deny delegate: deny network: allowIn this example:
- The agent can read files and make network requests without prompting
- It cannot write files, execute commands, or spawn sub-agents
- Any capability not listed (none in this case) would default to
ask
Partial Policy
Section titled “Partial Policy”You can declare only the capabilities you want to change from the default:
agents: writer: prompt: You are a documentation writer. tool_policy: read: allow write: allowHere, read and write are set to allow, while execute, delegate, and network default to ask.
Category Policy
Section titled “Category Policy”Categories can declare tool policy that applies to all agents in that category:
categories: research: tool_policy: read: allow network: allow execute: denyAgents in the research category inherit this policy. Generated shuttle-{category} agents also inherit their category’s tool policy.
How Adapters Use Policy
Section titled “How Adapters Use Policy”The engine evaluates tool policy before passing agents to an adapter. The adapter receives:
- Effective tool policy - A fully-resolved policy with all five capabilities explicitly set (no missing values)
- Raw tool policy - The original declared policy from your config (may be partial or undefined)
The adapter uses the effective policy to determine which tools to enable, disable, or gate behind user prompts. The raw policy is available for harness-specific translation logic.
For example, an adapter might map:
read: allowto enablingread_file,list_directory,grep, etc.execute: denyto disablingbash,shell,run_command, etc.network: askto prompting before allowingfetch,http_request,websocket, etc.
The exact mapping depends on the harness and adapter implementation. The engine never hard-codes concrete tool names.
Effective Tool Policy
Section titled “Effective Tool Policy”Internally, the engine produces an EffectiveToolPolicy for every agent. This is a fully-resolved policy where all five capabilities have explicit values:
type EffectiveToolPolicy = { read: "allow" | "deny" | "ask"; write: "allow" | "deny" | "ask"; execute: "allow" | "deny" | "ask"; delegate: "allow" | "deny" | "ask"; network: "allow" | "deny" | "ask";};The engine computes this by taking your declared policy and filling in ask for any missing capabilities. Adapters receive this complete policy and can apply it directly without re-implementing default-filling logic.
Examples
Section titled “Examples”Read-only agent
Section titled “Read-only agent”agents: auditor: prompt: You audit code for security issues. tool_policy: read: allow write: deny execute: deny delegate: deny network: denyThis agent can only read files. All other capabilities are blocked.
Interactive agent
Section titled “Interactive agent”agents: assistant: prompt: You help with general tasks. tool_policy: read: ask write: ask execute: askThis agent prompts before reading, writing, or executing. delegate and network default to ask as well, so all capabilities require approval.
Autonomous agent
Section titled “Autonomous agent”agents: builder: prompt: You build and test software. tool_policy: read: allow write: allow execute: allow delegate: deny network: allowThis agent can read, write, execute, and make network requests without prompting. It cannot spawn sub-agents.
Related
Section titled “Related”- Agents - How agents are composed and configured
- Categories - How categories inherit and apply tool policy
- Adapters - How adapters translate abstract policy to concrete tools
- DSL Configuration - Full DSL syntax reference