@ai-sdk/policy-opa 0.0.0 → 1.0.0-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,47 @@
1
+ # @ai-sdk/policy
2
+
3
+ ## 1.0.0-canary.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [ce769dd]
8
+ - @ai-sdk/provider@4.0.0-canary.18
9
+ - ai@7.0.0-canary.165
10
+ - @ai-sdk/provider-utils@5.0.0-canary.46
11
+
12
+ ## 1.0.0-canary.1
13
+
14
+ ### Patch Changes
15
+
16
+ - 9a1b0ea: Initial release
17
+ - ai@7.0.0-canary.164
18
+
19
+ ## 1.0.0-canary.0
20
+
21
+ ### Major Changes
22
+
23
+ - a94c258: Introduce `@ai-sdk/policy-opa`, an Open Policy Agent adapter for the
24
+ `toolApproval` callback on `generateText` / `streamText` / `ToolLoopAgent`.
25
+
26
+ Everything is exported from the package root. The engine-neutral core is a
27
+ `PolicyClient` interface, `shadow()` for safe policy rollout with
28
+ fire-and-forget telemetry, and `wrapMcpTools()` for making approval
29
+ configuration total over a discovered tool surface. The OPA layer ships
30
+ `opaPolicy` / `optionalOpaPolicy` (Rego-as-code authorization),
31
+ `wasmPolicyClient` and `httpPolicyClient` backends (lazy-loaded optional peer
32
+ deps), `opaCapabilityMiddleware` for fail-closed model-level tool filtering,
33
+ and `normalizeOpaDecision` for users who call OPA themselves.
34
+
35
+ Sits entirely on top of the public SDK surface, with no changes to `ai`,
36
+ `@ai-sdk/provider`, or `@ai-sdk/provider-utils`. Transitive enforcement
37
+ (coarse dispatchers like `bash` / `http.request` / MCP proxies) is handled
38
+ inside the user's `toolApproval` by parsing the dispatcher input and routing
39
+ to the same Rego rule that gates the direct tool.
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies [ee798eb]
44
+ - Updated dependencies [daf6637]
45
+ - Updated dependencies [c907622]
46
+ - @ai-sdk/provider-utils@5.0.0-canary.45
47
+ - ai@7.0.0-canary.163
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2023 Vercel, Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.