Skip to content

docs: use the Rampart backend for every sensitive info example - #983

Merged
davidmytton merged 2 commits into
mainfrom
david/cursor/rampart-sensitive-info-docs-658f
Oct 14, 2026
Merged

davidmytton merged 2 commits into
mainfrom
david/cursor/rampart-sensitive-info-docs-658f

Conversation

@davidmytton

Copy link
Copy Markdown
Collaborator

Removes the built-in pattern-matching (WebAssembly) sensitive info detector from the docs and makes Rampart the default everywhere. This follows the matching SDK README change in arcjet/arcjet-js#6323.

  • Examples: every sensitiveInfo, localDetectSensitiveInfo / LocalDetectSensitiveInfo, detect_sensitive_info, arcjet.SensitiveInfo and GuardSensitiveInfo example passes the Rampart backend. That covers the JS, Python and Go framework snippets, the Guard integrations, the DLP pages and the quick starts. Install commands add @arcjet/sensitive-info-rampart, the arcjet[sensitive-info-rampart] extra, or the sensitiveinfo/rampart Go module.
  • Sensitive info reference and overview: the "Detection backends" and "Built-in engine" sections are replaced by "On-device detection with Rampart". The entity table now lists what Rampart detects, and whether the model or a recognizer detects each type.
  • Custom detection: the detect callback / ContextWindowSize / SensitiveInfoDetect examples are replaced by Rampart recognizers (an IBAN recognizer that emits BANK_ACCOUNT, appended to the default recognizers) in JS, Python and Go.
  • SDK references: the Go and Python reference sections are rewritten. The Python reference no longer claims that the client-level sensitive_info_backend applies to LocalDetectSensitiveInfo rules. It applies only to remote policies.
  • Deleted: the orphaned Next.js Edge runtime snippets, because Rampart can't run on edge runtimes.

Not changed: the Cloudflare Think Guard page and quick start. Rampart's model loader needs a filesystem, which Workers don't have, so those examples need a separate decision.

Open in Web Open in Cursor 

Remove the built-in pattern-matching detector from the sensitive info,
data loss prevention, Guard, quick start and SDK reference docs. Every
sensitive info example now passes the Rampart on-device backend, the
entity tables list what Rampart detects, and custom detection uses
Rampart recognizers. Delete the orphaned Next.js Edge runtime snippets,
which can't run Rampart.

Co-authored-by: david <david@arcjet.com>
@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
arcjet-docs Ready Ready Preview Oct 14, 2026 1:59pm UTC

Request Review

@davidmytton
davidmytton marked this pull request as ready for review October 14, 2026 16:39
@davidmytton
davidmytton added this pull request to the merge queue Oct 14, 2026

@arcjet-review arcjet-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Arcjet Review — 🟢 Low Risk

Decision: Approved

Rationale: Pure documentation and example-snippet refactor that moves every sensitive-info example to the Rampart backend, matching the SDK change in arcjet/arcjet-js#6323. Changes are repetitive and consistent across ~177 files: add backend: rampart() to rule configs, add the matching @arcjet/sensitive-info-rampart / arcjet_sensitive_info_rampart / sensitiveinfo/rampart imports and install commands, rewrite the reference prose and entity table, and swap the token-based detect callback examples for Rampart recognizers. The Python reference also correctly tightens the sensitive_info_backend claim to apply only to remote policies. No auth, infra, dependency manifest or runtime code changes; no escalation triggers fired. Snapshot and screenshot updates match the prose changes.

Summary of Changes

Docs refactor: makes Rampart the default sensitive-info backend across every example (JS, Python, Go, all frameworks and Guard integrations), rewrites the Sensitive Info reference and overview around on-device Rampart, replaces token detect callbacks with Rampart recognizers (IBAN → BANK_ACCOUNT example), updates install commands and the Go and Python SDK reference pages, deletes the Next.js edge-runtime snippets (Rampart can't run on edge), and regenerates llms.txt and screenshot snapshots. Cloudflare Think Guard pages are intentionally left unchanged.

Notes

Diff is ~2300 lines across 177+ files, exceeding the 1000-line size threshold. The volume is justified by the mechanical, repetitive nature of the change (one-line additions to many parallel framework snippets) and the matching snapshot regeneration, which makes it reliably reviewable despite the size.

Review: b14561b4 | Model: anthropic/claude-opus-4-7 | Powered by Arcjet Review

@@ -22,6 +22,7 @@
)
detect_pii = LocalDetectSensitiveInfo(
deny=["BANK_ACCOUNT", "ROUTING_NUMBER"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only backend=rampart(), is shown added here, with no accompanying from arcjet_sensitive_info_rampart import rampart in the diff. Can you confirm that import already exists above line 22 in this file? Every other py snippet in this PR adds the import explicitly, so if it's missing here the snippet won't run as copied.

type that the active backend doesn't detect never matches. You can also detect
your own types with [custom entity detection](#custom-entity-detection).
Rampart detects the following entity types. List any of them in `allow` or
`deny`. Each one is an `ArcjetSensitiveInfoType` in JS, a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: this paragraph says offsets are "UTF-16 code unit indexes in JS, code point indexes in Python, and byte offsets in Go – the indexes each language's regular expression matches return." Python's re.Match.start()/end() actually return indexes into the input string (code point indexes for str, byte offsets for bytes). Worth double-checking that Rampart's Python recognizer contract is specifically code point indexes and not just "whatever the input type gives you", so this doesn't mislead users who pass bytes.

mode: "LIVE", // Will block requests, use "DRY_RUN" to log only
// allow: ["EMAIL"], Will block all sensitive information types other than email.
deny: ["EMAIL"], // Will block email addresses
deny: ["EMAIL"], // Will block email addresses,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: the trailing comma inside the comment reads oddly — // Will block email addresses, — same pattern appears in Errors.ts, GlobalGuard.ts, PerRouteGuard.ts, WithinRoute.ts, and the SvelteKit Hooks.* snippets. Consider dropping the stray comma while you're touching these.

Suggested change
deny: ["EMAIL"], // Will block email addresses,
deny: ["EMAIL"], // Will block email addresses
backend: rampart(),

@arcjet-review arcjet-review Bot removed ai-review-in-progress needs review Awaiting human review labels Oct 14, 2026
Merged via the queue into main with commit bfba78c Oct 14, 2026
11 checks passed
@davidmytton
davidmytton deleted the david/cursor/rampart-sensitive-info-docs-658f branch October 14, 2026 16:51

This branch was successfully deployed

1 active deployment
Preview — ecce4cf0 Deployed Oct 14, 2026 by vercel[bot]
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