Skip to content

createPlanModeFilter

reference
1 min readUpdated

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

ts
function createPlanModeFilter(options: PlanModeFilterOptions): { hook: ToolPreExecutionHook; setPlanMode: (active: boolean) => void }

Parameters

NameType
optionsPlanModeFilterOptions

Returns: { hook: ToolPreExecutionHook; setPlanMode: (active: boolean) => void }

Was this page helpful?

Download as PDF