n8n Integration
Protect your n8n AI agent workflows with full-spectrum security monitoring — canary tokens, DLP masking, workflow tamper detection, and real-time alerts — in under 10 minutes.
How the n8n AI Agent works
n8n's AI Agent node is not a simple pass-through. It runs a ReAct reasoning loop — on each trigger, it autonomously decides whether to call a tool (Search, HTTP Request, Code) or ask the LLM for the next step. A single workflow trigger can result in dozens of LLM calls as the agent works through a task.
The LLM lives in a Chat Model sub-node attached to the AI Agent node. That sub-node holds the credential. Trappr intercepts at exactly that point — swap the Chat Model credential to the Trappr Gateway, and every LLM call in the agent's loop is automatically monitored, regardless of how many the agent decides to make.
Prerequisites
- An n8n instance (self-hosted or n8n Cloud)
- A Trappr account with an app created in the dashboard
- Your Trappr Gateway API key (
cht_gw_*) and LLM provider key added under Provider Settings
Setup
In n8n, go to Credentials → New credential → OpenAI API. Set the API Key field to your Trappr Gateway key (cht_gw_*), and set the Base URL to:
https://gateway.trappr.net/v1
Name it clearly — e.g. Trappr Gateway (GPT-4o) — so you can tell it apart from your direct OpenAI credential.
Open your AI Agent workflow. Click on the AI Agent node (or any OpenAI node in the workflow). In the Credential dropdown, select the Trappr Gateway credential you just created.
Leave the model selection as-is — the model name is passed through to your configured provider.
Trigger the workflow manually once. In the Trappr dashboard under Gateway → Logs, you should see a new entry with the model, token count, and timestamp.
In the Trappr dashboard, go to Agents → Register agent. Select n8n as the platform. This enables tamper detection — Trappr will alert you if the workflow is modified outside normal deployment.
Using the HTTP Request node
If your workflow uses the HTTP Request node to call OpenAI directly (instead of the AI Agent node), update the URL and Authorization header:
| Field | Original value | Trappr value |
|---|---|---|
| URL | https://api.openai.com/v1/chat/completions | https://gateway.trappr.net/v1/chat/completions |
| Authorization header | Bearer sk-proj-... | Bearer cht_gw_... |
| Body | Unchanged | Unchanged |
Workflow tamper detection
Trappr can detect when your n8n workflow definition is modified. This guards against:
- Unauthorized nodes added to the workflow (e.g. an exfiltration step)
- Modified system prompts or tool configurations
- Rerouted LLM calls to a different provider or endpoint
When Trappr detects a tamper event, it fires an alert immediately and — in ENFORCE mode — deactivates the agent key so the modified workflow cannot execute.
Supported n8n nodes
| Node | Supported | Notes |
|---|---|---|
| AI Agent | Full | Use Trappr credential in the Chat Model sub-node |
| OpenAI | Full | Update credential to Trappr Gateway |
| HTTP Request (OpenAI endpoint) | Full | Update URL and Authorization header |
| Anthropic | Partial | Use HTTP Request node with Trappr Anthropic endpoint |
| LangChain nodes | Full | See LangChain guide |