As agent systems grow more complex, extension points like callbacks and plugins become essential tools in your architecture. In Agent Development Kit (ADK), both callbacks and plugins let you hook into or extend agent behavior — but they serve different core purposes and are best used in different scenarios.
Understanding the distinction isn’t just semantics — it shapes clarity, control, and maintainability in agent workflows. Let’s break it down.
What Callbacks Are (and What They’re For)
In ADK, callbacks are functions you register with an agent to observe, customize, or control its execution at predefined points in the lifecycle.
Think of callbacks as checkpoints where your code can run before or after major steps like:
- Before the agent begins processing a request
- After the agent finishes its main work
- Before or after a model call
- Before or after a tool call

These functions receive context (e.g., CallbackContext), letting you inspect state, log details, enforce guardrails, or even intervene in the flow.
For example, a before-model callback can inspect or modify the request sent to the model, or prevent the call entirely by returning a response object instead of letting the default model call proceed.
Callbacks are primarily about observability and intervention. They let you add:
- Logging and debugging
- Input/output validation
- Guardrails and safety checks
- Cross-cutting concerns without changing core logic
They do not add capabilities to the agent; they control or observe what the agent already does.
What Plugins Are (and What They’re For)
Plugins in ADK are also extensibility mechanisms — but with a different emphasis.
A plugin is a reusable code module that runs at various stages of the agent workflow using callback hooks.
You register plugins at the runner level, meaning they can apply to multiple agents, tools, and execution stages within that runner. Plugins typically contain logic that applies across your agent ecosystem, such as:
- Policy enforcement
- Security guardrails
- Response caching
- Metrics and tracing
- Standardized modification of agent or tool inputs/outputs
Crucially, while plugins are built on callback mechanisms, they’re intended for workflow-wide concerns, not just per-agent behavior.
Callbacks vs Plugins: A Clear Distinction
The core difference comes down to scope and intent:
Callbacks
- Registered on a per-agent basis
- Let you observe and intervene at specific execution points
- Best for agent-specific guardrails, logging, or lifecycle hooks
Plugins
- Registered on the runner, applying across agents and workflows
- Encapsulate reusable, cross-cutting logic
- Ideal for system-wide policies or capabilities
Practical Rule of Thumb
If you need to log a specific value for one experimental agent → Use a Callback.
If you want to ensure every agent in your production app follows a specific formatting rule → Use a Plugin.
When You Might Use Each
Callbacks are great for:
- Pre-validation of model inputs
- Post-processing of model or tool outputs
- Logging every tool invocation
- Enforcing agent-specific guardrails
Plugins shine when you want:
- A shared policy layer (e.g., security checks)
- Consistent pre- and post-processing across many agents
- Metrics reporting or tracing for multiple workflows
The ADK docs even suggest using plugins instead of callbacks when building reusable guardrail logic, because plugins offer better modularity and flexibility for cross-agent concerns.
Why This Distinction Matters
In simple agents, callbacks and plugins might feel interchangeable. However, in complex systems, mixing these concerns creates “spaghetti logic.”
- Callbacks affect a single agent’s run.
- Plugins affect the entire environment’s behavior.
By separating these, you ensure that your agent-specific code stays focused on the task at hand, while your “platform” logic (security, logging, caching) lives in a centralized, testable plugin.
Final Thoughts
Callbacks and plugins are both powerful extension points in ADK — but they are designed for different layers of responsibility.
- Callbacks let you observe and intervene at key steps in an agent’s execution
- Plugins let you define broad, reusable behavior that applies across workflows.
Keeping that boundary clear aligns your code with how the framework expects extension to work — and leads to systems that are easier to reason about as they grow.
Reference
- ADK Callbacks Documentation
- ADK Plugins Documentation
Tips & Tricks: Callbacks vs Plugins in ADK — Knowing Where Responsibility Belongs was originally published in Google Cloud – Community on Medium, where people are continuing the conversation by highlighting and responding to this story.
Source Credit: https://medium.com/google-cloud/callbacks-vs-plugins-in-adk-knowing-where-responsibility-belongs-c277517473ee?source=rss—-e52cf94d98af—4
