Skip to main content
N.b. Handlebar currently only supports Python agents via the Google ADK.

Prerequisites

Python

Install the adapter alongside the Google ADK SDK:

Minimal setup

Set your API key in the environment and add a single plugin to your runner:
That’s it. Every LLM call and tool invocation is now governed and audited.
You can view your agent runs and configure rules on the Handlebar platform.

Additional config

With a pre-initialised client

If you need multiple runners to share one client (and therefore one connection / audit stream):

Tool tags

By defining metadata on your tools, you can enforce useful policies to prevent dangerous actions. For example:
  • rate limiting “expensive” tool calls
  • Blocking data exfil, e.g. a “pii read” operation flowing into “external”
  • Redacting PII from external-facing tools
ADK tools don’t have a native tags concept. Pass Handlebar tags via custom_metadata when you define the tool so that governance rules can match on them:

What happens on a block

When a governance rule blocks a tool call:
  • The tool does not execute.
  • The agent receives {"error": "Blocked by Handlebar governance: <reason>"} as the tool result.
  • If the rule carries a TERMINATE control signal, the agent loop stops immediately after the block (no further LLM calls are made).
  • The run is ended with status "interrupted" and all events are flushed to the audit log.

Sync usage

If you are running outside an async context, use run_sync from Handlebar core to initialise the client before passing it to the plugin:
Note: InMemoryRunner.run_async() still needs to be awaited — this only covers client initialisation.
Please email contact@gethandlebar.com to report security issues relating to Handlebar and client packages.
Last modified on March 2, 2026