On this configuration:
- The
security-gategroup runsgate.pyearlier than eachcode_executionorwrite_filename. If the script returns{"resolution": "deny", "motive": "..."}, the software name is skipped and the rejection motive is handed into the mannequin’s context. - The
auto-formatgroup runsauto_lint.pyafter each software finishes to implement code styling. - Hooks additionally help
httpsort handlers that POST on to an exterior endpoint.
For full HTTP hook definitions and failure dealing with semantics, discuss with the hooks documentation.
Groups are already utilizing hooks to construct production-grade validation pipelines. For instance, AI-native funding financial institution Offdeal makes use of post_tool_execution hooks to run automated picture verification contained in the distant sandbox.
“OffDeal is an AI-native funding financial institution, and Archie is the AI analyst our bankers use day-after-day. A requirement for banker-ready decks is corporate logos: purchaser tables, sponsor columns, tombstone grids, typically 30+ logos in a single deck, each considered one of which have to be the best firm, the suitable dimension and side ratio, comprise the identify, have a clear background, and have a excessive distinction when positioned on a white slide.
Earlier than agent hooks, we couldn’t do that on Gemini’s managed brokers: the sandbox is distant, so our validation code had nowhere to run. With hooks, a post_tool_execution hook triggers our pipeline contained in the sandbox the second Archie writes its firm checklist, fetching candidates, imposing pixel-level high quality checks, verifying every brand with Gemini imaginative and prescient, and publishing a manifest of accepted information which might be the one photographs allowed into the deck.”
– Alston Lin, Founder & CTO of OffDeal
Value management and automation options
Free tier availability
Managed brokers at the moment are out there on free tier tasks. Builders can experiment with agentic workflows utilizing an API key from a challenge with out energetic billing.
Price range controls
As a result of managed brokers execute multi-turn autonomous loops, advanced duties can devour vital token budgets. To stop runaway duties, you possibly can go max_total_tokens inside agent_config to cap complete consumption (enter + output + pondering).
When the agent reaches the restrict, execution safely pauses and the interplay returns standing: "incomplete". The setting state is preserved, enabling you to proceed the place it stopped by passing previous_interaction_id with a recent price range.






