Pre-tool plugin callback · PyPI 0.1.1 · Alpha · Apache-2.0

adk-acgs for Google ADK.

Package Specification · Inspected HEAD e8f75cf

Framework maintainer
Google · adk.dev
Upstream repository
google/adk-python
PyPI release
adk-acgs==0.1.1
Python requirement
>=3.10
Framework constraint
google-adk>=2.0.0,<3
Governance engine pin
acgs-lite>=3.0.1,<4
Integration mechanic
Pre-tool veto / intervention hook
Hook entry point
ACGSPlugin.before_tool_callback

01 · Local Setup & Quickstart

Attach governance to one tool-calling agent.

Install the pinned release from PyPI alongside acgs-lite>=3.0.1,<4. Rule evaluation uses deterministic keyword and regex matching locally in Python—no external model or network call is made by the governance check.

Caveat: Veto-only callback before tool execution; relies on the ADK runner invoking plugin callbacks for every governed tool.

Shell · PyPI installation

Alpha
pip install "adk-acgs==0.1.1"

Python · Google ADK integration

src/adk_acgs/plugin.py#L34
from google.adk.agents import LlmAgent
from google.adk.apps import App
from adk_acgs import ACGSPlugin

root_agent = LlmAgent(
    name="assistant",
    model="gemini-flash-latest",
    instruction="Help the user.",
)
app = App(name="my_app", root_agent=root_agent, plugins=[ACGSPlugin()])

02 · Verdict & Review Mapping

How ACGS-Lite verdicts map to Google ADK.

When a tool call is proposed, the adapter formats the tool name and arguments via format_tool_call and evaluates them against the configured Constitution. Blocking rules always take precedence over review rules.

Verdict.ALLOW

Returns None from before_tool_callback so the ADK Runner proceeds with tool execution.

Verdict.DENY

Returns {'error': "Tool call '<name>' was not executed. <reason>"} which ADK surfaces as the tool result.

Verdict.REVIEW

Requests ADK tool confirmation (tool_context.request_confirmation) or invokes a custom ReviewHandler.

03 · Public API Surface

Exported symbols and source entry points.

Each adapter keeps its public surface minimal and re-exports the shared GovernanceDecision, Verdict, and ToolCallFormatter types alongside the framework-specific hook or middleware class.

__all__ exports · adk-acgs

src/adk_acgs/plugin.py#L34 ↗
ACGSPluginPLUGIN_NAMEBeforeToolCallbackReviewHandlerGovernanceDecisionToolCallFormatterVerdictformat_tool_call

Primary hook surface: ACGSPlugin.before_tool_callback. Custom ToolCallFormatter functions may be supplied if your tool arguments require custom canonical serialization before rule matching.

04 · Scope & Bypass Boundaries

What this adapter does and does not cover.

Verify these framework-specific boundaries when integrating adk-acgs into an evaluation workflow.

  1. 01

    Register ACGSPlugin on the ADK App so plugin callbacks run before agent-level callbacks across all managed sub-agents.

  2. 02

    Google ADK 2.12+ requires Python 3.11+.

  3. 03

    In the current 0.1.x adapter series, rule evaluation runs through acgs-lite's ToolCallGovernor path. If your workflow requires SignedReceipt, ExecutionGrant, or SQLite EffectStore reservations, wire those contracts explicitly at the tool executor boundary.

Put one real workflow under your control.

Choose one tool. Define what it may do. Inspect what happens when a request crosses the boundary.