-
-
Notifications
You must be signed in to change notification settings - Fork 713
Feature: Per-tool authorization middleware for agent tool calls #1177
Description
Problem
VoltAgent provides guardrails and tool management, but there's no built-in mechanism for per-tool authorization based on agent identity.
When building multi-agent systems with VoltAgent, different agents in the workflow need different tool access levels. An orchestrator agent might need broad access, while a sub-agent it delegates to should only have read permissions.
Use Case
const agent = new Agent({
name: 'research-bot',
tools: [searchDocs, saveNote, deleteNote, deployProd],
});This agent can call all four tools. In production, you want:
research-botcan callsearchDocsonlycontent-botcan callsearchDocs+saveNoteadmin-botcan call everything- Every tool call logged with who called what and whether it was allowed
Proposal
A tool authorization hook in the agent or tool configuration:
const agent = new Agent({
name: 'research-bot',
tools: [searchDocs, saveNote, deleteNote],
toolGuard: async (toolName, context) => {
// Check against permission rules
const allowed = context.permissions?.some(
pattern => matchGlob(pattern, toolName)
);
if (!allowed) {
return { denied: true, reason: `${toolName} not in allowed tools` };
}
return { denied: false };
},
});This would integrate with VoltAgent's existing guardrails system and enable:
- Per-agent tool restrictions
- Integration with external permission engines (like AgentsID for deny-first agent permissions)
- Audit trail of tool call authorization decisions
- Delegation with automatic scope narrowing
Since VoltAgent already has MCP support, this becomes especially relevant — MCP servers expose many tools, and agents connecting to them need per-tool authorization.
Would this fit within VoltAgent's guardrails architecture, or is there an existing pattern I should use?