Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [Unreleased]

- AI SDK 7 support, tested. `shieldLanguageModelMiddleware` works unchanged with AI SDK 7 (`ai@7`, `v4` language models) in `generateText` and `streamText`, and the test suite now runs it against AI SDK 4, 5, 6, and 7, including streaming, tool results, tool call arguments, `throwOnLeak`, and redaction.
- The legacy `shieldMiddleware().wrapParams()` and `wrapParamsAsync()` now also harden AI SDK 7's `instructions` option, which replaces the deprecated `system`. Before, a system prompt passed as `instructions` reached the model unhardened.

## [2.0.0] - 2026-10-02

- Root `detect()` now returns a Promise and calls the hosted Shield API with a dashboard key. `createHostedDetector()` supports the four hosted model IDs, self-hosted moderation endpoints, cancellation, timeouts, and provider wrapper options.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Every wrapper hardens the system prompt, runs its configured detector on user me
| OpenAI | `shieldOpenAI` from `@zeroleaks/shield/openai` | `chat.completions.create`, `responses.create` |
| Anthropic | `shieldAnthropic` from `@zeroleaks/shield/anthropic` | `messages.create` |
| Groq | `shieldGroq` from `@zeroleaks/shield/groq` | `chat.completions.create` |
| Vercel AI SDK 4, 5, 6 | `shieldLanguageModelMiddleware` from `@zeroleaks/shield/ai-sdk` | `generateText`, `streamText` via `wrapLanguageModel` |
| Vercel AI SDK 4, 5, 6, 7 | `shieldLanguageModelMiddleware` from `@zeroleaks/shield/ai-sdk` | `generateText`, `streamText` via `wrapLanguageModel` |
| Google Gen AI | `shieldGoogleGenAI` from `@zeroleaks/shield/google` | `models.generateContent`, `models.generateContentStream`, and chats |
| Mistral | `shieldMistral` from `@zeroleaks/shield/mistral` | `chat.complete`, `chat.stream` |
| LangChain.js | `shieldChatModel`, `ShieldCallbackHandler` from `@zeroleaks/shield/langchain` | `invoke`, `stream`, `batch`, and runnables derived from the model |
Expand Down
29 changes: 22 additions & 7 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@
"@modelcontextprotocol/sdk": "^1.30.1",
"@openai/agents": "^0.18.0",
"@types/node": "^26.1.1",
"ai": "^6.0.292",
"ai": "^7.0.127",
"ai-v4": "npm:ai@^4.3.19",
"ai-v5": "npm:ai@^5.0.267",
"ai-v6": "npm:ai@^6.0.292",
"groq-sdk": "^0.37.0",
"openai": "^6.25.0",
"tsup": "^8.5.1",
Expand Down
Loading
Loading