Validate a tool call against an ExecutionToken's scope. Called by the Tool Gateway before every external tool call. Returns whether the call is allowed or blocked with violation details.
(
data: ScopeCheckRequest,
db: Annotated[AsyncSession, Depends(get_db)],
)
| 511 | description="Validate a proposed tool call against an ExecutionToken's scope.", |
| 512 | ) |
| 513 | async def check_scope( |
| 514 | data: ScopeCheckRequest, |
| 515 | db: Annotated[AsyncSession, Depends(get_db)], |
| 516 | ) -> ScopeCheckResponse: |
| 517 | """ |
| 518 | Validate a tool call against an ExecutionToken's scope. |
| 519 | |
| 520 | Called by the Tool Gateway before every external tool call. |
| 521 | Returns whether the call is allowed or blocked with violation details. |
| 522 | """ |
| 523 | svc = ExecutionTokenService(db) |
| 524 | return await svc.check_scope(data) |
| 525 | |
| 526 | |
| 527 | @_token.post( |
nothing calls this directly
no test coverage detected