@ai-sdk/policy-opa
1.0.177 · 18 Nov 2026Apache-2.025.7k / weekRepositoryHomepagenpmAtom feed
1.0.177 is the newest release of 1.x.
In short
1 breaking2 fixed
- Breaking
Introduce
@ai-sdk/policy-opa, an Open Policy Agent adapter for thetoolApprovalcallback ongenerateText/streamText/ToolLoopAgent.
Release note
Major Changes
- Breaking
Introduce
@ai-sdk/policy-opa, an Open Policy Agent adapter for thetoolApprovalcallback ongenerateText/streamText/ToolLoopAgent.Everything is exported from the package root. The engine-neutral core is a
PolicyClientinterface,shadow()for safe policy rollout with
fire-and-forget telemetry, andwrapMcpTools()for making approval
configuration total over a discovered tool surface. The OPA layer shipsopaPolicy/optionalOpaPolicy(Rego-as-code authorization),wasmPolicyClientandhttpPolicyClientbackends (lazy-loaded optional peer
deps),opaCapabilityMiddlewarefor fail-closed model-level tool filtering,
andnormalizeOpaDecisionfor users who call OPA themselves.Sits entirely on top of the public SDK surface, with no changes to
ai,@ai-sdk/provider, or@ai-sdk/provider-utils. Transitive enforcement
(coarse dispatchers likebash/http.request/ MCP proxies) is handled
inside the user'stoolApprovalby parsing the dispatcher input and routing
to the same Rego rule that gates the direct tool.
Patch Changes
Initial release
Trigger initial beta release
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.