RagLeap Tools v0.6.0 is now available. This alpha release introduces the first building blocks for governed tool dispatch in multi-tenant AI hosts, while preserving the existing Toolkit.call() behavior.
As AI applications evolve from single-user assistants into multi-tenant systems, tool execution needs more than argument validation and exception handling. A host must decide which tenant can invoke which tool, how frequently it can be called, and whether a particular action requires approval.
RagLeap Tools v0.6.0 introduces a foundation for that control.
Why governed tool dispatch matters
A typical tool-calling flow looks simple:
- An AI agent selects a tool.
- The application validates its arguments.
- The tool handler executes.
- The result is returned to the agent.
But in a multi-tenant environment, additional questions matter:
- Is this tool allowed for this tenant?
- Has the tenant exceeded its rate limit?
- Does this operation require approval?
- What happens if the host's policy callback fails?
- Can the host inspect an attempted call without exposing its arguments or results?
These decisions should belong to the host application, not the model.
The new release separates tool preparation from execution and introduces a governed wrapper that applies host-defined checks before a handler runs.
1. Separating preparation from execution
Two new methods are available on Toolkit.
Toolkit.prepare(name, arguments)
This method:
- Finds the requested tool.
- Parses and checks argument size.
- Validates the arguments.
- Returns the tool and validated arguments when successful.
- Returns the same failed
ToolResultthatcall()would return for a failed preparation.
Importantly, preparation does not execute the tool handler.
Toolkit.run(tool, arguments)
This method executes a tool belonging to that toolkit.
It preserves exception containment and refuses tools that do not belong to the toolkit. It also rejects arguments that are not dictionaries with string keys.
Backward compatibility
The existing Toolkit.call() now uses the prepare-then-run flow.
Existing callers can continue using Toolkit.call() without changing their integration.
2. Introducing GovernedToolkit
The new GovernedToolkit is designed for multi-tenant hosts.
Each call carries a host-established Scope. Before executing the handler, the wrapper applies a sequence of checks:
-
Scope validation: The supplied scope must be the expected
Scopetype. -
Tool authorization: The tool must exist and be permitted by the owner's
allow_for(scope)callback. The default policy is deny. - Rate limiting: A tenant-level sliding-window rate limit is checked.
- Argument validation: The tool arguments are validated.
-
Approval: Tools requiring approval must receive an exact
Truefromapprove(scope, tool, arguments). - Execution: Only after all checks pass does the handler run.
The first failure stops the process.
Malformed or raising authorization and approval callbacks result in refusal rather than allowing execution to continue.
This is an important design principle: a policy-checking failure should not silently become permission to execute.
3. Minimal call events
GovernedToolkit supports an on_event callback.
It emits a small event dictionary for each call attempt without including tool arguments or results.
This provides a basic integration point for host-side monitoring and audit systems without automatically exposing potentially sensitive payloads.
The events are delivered to the callback; this release does not provide persistent or tamper-evident event storage.
4. Integration with RagLeap Security
When the optional ragleap-security package is installed, GovernedToolkit can use its Scope implementation.
Without that optional dependency, RagLeap Tools provides an equivalent built-in scope class.
The implementation was tested against ragleap-security 0.2.0 for matching fields, key format, and error messages.
5. Testing and verification
The release was tested beyond ordinary unit-test coverage.
Compatibility testing
Toolkit.call() was compared against the previous implementation across 4,692 deterministic inputs.
The existing behavior remained unchanged in those tests.
Governed execution testing
GovernedToolkit was exercised across another 4,692 cases:
- 3,321 existing-tool cases matched the legacy
Toolkit.call()results. - 1,371 unknown or non-string tool-name cases returned the expected tool-unavailable refusal.
- Zero mismatches.
- Nothing raised unexpectedly.
Mutation testing
Deliberately modified implementations were used to check whether the tests detected incorrect behavior:
- 22 out of 22 mutations detected for
prepare()andrun()(excluding one equivalent redundant guard). - 65 out of 65 mutations detected for
GovernedToolkit.
Published package verification
The published wheel and source distribution were downloaded from PyPI and checked against the merge commit.
- Published package hashes matched the verified artifacts.
- Wheel source files matched the merge commit.
- An independent rebuild produced identical hashes.
- Installation and package checks were clean with and without optional dependencies.
- Tests passed on Python 3.10.12 and 3.12.3.
These results provide strong release-level evidence, but they do not replace testing inside real host applications.
6. Important limitations
This is an alpha release and the boundaries matter.
GovernedToolkit does not authenticate callers. It trusts the Scope supplied by the host. Therefore, tenant identity and isolation depend on the host application's authentication and scope-establishment mechanisms.
Other current limitations:
- Use a separate
Toolkitinstance per tenant. A shared toolkit may share tool state such as file roots, API keys, providers, or RagLeap instances. - Rate limits are process-local and remain until
forget(tenant)is called. - Events are delivered through
on_event; they are not automatically persisted or made tamper-evident. - The release has not yet been validated inside a real multi-tenant host application or with a live LLM provider.
These are explicit boundaries, not claims of complete multi-tenant isolation.
7. What comes next
RagLeap Tools v0.6.0 establishes the initial separation between preparing a tool call, applying host-defined governance, and executing the handler.
The broader direction is to make tool execution easier for host applications to control, inspect, and govern without forcing existing Toolkit.call() users to rewrite their integrations.
This release is one step in that direction, not a claim that every production multi-tenant security requirement has been solved.
Try RagLeap Tools v0.6.0
- GitHub Release: https://github.com/ragleap/ragleap-core/releases/tag/ragleap-tools-v0.6.0
- RagLeap Packages: https://packages.ragleap.com/
- RagLeap Documentation: https://docs.ragleap.com/
- GitHub Repository: https://github.com/ragleap/ragleap-core
RagLeap is an open-source, self-hosted AI employee platform. We welcome developers interested in building reliable, controllable AI systems to explore the project and contribute.
RagLeap Tools v0.6.0 — Alpha release.
Top comments (0)