Pre-hooks

Parameters automatically injected into pre-hook functions during an Agent or Team run.

Parameters

Running a pre-hook is handled automatically during the Agent or Team run. These are the parameters that will be injected. A hook receives only the parameters its signature declares:

ParameterTypeDefaultDescription
agentAgentRequiredThe Agent that is running the pre-hook. Only present in Agent runs.
teamTeamRequiredThe Team that is running the pre-hook. Only present in Team runs.
run_inputRunInput or TeamRunInputRequiredThe input provided to the Agent or Team when invoking the run.
run_contextRunContextRequiredThe context of the current run, carrying session_state, dependencies, metadata, and other run-scoped data.
sessionAgentSession or TeamSessionRequiredThe AgentSession or TeamSession object representing the current session.
metadataOptional[Dict[str, Any]]NoneThe metadata of the current run.
user_idOptional[str]NoneThe contextual user ID, if any.
debug_modeboolResolved entity settingPer-run override when supplied; otherwise the Agent or Team debug_mode setting (False by default).