Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/agentegrity/adapters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,12 @@ def _handle_pre_tool_use(self, data: dict[str, Any]) -> dict[str, Any]:

self._append_capped(
self._buffer.tool_calls,
{"tool": tool_name, "type": "tool_call", **tool_input},
# Spread the agent-supplied arguments FIRST so the trusted
# "tool"/"type" fields always win. This dict becomes
# context["action"], which GovernanceLayer's GOV-001 checks
# against the sensitive-tool set; letting an argument named
# "tool" override the real name would bypass that gate.
{**tool_input, "tool": tool_name, "type": "tool_call"},
"tool_calls",
)
self._buffer.tool_usage[tool_name] += 1
Expand Down
Loading