feat(examples): add Cloudflare Think Guard example - #222
Conversation
Depend on published @arcjet/guard 1.14.0 (@arcjet/guard/cloudflare-think/v0), the same exact-version style as the other Guard examples, and link the example from the root README, compose file, and publish workspace list. Co-authored-by: David Mytton <davidmytton@users.noreply.github.com>
|
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.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Arcjet Review — 🟡 Medium Risk
Decision: Approved
Rationale: New example directory under examples/cloudflare-think-agent that is fully additive: no changes to existing example code, only three touch points outside the new folder (README.md link, compose.yaml include, and prepare-to-publish.ts workspace entry). The pattern mirrors existing Guard agent examples (mastra-agent, google-adk-agent, eve-agent) called out in the description, and dependencies are exact-pinned. The example itself demonstrates defensive security controls (prompt-injection screening, rate limiting, PII detection, fail-open handling via hasFailedOpen()). Approving despite Medium risk (dependency + infra triggers) because the blast radius is confined to a new example and the code is well-scoped.
Summary of Changes
Adds a new example at examples/cloudflare-think-agent showing how to guard a Cloudflare Think (@cloudflare/think 0.19.0) support agent with @arcjet/guard@1.14.0 via the cloudflare-think/v0 adapter. Includes a local Node HTTP demo (index.ts + index.html), a Workers/Durable Object entry (src/server.ts), a CLI prove script covering allow/substitute-deny/block/inbound-injection paths, Dockerfile + compose.yaml, and wires the example into the root README, root compose.yaml, and scripts/prepare-to-publish.ts.
Escalation Triggers
- Dependency Changes: New examples/cloudflare-think-agent/package.json introduces @arcjet/guard@1.14.0, @cloudflare/think@0.19.0, zod@4.4.3 and dev deps.
- CI/CD Pipeline: New Dockerfile added for the example (build in compose.yaml).
- Infrastructure: New docker-compose file for the example and a wrangler.jsonc declaring a Cloudflare Durable Object binding + migration (v1, new_sqlite_classes: [SupportAgent]).
Notes
The description mentions package-lock.json recording @arcjet/guard@1.14.0, but no lockfile appears in the Files Changed list — this may be filtered out by the reviewer's path config rather than actually absent. Not flagged as a description accuracy issue because the diff cannot confirm either way. The unauthenticated /api/agent route, 0.0.0.0 bind, and root-user Dockerfile are all standard for the repo's example pattern and explicitly called out in the README as demo-only, so not flagged as security issues.
Path filtering: 1 file excluded by ignore paths. 22 of 23 files included in review.
Review: 3ffbd876 | Model: anthropic/claude-opus-4-7 | Powered by Arcjet Review
Omit order_id when the model leaves it out, document Worker key and tool-call correlation, and treat an empty PORT as unset. Co-authored-by: David Mytton <davidmytton@users.noreply.github.com>
|
These Block alerts are transitive dependencies of the official @SocketSecurity ignore npm/@mongodb-js/zstd@7.0.0 |
|
@SocketSecurity ignore npm/@mongodb-js/zstd@7.0.0 |
|
@SocketSecurity ignore npm/@mongodb-js/zstd@7.0.0 |
Summary
Adds
examples/cloudflare-think-agent, a Cloudflare Think support agent guarded with published@arcjet/guard@1.14.0(@arcjet/guard/cloudflare-think/v0). The pin matches the exact-version style used bymastra-agent,google-adk-agent, andeve-agent.The example keeps the actor/inputs demo and the prove paths (allow, substitute deny,
onDeny: "block", and inbound prompt-injection). It is linked from the root README,compose.yaml, andscripts/prepare-to-publish.ts.There is no git or
file:vendor of@arcjet/guard, and no commit SHA pin.CI notes
mastra-agent,google-adk-agent,eve-agent).package-lock.jsonrecords@arcjet/guard@1.14.0and its@arcjet/*@1.14.0dependencies fromregistry.npmjs.org. Integrity checksums for those 1.14.0 tarballs are not in the lockfile, sonpm ciwas not verified against the registry in this change.npm run provepassed allow, substitute, block, and inbound on that same Think adapter API.