Skip to content
API Blog

Tool policy

Tool policy is operator-controlled configuration on defineAgent({ tools }).

const support = defineAgent({
id: "support",
tools: {
allowed: ["Read", "Grep", "mcp__gmail__*"],
denied: ["Bash(rm:*)"],
strict: false,
preApproved: [
"/mcp/gmail/tools/list_messages",
"/mcp/linear/tools/*",
],
},
});
FieldPurpose
allowedAdds visible worker tools using Claude Code-style patterns
deniedAlways blocks matching tools and wins over allowed
strictWhen true, only allowed tools are visible
preApprovedLets matching MCP operations run without another in-thread approval card

preApproved is separate from worker visibility. A tool can be visible and still require approval.

NeedUse
Teach a procedureSkill
Make a tool visible or invisibleallowed, denied, strict
Pre-approve a known MCP operationpreApproved
Inspect arguments before a tool runspre-tool guardrail
Restrict HTTP destinationsAgent network policy
Add an external system or actionConnector

Tool authority belongs to the operator, not to a prompt or local skill file.

Local SKILL.md files provide instructions and optional Nix package requirements. Tool visibility, MCP grants, network policy, and guardrails stay in operator-owned configuration.

Keeping policy in lobu.config.ts makes authority changes visible in review and reproducible through lobu apply.

Connector and MCP operations may carry annotations such as destructiveHint, openWorldHint, and idempotentHint.

Prefer narrow pre-approval entries:

preApproved: ["/mcp/gmail/tools/list_messages"]

over broad wildcards:

preApproved: ["/mcp/gmail/tools/*"]