Documentation
¶
Overview ¶
Package aitools exposes AgentProvenance's read surface, the inline policy gate, and the context-write surface as AI-callable tools. It is the single source the provider adapters (Anthropic tool-use, OpenAI function-calling, generic/MCP) are generated from, plus a dispatcher that executes a tool against the local store / policy engine.
Trust boundary (see docs/ai-access.md §0): these tools let a model QUERY the verifiable graph, pre-flight a proposed action, and ASSERT its own app-side context (bind_scope / record_tool_call). They never let the model fabricate system events or signatures: context-write rows are recorded as ai_asserted and execute nothing, and the gate's verdict is computed by the trusted policy engine, not the model. Tool.Writes marks the mutating context-write tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnthropicTools ¶
AnthropicTools renders the catalog as Anthropic tool-use definitions.
func GenericTools ¶
GenericTools renders a provider-neutral catalog.
func OpenAITools ¶
OpenAITools renders the catalog as OpenAI function-calling definitions.
Types ¶
type Tool ¶
type Tool struct {
Name string
Description string
InputSchema map[string]any
// Writes is true for tools that mutate the local store (the context-write
// surface). Read tools and the no-side-effect gate leave it false. Adapters
// use this to advertise read-only-ness (e.g. the MCP readOnlyHint).
Writes bool
Run func(db *sql.DB, input map[string]any) (any, error)
}
Tool is one AI-callable operation.