Kind: Function
Source: atloria-monorepo/libs/agent-core/src/session/plan-mode-filter.ts
Create a ToolPreExecutionHook that blocks write/mutation tools during plan mode.
When plan mode is active, any tool not in the allowed set gets a clear error message explaining that it's blocked and suggesting the agent continue with investigation. The tool never executes — it's blocked before running.
Returns the hook and a setPlanMode function to toggle blocking on/off.
Signature
tsfunction createPlanModeFilter(options: PlanModeFilterOptions): { hook: ToolPreExecutionHook; setPlanMode: (active: boolean) => void }
Parameters
| Name | Type |
|---|---|
options | PlanModeFilterOptions |
Returns: { hook: ToolPreExecutionHook; setPlanMode: (active: boolean) => void }
Was this page helpful?