Skip to content

intutic_clawde.gate.adapters.google_adk ​

Google ADK adapter: IntuticPlugin (global) plus a per-agent callback fallback.

Google ADK (v2.7.1+) documents before_tool_callback — implemented both as a BasePlugin method (fires for every tool call across an App) and as a per-agent constructor argument (LlmAgent(before_tool_callback=...), fires only for that agent's tools). Returning a non-None dict from either SKIPS the real tool execution and that dict becomes the (synthetic) tool result — this IS ADK's documented veto point, not an inferred one.

Verified live against google-adk==2.7.1 by reading google/adk/flows/llm_flows/functions.py directly (not just its docs):

  • the plugin path is checked FIRST (plugin_manager.run_before_tool_callback, called with keyword args tool=, tool_args=, tool_context=);
  • only if that returns None does ADK fall through to the per-agent canonical_before_tool_callbacks, called with a DIFFERENT keyword convention — tool=, args= (not tool_args), tool_context=. IntuticPlugin.before_tool_callback and intutic_before_tool_callback below match each call site's real signature exactly, not a single shared one.
  • tool.name is a required constructor field on BaseTool — always present.

Optional import: importing this module never fails even without google-adk installed. Only instantiating IntuticPlugin (or calling intutic_before_tool_callback) requires it — pip install intutic-clawde[google-adk].

Classes ​

IntuticPlugin ​

python
class IntuticPlugin(*, name: str = 'intutic_governance', gate: Optional[Gate] = None)

Bases: BasePlugin

ADK BasePlugin — vetoes every tool call across an App.

Usage:

python
from google.adk.apps.app import App
from intutic_clawde.gate.adapters.google_adk import IntuticPlugin

app = App(name="my_app", root_agent=agent, plugins=[IntuticPlugin()])

Methods ​

IntuticPlugin.before_tool_callback() ​
python
async def before_tool_callback(
    *,
    tool: Any,
    tool_args: Dict[str, Any],
    tool_context: Any,
) -> Optional[Dict[str, Any]]

Functions ​

intutic_before_tool_callback() ​

python
async def intutic_before_tool_callback(
    *,
    tool: Any,
    args: Dict[str, Any],
    tool_context: Any,
    gate: Optional[Gate] = None,
) -> Optional[Dict[str, Any]]

Per-agent fallback for callers not using App(plugins=[...]).

Usage:

python
from google.adk.agents.llm_agent import LlmAgent
from intutic_clawde.gate.adapters.google_adk import intutic_before_tool_callback

agent = LlmAgent(..., before_tool_callback=intutic_before_tool_callback)

Note the different keyword shape versus the plugin path above (args=, not tool_args=) — this is ADK's own per-agent calling convention, not a typo; see this module's doc comment.

The circuit breaker for AI agents