Skip to main content

Frameworks

Google ADK Integration

Send the model calls of a Google Agent Development Kit (ADK) agent through your Verdictan gateway. ADK's LiteLLM connector speaks the OpenAI format, so you point it at the gateway and every model call the agent makes passes your policies.

Before you start​

Configure the client​

Set three variables in the terminal where the agent runs:

export VERDICTAN_GATEWAY_URL="http://127.0.0.1:41002/v1"
export VERDICTAN_CLIENT_TOKEN="<application-token>"
export VERDICTAN_MODEL="<configured-model>"

If the gateway runs on another host, use its base URL instead, still ending in /v1.

Install ADK and LiteLLM:

python -m pip install google-adk "litellm>=1.84"

Send a request​

  1. Create a package for the agent:

    mkdir governed_agent
    governed_agent/__init__.py
    from . import agent
  2. Define the agent next to it:

    governed_agent/agent.py
    import os
    from google.adk.agents import LlmAgent
    from google.adk.models.lite_llm import LiteLlm
    
    root_agent = LlmAgent(
        name="governed_agent",
        instruction="Answer briefly. Say Hello when asked for a connection check.",
        model=LiteLlm(
            model=f"openai/{os.environ['VERDICTAN_MODEL']}",
            api_base=os.environ["VERDICTAN_GATEWAY_URL"],
            api_key=os.environ["VERDICTAN_CLIENT_TOKEN"],
            num_retries=0,
            timeout=60,
        ),
    )
  3. From the parent directory, start the agent and type Reply with Hello.:

    adk run governed_agent

The agent answers briefly. The openai/ prefix tells LiteLLM which wire format to use; the part after it is sent as the model and must match your Verdictan target.

To move an existing agent over, replace its model with this LiteLlm connector. An agent that uses several models needs one connector for each model that should go through Verdictan. See the ADK LiteLLM guide.

Handle gateway decisions​

One user turn can produce several model calls, especially with tools. Verdictan governs each model call it receives. It does not run your local tools or see calls that bypass the gateway.

  • A block is a refusal. Don't let the agent call the model again to get around it.
  • An escalation is waiting for human review. It is not an empty answer.
  • A budget or permission error needs a configuration change before a retry.
  • With output policies that need the complete answer, streaming arrives in one piece at the end.

LiteLLM retries are off in the example. Check your agent runtime's own retry settings too. See Error Handling and Streaming and SSE.

Find the requests in Verdictan​

Open History (with capture on) or the delivered gateway events, and check the model, the decision, and the number of requests. A tool loop creates one record per model call, so compare them with the agent trace.

Start without tools. Once a plain model call works, add one read-only tool and check again.

Next steps​