feat(examples): add Genkit Guard example - #201
Merged
Merged
Conversation
Vendors unpublished @arcjet/guard/genkit/v1 from arcjet-js@f7619e4c1c2a4f48a3342b7f8ab74a928ceb7309 (david/cursor/guard-genkit-v1-8e4b). Shows inbound screening before generate(), guardTool on lookup_order, and guardMiddleware on an unwrapped tool. Co-authored-by: David Mytton <davidmytton@users.noreply.github.com>
Drop extra comments, page diagnostics, and README sections so the demo matches mastra-agent's shape. Co-authored-by: David Mytton <davidmytton@users.noreply.github.com>
davidmytton
marked this pull request as ready for review
August 25, 2026 20:36
There was a problem hiding this comment.
Arcjet Review — 🔴 High Risk
Decision: Cannot Assess
Rationale: Review failed due to an internal error: unknown error. Escalating to human reviewers.
Review: c41f937c | Powered by Arcjet Review
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
Collaborator
Author
|
@SocketSecurity ignore npm/@types/pg@8.6.1 |
davidmytton
enabled auto-merge
August 25, 2026 20:42
Collaborator
Author
|
@SocketSecurity ignore-all |
* deps(genkit-agent): override openai to 7.8.0 Socket blocks PR 201 on a medium "potential vulnerability" in openai@4.104.0, pulled in by @genkit-ai/compat-oai@1.41.0. genkit and @genkit-ai/compat-oai are already latest and still declare openai@^4.95.0, so override the transitive pin to the current openai release. The example uses non-streaming ai.generate(), which maps to client.chat.completions.create — still present on 7.x. Co-authored-by: David Mytton <davidmytton@users.noreply.github.com> * docs: record genkit-agent openai override Add OVERRIDES.md so the Socket pin on openai@4.104.0 is documented: why we cannot bump Genkit, what 7.8.0 is compatible with, and when to remove the override. Link it from CONTRIBUTING and the example README. Co-authored-by: David Mytton <davidmytton@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: David Mytton <davidmytton@users.noreply.github.com>
@arcjet/guard@1.11.0 exports ./genkit/v1, so drop the vendored build from david/cursor/guard-genkit-v1-8e4b. npm ci now installs from the registry; Docker no longer copies vendor/. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: David Mytton <davidmytton@users.noreply.github.com>
Keep both the Genkit and LangChain agent listings in README.md and scripts/prepare-to-publish.ts after #199 landed on main. Co-authored-by: David Mytton <davidmytton@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
examples/genkit-agent: a Genkit JSgenkit()+ai.defineTool+ai.generate()support agent protected by Arcjet Guard, alongsidemastra-agent/langgraph-agent/claude-agent. Registered in the root README andscripts/prepare-to-publish.ts.This is JS Genkit only, not Go / Python. Import path is
@arcjet/guard/genkit/v1—@arcjet/guard/genkitdoes not resolve.guardToolwraps the returnedToolAction, not the inner handler, and overwrites the registry key. DENY is a completedtoolResponse.outputwitharcjetDenied: true— it does not throw, callinterrupt(), or setfinishReason: "interrupted".guardMiddlewareis a{ name, instantiate }object whosetoolhook gates unwrapped / MCP tools; branded tools are skipped.interrupt()/toolApprovalis HITL, not a policy gate. Correlation is the browser-generated conversation id copied onto{ sessionId }— never minted on the server.Vendor pin.
@arcjet/guard/genkit/v1is not onmainor npm.@arcjet/guardis pinned tofile:./vendor/arcjet-guardbuilt from arcjet-jsdavid/cursor/guard-genkit-v1-8e4batf7619e4c1c2a4f48a3342b7f8ab74a928ceb7309(no PR number). SHA is invendor/SOURCE.txt. Draft until that ships.Verified.
npm run typecheckpasses. Node 24+,ARCJET_KEY+AI_GATEWAY_API_KEY.