Skip to main content

Module tool_authorization

Module tool_authorization 

Source
Expand description

What a chatbot tool requires of its caller: checked against the turn before the tool is offered to the LLM, and against the call’s own arguments before it runs.

A tool states its requirements in the application’s own authorization vocabulary rather than a chatbot-local one, so a tool cannot bring a policy of its own and the chatbot cannot drift from what the equivalent HTTP endpoint allows.

Structs§

ToolAuthorization
Proof that the caller was authorized for Tool before the tool ran.

Enums§

ToolRequirement
One check a tool’s caller must pass. A tool lists every resource its call touches; all of them must pass, so a call naming both a user and a course is authorized for both.

Functions§

authorize_requirements 🔒
The token proving requirements all passed, or None when any of them did not.
authorize_tool_call
Proof that the caller may make this call of Tool, or None when they may not.
requirements_are_satisfied
Whether requirements all pass, for the callers that decide what to offer or whether to abort rather than gating a mutation.