Overview
Every tool call captured by TraceCtrl is automatically classified into a risk category based on its name and description. This classification is stored in thetracectrl.tool.category span attribute.
The classification happens in the TraceCtrlSpanProcessor — no configuration required beyond installing the processor on your TracerProvider.
Risk Categories
There are 8 categories. Rules are evaluated in priority order — the first match wins. Both the tool name and description are checked (case-insensitive).How It Works
Theinfer_tool_category() function matches against the tool’s name and description using keyword rules. The first matching rule wins:
infer_tool_category(tool_name: str, tool_description: str = "") -> str.
Matching Logic
Rules are evaluated in priority order — the first match wins. Both the tool name and description are checked (case-insensitive). The rules are defined intracectrl.inference.TOOL_CATEGORY_RULES.
The description field is important for accurate classification. A tool named
process_data would be classified as internal_api, but if its description contains “fetches data from external HTTP endpoint”, it would match external_api.Related Inference: Tool Direction
Alongside the category, the processor also stampstracectrl.tool.direction via infer_tool_direction() — one of input, output, or internal. This describes whether the tool brings data into the system (e.g., receive, fetch, webhook_handler), pushes data out (e.g., send, post, publish), or operates internally.
Why This Matters
Tool category classification enables:- Risk scoring — agents with access to
code_executionoremailtools are inherently higher risk - Attack path analysis — TAGAAI identifies exploitation chains through high-risk tool categories
- Topology visualization — the dashboard shows tool nodes colored by risk level
- Alerting — trigger alerts when unexpected tool categories appear in agent behavior

