Prerequisites
- A Handlebar account
- Handlebar API key (created on the platform)
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: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
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
TERMINATEcontrol 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, userun_sync from Handlebar core to initialise the client before passing it to the plugin:
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.