JS

Nexis for JavaScript and AI apps

Find names, emails, card numbers, health and ID numbers in your text, then redact, mask or encrypt them before the text reaches an LLM, a log or a third party. Detection follows the regulation you choose. Use it from your code, your terminal or your AI assistant.

Available now on npm. Open source under MIT, on GitHub.

Three packages, one engine

Pick the one that fits how you work. They all use the same Nexis API key and the same detection rules.

View on npm

SDK and CLI

@intelation/nexis

Clean text in your own Node code, or straight from the terminal. Zero dependencies.

npx @intelation/nexis redact "Email john.smith@example.com"
# -> Email [REDACTED]
View on npm

MCP server

@intelation/nexis-mcp

Let Claude, Cursor or VS Code find and remove personal data when you ask.

claude mcp add nexis \
  --env NEXIS_API_KEY=your-key \
  -- npx -y @intelation/nexis-mcp
View on npm

AI SDK middleware

@intelation/nexis-ai

One line removes personal data from every prompt in a Vercel AI SDK app.

const model = withNexis(
  openai("gpt-4o"),
  new Nexis()
);

Protect the prompt going in, restore the answer coming out

Wrap your model once and every prompt is cleaned before it leaves your server. Use encryption and the model works on placeholders, while your user still sees the real names and numbers in the answer.

Your prompt
Summarise the ticket from Sarah Jones, email sarah.jones@gmail.com, card 4111 1111 1111 1111
withNexis
Model
openai("gpt-4o")
Country – Regulation
United Kingdom – UK GDPR
Method
The LLM receives
Summarise the ticket from <PERSON>, email <EMAIL_ADDRESS>, card <CREDIT_CARD>

Replaces each value with its type.

1

Pick a regulation

Choose a country and regulation, such as UK GDPR or HIPAA. Nexis looks for the personal data that regulation covers, including local IDs like NHS, National Insurance and Social Security numbers.

2

Choose what happens to it

Seven methods: redact, replace (with the type), mask, hash, tokenization, pseudonymization (realistic fake values), or encryption so you can restore it later. Or just detect it and leave the text as it is.

3

Fine-tune when you need to

Process every type of personal data, only the types you pick, or everything except some. Add an allow list of values to keep and a deny list of values to always hide, like a project code name.

Built for the people who build, and the people who sign off

Developers and AI teams

  • Free API key, one install, one line of code
  • Works with any AI SDK provider: OpenAI, Anthropic, Google and more
  • A CLI for scripts, pipelines and quick checks
  • An MCP server so your coding assistant can clean data on request
  • Plain-English errors that say what to do next

DPOs, privacy and compliance leads

  • Detection rules tied to a specific regulation and country
  • Fails closed: if Nexis can't be reached, the AI call is stopped, not sent unprotected
  • Submitted text is not stored by default
  • Encryption keys stay with you; the MCP server never passes them through the model
  • Audit logs of anonymization activity in the Nexis dashboard

Regulations and jurisdictions supported

Your plan sets how many regulations you can use.

UK

UK GDPR

United Kingdom

DE

GDPR

Germany

English and German text
US

HIPAA

United States

CA

PIPEDA

Canada

AU

Privacy Act

Australia

NZ

Privacy Act

New Zealand

How to get started

  1. Get your free API key

    Sign up for Nexis with your work email. Approval usually takes minutes. Then create a key in the dashboard under API Integration.

  2. Install a package

    Pick the SDK and CLI, the MCP server or the AI SDK middleware from npm. Node 18 or later.

  3. Set your key and go

    Set NEXIS_API_KEY in your environment. Every call uses the first regulation in your plan unless you choose another.

npm install @intelation/nexis-ai ai
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
import { Nexis, withNexis } from "@intelation/nexis-ai";

const model = withNexis(openai("gpt-4o"), new Nexis());

await generateText({ model, prompt: "Summarise the ticket from john.smith@example.com" });
// The model receives: "Summarise the ticket from [REDACTED]"

Works with any provider and with generateText, streamText and generateObject. AI SDK v5, v6 and v7.

Encryption and decrypt

Encryption is the only method you can reverse. It needs a Fernet key in NEXIS_ENCRYPTION_KEY. Generate one with either command, and keep it safe:

node -e "console.log(require('crypto').randomBytes(32).toString('base64url') + '=')"
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

Restore the values with the same key: nexis.decrypt() in the SDK, decrypt in the CLI, the decrypt_text MCP tool, or restore: true in the AI SDK middleware. Ask your AI model to keep the <<ENC:...:ENC>> markers unchanged in its answer.

Questions

Can't find your answer? Talk to us.

Do I need a separate API key for each package?
No. One free Nexis API key works for all three packages, the n8n node and the Nexis dashboard.
Which package should I use?
Building an AI app on the Vercel AI SDK: nexis-ai. Any other Node code or a script: nexis. Want Claude, Cursor or VS Code to clean data on request: nexis-mcp. Working in n8n: see Nexis with n8n.
Does Nexis store my text?
Not by default. Nexis returns the result to your code and keeps only counts and types of personal data found, plus usage for billing and your audit log.
What happens if Nexis can't be reached?
The AI SDK middleware fails closed: the LLM call is stopped rather than sending unprotected text. You can switch to pass-through if you prefer the call to go ahead.
Does it add cost to every AI call?
Each distinct piece of text is one Nexis call. Chat history re-sent on each turn is cached, so it is not processed again.
Will it catch every piece of personal data?
No detection tool is perfect, and unusual or malformed values can be missed. Use detect to check results, add values you always want hidden to the deny list, and review high-risk flows.
Can I get the original data back?
Only with the encryption method, using the same key. Redact, Replace, Mask and Hash are one-way. Tokenization and Pseudonymization are also one-way, because Nexis does not keep the mapping between original and replacement values.
Are images and files scanned?
No. The AI SDK middleware cleans the system prompt, user and assistant messages, and text tool results.
Can I use Python or another language?
These packages are for JavaScript and TypeScript on Node 18 or later. Any language can call the REST API at https://api.nexis.intelation.com.
Why does sign-up need a work email?
Nexis is built for organizations that handle personal data, so accounts are tied to a company. Approval usually takes minutes.
Nexis is a product of Intelation. Claude, Cursor, VS Code and Vercel are trademarks of their owners; Intelation is not affiliated with them.npm packages · GitHub