Tool-hook integration
FreshCtx + Agno
Wrap an Agno tool with a FreshCtx protected-action boundary using agno_tool_hook() or agno_async_tool_hook().
What FreshCtx protects
FreshCtx protects the external evidence an Agno tool depends on. The hook wraps Agno's real tool continuation, so stale or unverifiable evidence blocks before the tool body runs under the default policy.
Where the pre-action boundary sits
The boundary sits between Agno's tool invocation and the tool body. Attach a hook to the specific tool whose declared dependencies it protects, or at agent level only when the same dependency set genuinely applies to every tool.
Limitations
- The application must preserve the FreshCtx store and dependency identifiers from observation through tool execution.
- FreshCtx does not repair Agno's internal lifecycle state, prevent concurrent invocation by itself, or replace transactions and idempotency.
- The underlying pre-action contract is experimental and is not part of the stable public API.
Installation
python -m pip install 'freshctx[agno]==0.9.0'Minimal example
from freshctx.integrations.agno import agno_tool_hook
hook = agno_tool_hook(depends_on=[decision], store=store)
@tool(tool_hooks=[hook])
def write_record(record_id: str) -> str:
return record_idContinue
FreshCtx quickstartFreshCtx homepageExamples ↗LangGraphOpenAI Agents SDKGoogle Agent Development KitMCP Guard
Third-party names and logos are trademarks of their respective owners. Their appearance identifies compatible integration surfaces and does not imply endorsement or partnership.