Skip to content

Feature: Per-tool authorization middleware for agent tool calls #1177

@stevenkozeniesky02

Description

@stevenkozeniesky02

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-bot can call searchDocs only
  • content-bot can call searchDocs + saveNote
  • admin-bot can 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions