Skip to content

[FEATURE] Ability to detect whether a tool is an agent vs regular tool #1598

@nagabharann

Description

@nagabharann

Problem Statement

There is no way to distinguish between a regular tool and an agent wrapped as a tool (e.g., via agent.as_tool()). This prevents differentiated handling, logging, and security policies for agent-based tools.

Proposed Solution

Provide a detection mechanism:

  1. A property on tool objects indicating if they wrap an agent
  2. A type or interface for agent-tools vs regular tools
  3. Metadata accessible in hooks to identify tool type

Use Case

In multi-agent orchestration:

  1. Apply different timeout policies for agent-tools vs regular tools
  2. Log agent-tool invocations with additional context
  3. Apply security policies specific to agent delegation
  4. Track agent-to-agent calls separately from tool calls for observability

Alternatives Solutions

We currently use naming conventions or wrapper detection heuristics, which are fragile.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions