feat(examples): add Genkit Guard example - #201
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>
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.
|
|
Caution Review the following alerts detected in dependencies. According to your organization's Security Policy, you must resolve all "Block" alerts before proceeding. It is recommended to resolve "Warn" alerts too. Learn more about Socket for GitHub.
Ignoring alerts on:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@SocketSecurity ignore npm/@types/pg@8.6.1 |
|
@SocketSecurity ignore-all |
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.