Intelligence · function
admitToolCall
Whether a proposed tool call may be accepted.
Explained in Agents and behaviour.
function admitToolCall<W>(registry: ToolRegistry<W>, policy: ExecutionPolicy, budget: Budget, toolId: string, args: unknown, nowMs: number, rates?: RateWindows): Admissionimport { admitToolCall } from '@driftengine/ai';Parameters
| Parameter | Type | Description |
|---|---|---|
registry | ToolRegistry<W> | |
policy | ExecutionPolicy | |
budget | Budget | |
toolId | string | |
args | unknown | |
nowMs | number | |
rates? | RateWindows |
In depth
The order is fixed and the first failure wins. A call that is both unknown and over budget always reports that it is unknown, because a consumer chasing a message that changes between runs finds nothing wrong with either check. Order: exists, permitted, needs approval, arguments valid, within rate, within budget — cheapest and most specific first, so the message names the thing a reader can act on.
This is the acceptance check. It does not run the tool's own admits guard: that
runs at the tick boundary where the call is applied, because a snapshot is never
authority and a buffered intent widens the gap between the two moments.