patronus

Patronus Guard Input for n8n: block prompt injection and data leaks before text reaches your LLM

Package Information

Released: this month
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.1
Author: Patronus

Documentation

Patronus for n8n

Community node that adds Patronus → Guard Input to n8n: put it right before your
LLM node and it releases the exact text only after Patronus has checked it for prompt
injection and data leaks.

Install

Self-hosted n8n (community nodes enabled):

  1. Open Settings → Community Nodes → Install.
  2. Enter n8n-nodes-patronus, confirm the risk notice and install.

Without the UI (for example in Docker images), install the package into the n8n user
folder and restart n8n:

cd ~/.n8n/nodes
npm install n8n-nodes-patronus

See n8n's community node installation guide
for queue mode and persistent volumes.

n8n Cloud: the node becomes available in the node panel once n8n has verified it.

Requirements: Node.js 22+; verified with n8n 2.42.4. The package has no runtime npm
dependencies.

Set up

  1. Create an API key in the Patronus Control Plane
    with scan:write and scan:read.
  2. In n8n, create a Patronus API credential and paste the key. n8n tests the key
    with a minimal scan when you save the credential.

Use Guard Input

Add Patronus → Guard Input directly before the LLM and map into Content the
exact text the LLM will receive. Then map the Guard's text output into the LLM.

Chat Trigger → Patronus Guard Input → LLM
Question → retrieve documents → compose prompt → Patronus Guard Input → LLM

When the input is blocked or cannot be verified, the step fails and the LLM does not
run. To route rejections instead, enable On Error → Continue and branch on
{{ $json.patronus?.status === 'allowed' }}: the error item carries
status: blocked | unverified and never the original text. Do not add a fallback that
sends the original input to the LLM.

Ready-to-import chatbot and RAG workflows: examples/n8n.

Submit Scan and Get Scan Result remain available as diagnostic operations; they
return raw scan data and are not gates. The node is also usable as a tool by n8n's AI
Agent, but a guard only protects the text you map into it.

For maintainers

This package is a standard @n8n/node-cli
project (npm run build, npm run lint, npm run dev) with no runtime dependencies,
as n8n's verification requires. The Guard release policy is embedded in
nodes/Patronus/lib/policy.ts, generated from shared/guard-policy.ts by
plugins/automations/scripts/sync-n8n-lib.mjs; edit the canonical source and rerun
the script (the test suite fails when the copy is stale). Polling uses n8n's sleep
and failures are raised as NodeApiError/NodeOperationError. The node calls the API
through n8n's httpRequestWithAuthentication, so the key stays in n8n's credential
store. Release steps: PUBLISHING.md.

Discussion