Install
Scope-Enforced Tools
scp claim. If the required scope is missing, a PermissionError is raised before the tool is ever used.
Audit Logging
Wrap any Grantex tool with audit logging:API Reference
create_grantex_tool()
| Parameter | Description |
|---|---|
name | Tool name (used in audit log entries) |
description | Human-readable description shown to the LLM |
grant_token | Grantex grant token (RS256 JWT) |
required_scope | Scope that must be present in the token’s scp claim |
func | The function to execute when the tool is called |
args_schema | Optional Pydantic BaseModel describing tool inputs |
PermissionError if the grant token doesn’t contain required_scope.
with_audit_logging()
get_tool_scopes(grant_token)
Returns the scopes embedded in a grant token. Purely offline — no network call.
Requirements
- Python 3.9+
grantex>= 0.1.0crewai>= 0.28.0 (peer dependency)