Skip to main content

Function: createToolCallGate()

createToolCallGate(service, context): GuardrailToolCallGate | undefined

Defined in: packages/agentos/src/safety/guardrails/guardrailDispatcher.ts:313

Create the tool-call gate over the guardrails that evaluate tool calls. AgentOS asks it about each call the runtime runs itself (executionMode: 'internal') before the call runs, so a block refuses the call and the tool never runs.

Parameters​

service​

Single guardrail or array of guardrails

IGuardrailService | IGuardrailService[] | undefined

context​

GuardrailContext

Conversation context for policy decisions

Returns​

GuardrailToolCallGate | undefined

The gate, or undefined when no guardrail sets config.evaluateToolCalls