Skip to content

feat(examples): add Cloudflare Think Guard example - #222

Merged
davidmytton merged 2 commits into
mainfrom
david/cursor/cloudflare-think-agent-f8cc
Sep 22, 2026
Merged

davidmytton merged 2 commits into
mainfrom
david/cursor/cloudflare-think-agent-f8cc

Conversation

@davidmytton

Copy link
Copy Markdown
Collaborator

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 by mastra-agent, google-adk-agent, and eve-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, and scripts/prepare-to-publish.ts.

There is no git or file: vendor of @arcjet/guard, and no commit SHA pin.

CI notes

  • The Docker build workflow does not include this example, same as the other Guard agent examples (mastra-agent, google-adk-agent, eve-agent).
  • package-lock.json records @arcjet/guard@1.14.0 and its @arcjet/*@1.14.0 dependencies from registry.npmjs.org. Integrity checksums for those 1.14.0 tarballs are not in the lockfile, so npm ci was not verified against the registry in this change.
  • Before switching off the previous adapter build, npm run prove passed allow, substitute, block, and inbound on that same Think adapter API.
Open in Web Open in Cursor 

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>
@arcjet-review arcjet-review Bot added needs review Awaiting human review ai-review-in-progress and removed needs review Awaiting human review labels Sep 22, 2026
@socket-security

socket-security Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​cloudflare/​think@​0.19.09910010099100
Addednpm/​@​arcjet/​guard@​1.14.0N/AN/AN/AN/AN/A

View full report

@socket-security

socket-security Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

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.

Action Severity Alert  (click "▶" to expand/collapse)
Block Medium
Native binaries present: npm @mongodb-js/zstd

Location: Package overview

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/@mongodb-js/zstd@7.0.0

ℹ Read more on: This package | This alert | Why is native code a concern?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@mongodb-js/zstd@7.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Potential security risk (AI signal): npm just-bash is 66.0% likely risky

Notes: No clear stealthy malware or obfuscated backdoor is visible in this fragment. However, the module is a powerful AWK interpreter that can cause high-impact side effects: (1) attacker-controlled filesystem writes via AWK redirection to evaluated filenames (with path resolution against cwd) and (2) optional external command execution via an injected exec hook. If untrusted AWK scripts are allowed to run without strict sandboxing/permissioning (e.g., disabling exec, restricting write paths, and constraining/validating resolvePath behavior), the security risk is high.

Confidence: 0.66

Severity: 0.80

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/just-bash@3.4.2

ℹ Read more on: This package | This alert | What are AI-detected potential security risks?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system identified potential security problems in this package. It is advised to review the package thoroughly and assess the potential risks before installation. You may also consider reporting the issue to the package maintainer or seeking alternative solutions with a stronger security posture.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/just-bash@3.4.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Potential security risk (AI signal): npm just-bash is 62.0% likely risky

Notes: This code is an AWK-like interpreter that, by design, can write/append files based on script-controlled redirection filenames and (when configured) can invoke a host-provided command execution hook. The fragment does not show overt covert malware behaviors (no hardcoded secrets, no network/exfil endpoints, no obvious obfuscated payload), but it exposes inherently abusable capabilities. The security posture largely depends on the surrounding defense-context and how the host restricts filesystem write paths and disables/allowlists command execution for untrusted AWK programs.

Confidence: 0.62

Severity: 0.78

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/just-bash@3.4.2

ℹ Read more on: This package | This alert | What are AI-detected potential security risks?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system identified potential security problems in this package. It is advised to review the package thoroughly and assess the potential risks before installation. You may also consider reporting the issue to the package maintainer or seeking alternative solutions with a stronger security posture.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/just-bash@3.4.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Potential security risk (AI signal): npm just-bash is 66.0% likely risky

Notes: No clear evidence of intentionally planted malware/backdoor behavior is present in this snippet. However, the code provides multiple high-impact capabilities typical of a powerful HTTP client: it can read arbitrary local files specified via multipart form field values ('@'/'<' prefix) and transmit their contents over the network; it can persist response cookies to a caller-controlled path; and it can write response bodies to caller-controlled output files. In an environment where s.* inputs are attacker-influencable or path/network constraints are weak, this creates a substantial security risk (local data exfiltration, credential/session persistence, and arbitrary file writes within the sandbox boundaries).

Confidence: 0.66

Severity: 0.72

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/just-bash@3.4.2

ℹ Read more on: This package | This alert | What are AI-detected potential security risks?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system identified potential security problems in this package. It is advised to review the package thoroughly and assess the potential risks before installation. You may also consider reporting the issue to the package maintainer or seeking alternative solutions with a stronger security posture.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/just-bash@3.4.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Native binaries present: npm node-liblzma

Location: Package overview

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/node-liblzma@2.2.0

ℹ Read more on: This package | This alert | Why is native code a concern?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/node-liblzma@2.2.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Medium
Potential vulnerability: npm tar-stream with risk level "medium"

Location: Package overview

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/tar-stream@2.2.0

ℹ Read more on: This package | This alert | Navigating potential vulnerabilities

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: It is advisable to proceed with caution. Engage in a review of the package's security aspects and consider reaching out to the package maintainer for the latest information or patches.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/tar-stream@2.2.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm chat is 98.0% likely to have a medium risk anomaly

Notes: The fragment appears to be legitimate chat SDK infrastructure and contains no evident malware, credential theft, obfuscation, or destructive behavior. The main security risk is server-side SSRF or unintended data disclosure through postToCallbackUrl, because callback URLs are accepted and fetched without visible allowlisting or URL validation. This risk depends on whether untrusted parties can control card actions or callback records and on the payload supplied by the caller.

Confidence: 0.98

Severity: 0.52

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/chat@4.41.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/chat@4.41.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm chownr is 75.0% likely to have a medium risk anomaly

Notes: The code represents a standard, well-scoped recursive ownership utility with deliberate cross-version compatibility. No evidence of malicious activity, data leakage, or external communications. The main risk is the potential for broad permission changes if invoked with untrusted uid/gid values; usage should be restricted to trusted contexts.

Confidence: 0.75

Severity: 0.60

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/chownr@1.1.4

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/chownr@1.1.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm core-js-pure is 78.0% likely to have a medium risk anomaly

Notes: The fragment implements a conventional abstract AsyncIterator polyfill pattern. It prevents direct construction, attaches type metadata, and exposes AsyncIteratorConstructor globally in a controlled manner. There are no signs of data exfiltration, external I/O, or hidden behavior. Overall security risk is low, malware likelihood is negligible in this fragment, and the code aligns with legitimate library usage (e.g., core-js style shims).

Confidence: 0.78

Severity: 0.50

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/core-js-pure@3.50.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/core-js-pure@3.50.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm core-js-pure is 66.0% likely to have a medium risk anomaly

Notes: This is a Node-only dynamic module loader. The main security concern is the fallback implementation using Function(...) to generate and execute a require(...) call using the caller-supplied name, which can create an injection and arbitrary module-loading risk if name is not strictly controlled (e.g., not whitelisted/validated). There are no direct indicators of malware such as exfiltration or persistence in the provided fragment.

Confidence: 0.66

Severity: 0.53

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/core-js-pure@3.50.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/core-js-pure@3.50.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm just-bash is 62.0% likely to have a medium risk anomaly

Notes: Low evidence of overt malware: the WorkerDefenseInDepth logic and module-loader guard indicate a sandbox hardening design. However, the module provides high-impact host-backed capabilities—especially an HTTP bridge that allows executed Python to trigger backend.httpRequest based on bridged input, and it contains abstractions/opcodes for command/tool invocation that could be dangerous if the host backend is permissive. Treat as security-sensitive and verify host-side restrictions/authorization beyond this fragment.

Confidence: 0.62

Severity: 0.58

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/just-bash@3.4.2

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/just-bash@3.4.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm node-addon-api is 77.0% likely to have a medium risk anomaly

Notes: The script is a legitimate formatting helper within a Node.js project. It orchestrates clang-format via git-clang-format, supports fix and diff modes, and provides actionable feedback to the developer. While operational dependencies exist, no malicious activity or data leakage is evident based on the provided code and typical usage.

Confidence: 0.77

Severity: 0.50

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/node-addon-api@8.9.2

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/node-addon-api@8.9.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm pako is 65.0% likely to have a medium risk anomaly

Notes: The analyzed code is a conventional, non-obfuscated inflate implementation (pako inflate module). There is no indication of malicious behavior, data exfiltration, or backdoors within this fragment. From a supply-chain security perspective, third-party usage is normal, and there are no evident security flaws beyond the inherent complexity of the algorithm. If the extension uses this library as a decompression utility, it should be treated like a standard dependency; ensure trusted provenance and integrity checks (e.g., package signing, hash verification).

Confidence: 0.65

Severity: 0.57

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/pako@1.0.11

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/pako@1.0.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm pako is 65.0% likely to have a medium risk anomaly

Notes: This file is the minified JavaScript pako deflate implementation (zlib-compatible compression). It performs in-memory buffering and deflate operations on user-provided data and emits compressed output via callbacks. There are no network or filesystem I/O, no credential handling, no dynamic code evaluation, and no backdoors. The only residual risk is generic: a compression library may be used on untrusted inputs without resource limits, potentially leading to DoS via resource exhaustion.

Confidence: 0.65

Severity: 0.50

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/pako@1.0.11

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/pako@1.0.11. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm rolldown is 72.0% likely to have a medium risk anomaly

Notes: This module is a legitimate-looking HMR client but contains a high-impact execution mechanism: it dynamically imports modules from server-provided data.path and injects/executess module scripts from server-provided data.url, both driven by untrusted WebSocket JSON messages. If the WebSocket server/transport is compromised (notably if ws:// is used without TLS), an attacker could potentially trigger remote code execution in the client. No overt stealth/persistence/credential theft behavior is present in the snippet, but the trust boundary and dynamic code loading make the security risk significant for any non-fully-trusted development setup.

Confidence: 0.72

Severity: 0.66

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/rolldown@1.2.9

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/rolldown@1.2.9. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm tunnel-agent is 78.0% likely to have a medium risk anomaly

Notes: No evidence of malicious behavior detected. This file implements a standard tunneling proxy agent used for HTTP/HTTPS over a proxy. Potential risk is typical usage: misconfiguration of proxies could cause traffic to be routed through an untrusted proxy, but this is inherent to proxy usage rather than malicious code. No data exfiltration, backdoors, or cryptomining indicators observed.

Confidence: 0.78

Severity: 0.60

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/tunnel-agent@0.6.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/tunnel-agent@0.6.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm undici is 68.0% likely to have a medium risk anomaly

Notes: Both alerts describe an in-place re-encoding of a local file from UTF-8 to Latin-1, overwriting the original without backups or validation. This can cause data loss and code corruption, creating a supply-chain tampering risk. The script itself shows no exfiltration or network activity, but its destructive behavior warrants deletion or strict safeguards and auditing.

Confidence: 0.68

Severity: 0.60

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/undici@7.29.1

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/undici@7.29.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Block Low
Potential code anomaly (AI signal): npm yaml is 68.0% likely to have a medium risk anomaly

Notes: The code presents a standard, non-malicious NodeBase component used in YAML/JS conversion. The primary risk surface is the optional reviver and onAnchor callbacks provided by the user: if untrusted, these can execute arbitrary code or influence the transformed representation via applyReviver or the reviver itself. This is expected behavior for extensible YAML libraries; ensure callbacks come from trusted sources and sandbox or validate revivers where possible.

Confidence: 0.68

Severity: 0.60

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/yaml@2.9.1

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/yaml@2.9.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm @ai-sdk/anthropic in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/@ai-sdk/anthropic@4.0.57

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@ai-sdk/anthropic@4.0.57. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Install-time scripts: npm @mongodb-js/zstd during install

Install script: install

Source: prebuild-install --runtime napi || npm run clean-install

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/@mongodb-js/zstd@7.0.0

ℹ Read more on: This package | This alert | What is an install script?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@mongodb-js/zstd@7.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Network access: npm capnweb in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/capnweb@0.12.0

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/capnweb@0.12.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Dynamic code execution: npm core-js-pure

Eval Type: Function

Location: Package overview

From: examples/cloudflare-think-agent/package-lock.json → npm/@cloudflare/think@0.19.0 → npm/core-js-pure@3.50.0

ℹ Read more on: This package | This alert | What is dynamic code execution?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Avoid packages that use dynamic code execution like eval(), since this could potentially execute any code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/core-js-pure@3.50.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

See 54 more rows in the dashboard

View full report

@arcjet-review arcjet-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread examples/cloudflare-think-agent/lib/agent.ts
Comment thread examples/cloudflare-think-agent/lib/arcjet.ts
Comment thread examples/cloudflare-think-agent/src/server.ts
Comment thread examples/cloudflare-think-agent/index.ts
Comment thread examples/cloudflare-think-agent/LICENSE Outdated
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>
@cursor

cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

These Block alerts are transitive dependencies of the official @cloudflare/think@0.19.0 peer for this example, not application code. Same treatment as other Guard example PRs that accept framework supply-chain flags (for example @google/adk on #209).

@SocketSecurity ignore npm/@mongodb-js/zstd@7.0.0
@SocketSecurity ignore npm/just-bash@3.4.2
@SocketSecurity ignore npm/node-liblzma@2.2.0
@SocketSecurity ignore npm/tar-stream@2.2.0
@SocketSecurity ignore npm/chat@4.41.0
@SocketSecurity ignore npm/chownr@1.1.4
@SocketSecurity ignore npm/core-js-pure@3.50.0
@SocketSecurity ignore npm/node-addon-api@8.9.2
@SocketSecurity ignore npm/pako@1.0.11
@SocketSecurity ignore npm/rolldown@1.2.9
@SocketSecurity ignore npm/tunnel-agent@0.6.0
@SocketSecurity ignore npm/undici@7.29.1
@SocketSecurity ignore npm/yaml@2.9.1

@cursor

cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

@SocketSecurity ignore npm/@mongodb-js/zstd@7.0.0
@SocketSecurity ignore npm/just-bash@3.4.2
@SocketSecurity ignore npm/node-liblzma@2.2.0
@SocketSecurity ignore npm/tar-stream@2.2.0
@SocketSecurity ignore npm/chat@4.41.0
@SocketSecurity ignore npm/chownr@1.1.4
@SocketSecurity ignore npm/core-js-pure@3.50.0
@SocketSecurity ignore npm/node-addon-api@8.9.2
@SocketSecurity ignore npm/pako@1.0.11
@SocketSecurity ignore npm/rolldown@1.2.9
@SocketSecurity ignore npm/tunnel-agent@0.6.0
@SocketSecurity ignore npm/undici@7.29.1
@SocketSecurity ignore npm/yaml@2.9.1

@davidmytton

Copy link
Copy Markdown
Collaborator Author

@SocketSecurity ignore npm/@mongodb-js/zstd@7.0.0

@davidmytton
davidmytton added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit ebcd25e Sep 22, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants