Skip to content

docs(python): document the on-device Rampart sensitive info backend - #848

Open
davidmytton wants to merge 3 commits into
mainfrom
docs-python-sensitive-info-rampart
Open

docs(python): document the on-device Rampart sensitive info backend#848
davidmytton wants to merge 3 commits into
mainfrom
docs-python-sensitive-info-rampart

Conversation

@davidmytton

Copy link
Copy Markdown
Collaborator

Brings the Python docs to parity with the JS SDK Rampart work (#846), covering the new pluggable sensitive info detection backend added in arcjet/arcjet-py#164 — the optional arcjet[sensitive-info-rampart] extra that runs an on-device NER model to detect names, addresses, and government/financial identifiers in addition to the four built-in structured types.

Changes

  • Reference (sensitive-info/reference.mdx): add the Python backend param and expanded entity types, language-aware install (pip install "arcjet[sensitive-info-rampart]"), a Python RampartOptions tab (threshold/providers/max_input_chars/recognizers/model_path), rampart_entities, and new RampartBackend snippets for FastAPI + Flask. Removes the note claiming the backend is JS/TS-only.
  • Guards (guards/index.mdx): add a Python tab for LocalDetectSensitiveInfo(backend=rampart()); drop the "JavaScript SDK only" line.
  • Data loss prevention (ai-protection/data-loss-prevention.mdx): replace the "available in the JS/TS SDKs only" Python slots with real Python Rampart config.
  • Overview (sensitive-info/index.mdx): generalize the package reference to name both the JS package and the Python extra.
  • Quick start: full parity — install the extra in step 1 and use backend=rampart() (detecting names) in step 3.
  • Example fixes: correct the Python example log shape and status codes to mirror the JS examples — the quick-start now returns a single 400 for a sensitive-info denial (the only rule), and the reference logs per result. Previously the quick-start had an unreachable 403 branch.
  • llms-full.txt: document the backend option and the expanded entity types in the sensitiveInfo reference (this was stale for both languages — feat: document the on-device Rampart sensitive info backend #846 didn't update it).

Verification

astro build passes cleanly — 0 errors/warnings, all internal links valid.

🤖 Generated with Claude Code

Claude and others added 2 commits July 16, 2026 20:10
PR arcjet/arcjet-py#164 adds a pluggable detection backend to the Python
SDK, including the optional arcjet[sensitive-info-rampart] extra for
on-device NER detection of names, addresses, and government/financial
identifiers. Bring the Python docs to parity with the JS SDK changes from
#846:

- reference: add the Python `backend` param, install extra, RampartOptions,
  rampart_entities, and Python RampartBackend snippets; drop the note
  claiming the backend is JS-only
- guards: add a Python tab for LocalDetectSensitiveInfo(backend=rampart())
- data-loss-prevention: replace the "JS SDKs only" Python slots with real
  Python Rampart config
- sensitive-info index: generalize the package reference to cover the
  Python extra
- quick-start: full parity — install the extra and use backend=rampart()
- fix Python example log shape and status codes to mirror the JS examples
  (quick-start returns a single 400; reference logs per result)
- llms-full.txt: document the backend option and expanded entity types

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
arcjet-docs Ready Ready Preview, Comment Jul 16, 2026 9:01pm

Request Review

@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 — 🟡 Medium Risk

Decision: Approved

Rationale: This is a documentation-only PR that updates sensitive-info/Rampart guidance, Python snippets, generated llms text, and corresponding snapshots. The configured auth escalation trigger matched generic occurrences of the word "token" in sensitive-info documentation, but the changes do not modify authentication, authorization, session handling, or runtime code. No secrets, unsafe dependency changes, injection risks, or security-sensitive implementation changes were identified. I am approving despite Medium risk because the trigger is a false-positive content match in docs and the change is well-scoped.

Summary of Changes

Documents Python support for the optional on-device Rampart sensitive-info backend across AI protection, guards, sensitive-info reference, quick-start snippets, llms output, and snapshots.

Escalation Triggers

  • Authentication & Authorization: Diff content includes the word "token" in sensitive-info documentation, such as token context/window wording. This appears unrelated to auth/session/token handling.

Notes

Docs review found the relevant documentation and snapshot updates included in this PR. No PR size concern was identified.

Review: f47e6273 | Model: openai/gpt-5.5 | Powered by Arcjet Review

Comment thread src/snippets/sensitive-info/reference/python-fastapi/RampartBackend.py Outdated
Address PR review: the reference RampartBackend snippets and the
data-loss-prevention Rampart examples used string entity literals while
the quick-start snippets use the SensitiveInfoEntityType enum. Switch them
to the enum for consistency and type-checker friendliness.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant