github vercel/ai @ai-sdk/policy-opa@1.0.0

latest releases: @ai-sdk/xai@3.0.98, @ai-sdk/vue@3.0.210, @ai-sdk/voyage@1.0.8...
7 hours ago

Major Changes

  • a94c258: Introduce @ai-sdk/policy-opa, an Open Policy Agent adapter for the
    toolApproval callback on generateText / streamText / ToolLoopAgent.

    Everything is exported from the package root. The engine-neutral core is a
    PolicyClient interface, shadow() for safe policy rollout with
    fire-and-forget telemetry, and wrapMcpTools() for making approval
    configuration total over a discovered tool surface. The OPA layer ships
    opaPolicy / optionalOpaPolicy (Rego-as-code authorization),
    wasmPolicyClient and httpPolicyClient backends (lazy-loaded optional peer
    deps), opaCapabilityMiddleware for fail-closed model-level tool filtering,
    and normalizeOpaDecision for 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 like bash / http.request / MCP proxies) is handled
    inside the user's toolApproval by parsing the dispatcher input and routing
    to the same Rego rule that gates the direct tool.

Patch Changes

Don't miss a new ai release

NewReleases is sending notifications on new releases.