PolicyHook class abstract

A composable policy hook that intercepts the agent loop (FR-011).

Hooks are registered with a PolicyShell and run in registration order. Each can be individually disabled via enabled.

Implementers

Constructors

PolicyHook()

Properties

enabled ↔ bool
Whether this hook is currently active. Disabled hooks are skipped by the PolicyShell.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id → String
Stable identifier for this hook (e.g. tool_gating, mission_budget, mission_trace).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

afterToolCall(ToolCallContext ctx, ToolResult result) → Future<ToolResult>
Called after a tool has returned. May modify result (e.g., the oversized-result guard swaps in an ArtifactReference).
beforeToolCall(ToolCallContext ctx) → Future<HookDecision>
Called before a tool is invoked. Returns a HookDecision that the shell uses to allow / deny / cancel the call.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onMissionEnd(String missionId) → Future<void>
Called once when the mission ends (terminal state).
onMissionStart(String missionId) → Future<void>
Called once before the mission starts.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited