[FEATURE] Add pre-tool-call GuardrailProvider alongside SafetyEngine
Is your feature request related to a problem? Please describe.
Upsonic's SafetyEngine handles content safety (PII, financial data filtering) well but there's an orthogonal question it doesn't address: was this agent authorized to call this tool at all?
Content safety asks: "Is the output safe?" Authorization asks: "Should this tool have run?"
The Open Agent Protocol (OAP) defines a before_tool_call standard (DOI: 10.5281/zenodo.18901596) that covers this layer: a GuardrailProvider protocol evaluated before tool execution, returning allow/deny with structured reasons. A built-in AllowlistProvider handles simple cases; the protocol is open for custom implementations. For Fintech/regulated deployments, this is particularly relevant — EU AI Act and DORA both require audit trails for automated tool operations.
Would you be open to a PR? The same pattern was recently merged into bytedance/deer-flow (PR #1240). Happy to discuss how it integrates alongside SafetyEngine.
This also aligns with the request at https://github.com/Upsonic/Upsonic/issues/553, however, the proposed approach here makes it provider agnostic and a Bank building with Upsonic can spin up their own guardrail using the GuardrailProvider protocol. See my recent PR at bytedance/deer-flow/pull/1240
Source: Upsonic/Upsonic