n8n-credentials-and-security-official
This skill guides the agent in handling authentication, API keys, tokens, and OAuth in n8n workflows.
Identity proven by GitHub's verified organisation badge (n8n-io)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- Apache-2.0 (permissive)
- Pin
- 180b841pinned Oct 9, 2026
- Context cost
- about 1,600 tokenswhen the skill loads
- GitHub stars
- 524on n8n-io/skills
- Scripts
- None found
What it does
“Use when handling any auth, API keys, tokens, OAuth, bearer tokens, basic auth, or secret values in n8n workflows. Triggers on "API key", "token", "bearer", "OAuth", "secret", "auth", "credentials", "Authorization header", "x-api-key", or any node configuration that mentions a third-party service.”
Generated summary from the skill's own text
This skill guides the agent in handling authentication, API keys, tokens, and OAuth in n8n workflows. It ensures secrets are stored securely through n8n's credential system rather than hardcoded in text fields, and provides decision trees for choosing the right authentication method based on the service being called.
When to use it
- Configuring auth for external API calls in n8n workflows
- Handling API keys, bearer tokens, or OAuth credentials
- Setting up HTTP Request nodes with authentication
- User requests to add secrets or credentials to a workflow
When not to
- The service has no external authentication requirement
- User wants to hardcode secrets in workflow text fields instead of using credentials
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add n8n-io/skills --skill n8n-credentials-and-security-officialInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install n8n-io/skills n8n-credentials-and-security-official@180b8415e3b73f78828cfa01e908e67f89f2a139Installs the commit we checked (180b841).
Copy by hand
Download the folder at 180b841 and put it in .claude/skills/n8n-credentials-and-security-official for Claude Code and in .agents/skills/n8n-credentials-and-security-official for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "n8n-credentials-and-security-official" by n8n. Source, pinned to commit 180b8415e3b73f78828cfa01e908e67f89f2a139: https://github.com/n8n-io/skills/tree/180b8415e3b73f78828cfa01e908e67f89f2a139/skills/n8n-credentials-and-security-official 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/n8n-credentials-and-security-official/ for Claude Code and .agents/skills/n8n-credentials-and-security-official/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/n8n/n8n-credentials-and-security-official
SKILL.md at the pin
---
name: n8n-credentials-and-security-official
description: Use when handling any auth, API keys, tokens, OAuth, bearer tokens, basic auth, or secret values in n8n workflows. Triggers on "API key", "token", "bearer", "OAuth", "secret", "auth", "credentials", "Authorization header", "x-api-key", or any node configuration that mentions a third-party service.
---
# n8n Credentials and Security
## Non-negotiables
1. **Secrets via the credential system, never in text fields or SDK code.** API keys, bearer tokens, OAuth secrets, passwords: all go through `newCredential()` or the node's `credentials` parameter. A Set node hardcoding a token and read via `{{$json.token}}` is a text field with extra steps.
2. **List credentials, then bind by ID.** Call `list_credentials({type})` before configuring an auth-needing node. One match: bind via 2-arg `newCredential('Label', 'credId')` at create time, or `setNodeCredential` op on `update_workflow`. Multiple matches: ask the user which. The one-arg `newCredential('Label')` is a placeholder; n8n auto-assigns the most recently edited credential of that type and silently picks wrong when the user has multiples.
3. **Credential creation is the user's job, not yours.** The n8n MCP doesn't expose credential creation. Tell the user the exact credential *type* to create in the UI, then reference it by label in your node config. Don't attempt to create credentials programmatically and don't accept secrets in chat to "set up later".
## Strong defaults
- **Use native credentials when available.** Every native node (Slack, Gmail, Postgres, OpenAI, etc.) has a credential type. Don't reach for generic credential types when a native option exists.
- **For multi-header or header-plus-query auth shapes**, use the `httpCustomAuth` credential type. See `references/CUSTOM_CREDENTIALS.md`.
## The credential system
In n8n, credentials are first-class objects:
- Stored encrypted at rest in the n8n database.
- Referenced by ID from nodes that need them.
- Scoped to projects (Cloud & enterprise) or shared globally (some self-hosted setups).
- Identified by a type slug (googleSheetsOAuth2Api, slackApi, httpHeaderAuth). The slug is what nodes reference and what determines which auth fields the credential collects.
A node that needs auth has a `credentials` parameter pointing to a credential ID + type. Secret values never appear in workflow JSON. Exporting a workflow leaks the *reference*, not the secret.
For the full model (SDK resolution, rotation, project scoping), see `references/CREDENTIAL_SYSTEM.md`.
## Decision tree: how to authenticate this thing
```
Need to call an external service?
├── Native credential exists (Slack, Gmail, OpenAI, Postgres, ...)?
│ └── Use the native node + its credential type. Done.
│
├── Service is "standard-shaped" (REST + Bearer/Basic/OAuth)?
│ ├── Configure HTTP Request with one of the built-in auth types:
│ │ - Generic OAuth2
│ │ - Header Auth
| | - Bearer Auth (same as header auth but with only field being for actual token)
│ │ - Basic Auth
│ │ - Custom Auth
│ └── See references/HTTP_REQUEST_WITH_AUTH.md
│
└── Service needs multiple static headers, or headers plus query params?
└── Use the httpCustomAuth credential type.
See references/CUSTOM_CREDENTIALS.md
```
## When the user pastes a secret into a chat
This happens. The user types something like:
> "Set up a workflow to call Acme API with bearer `sk-abc123def456`"
What to do:
1. **Don't put the token in a text field, even temporarily.** A Set node that hardcodes the value and is referenced via `{{$json.token}}` is a text field with extra steps.
2. **Bind to an existing credential if possible.** `list_credentials({type})` first; if a match exists, bind via `setNodeCredential` and tell the user which one you used. If none exists, tell them to create one in the UI (Bearer Auth for bearer tokens, Header Auth for custom headers, etc.). Credential creation is still UI-only.
3. **Treat the pasted secret as compromised, and tell the user to rotate it.** Don't soften this. The token has been transmitted to the LLM provider, may persist in chat history, transcripts, and cache layers. Tell them: "Rotate this token as soon as the new credential is set up. Treat it as leaked."
## When no native node exists
Common case: the user wants a service n8n has no node for. Use HTTP Request with appropriate auth.
- `references/FINDING_API_DOCS.md`: discovering auth scheme, base URL, common shapes.
- `references/HTTP_REQUEST_WITH_AUTH.md`: wiring HTTP Request to a credential.
- `references/CUSTOM_CREDENTIALS.md`: when built-in auth types don't fit.
## Reference files
| File | Read when |
|---|---|
| `references/CREDENTIAL_SYSTEM.md` | You need to understand how credentials are stored, referenced, scoped, or rotated |
| `references/CUSTOM_CREDENTIALS.md` | Multi-header / header-plus-query auth in one credential, or per-request signing patterns (HMAC, JWT, webhook validation) |
| `references/HTTP_REQUEST_WITH_AUTH.md` | Configuring HTTP Request with auth: Bearer, Basic, OAuth, Header Auth |
| `references/FINDING_API_DOCS.md` | The user mentioned a service you don't have node-level knowledge of |
## Anti-patterns
| Anti-pattern | What goes wrong | Fix |
|---|---|---|
| Pasting `sk-...` into HTTP Request's `Authorization` header value field | Token in plain text in the workflow JSON, leaks on export, copy, screenshot | Use a credential: `Bearer Auth` for bearer tokens, `Header Auth` for other custom auth schemes |
| Storing token in a Set node and referencing via expression | Same problem, value lives in workflow JSON | Same fix: credential, not a Set node |
| Storing a secret in `$vars.X` and reading it as the auth value | Not encrypted at rest, leaks in exports, no rotation | Use the right credential type (`httpBearerAuth`, `httpHeaderAuth`, `httpCustomAuth`, or the native one). For inbound webhook auth, use the trigger's `authentication` field, not an IF on `$vars.token` |
| Reaching for `$env.X` to read a secret during custom auth setup | Doesn't work, throws at runtime | Use a credential of the appropriate type |
| Using HTTP Request when a native node exists | Loses auto-refresh on OAuth, loses native error handling, more code | Use the native node |
| Hardcoding credentials in SDK code (`new HttpRequest({ headers: { Authorization: 'Bearer xxx' } })`) | Same leak surface | Use `newCredential()` in SDK code |
| Asking the user to create a credential without naming the credential *type* | User picks the wrong type, auth fails confusingly | Always specify: "create a credential of type `<exact type name>`" |
From n8n-io/skills at 180b841, shown as plain text under its license: Apache-2.0 (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at 180b841Files
- SKILL.md6.7 KB · 2c5b662db098
- references/
- CREDENTIAL_SYSTEM.md3.8 KB · d8b5425a14b0
- CUSTOM_CREDENTIALS.md2.9 KB · 245b3b3401e2
- FINDING_API_DOCS.md4.7 KB · 71274bdc8e91
- HTTP_REQUEST_WITH_AUTH.md5.0 KB · 44e172134c1f
5 files, 23 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 180b841More from n8n
agent-builder
Agent Builder orchestrates the creation, modification, testing, and publishing of n8n Agents.
Claude Code, Codex, Cursor +3 · about 2.3K tokens · pinned 6 days ago
data-table-manager
This skill manages n8n Data Tables through creation, import, querying, and mutation operations.
Claude Code, Codex, Cursor +3 · about 2.1K tokens · pinned 6 days ago
debugging-executions
Debug workflow execution failures by inspecting failed nodes, re-running executions, and comparing expected versus actual values.
Claude Code, Codex, Cursor +3 · about 2.5K tokens · pinned 6 days ago
instance-awareness
This skill teaches the agent to resolve ambiguous requests by reading the instance's activity log and workflow history instead of asking the user to clarify.
Claude Code, Codex, Cursor +3 · about 1.3K tokens · pinned 6 days ago
intent-recognition
Classifies automation requests by determining which primitive owns the top-level control flow (workflow, agent, needs clarification, or out-of-scope) and…
Claude Code, Codex, Cursor +4 · about 6.9K tokens · pinned 6 days ago
n8n-cli
This skill enables agents to manage n8n workflows, credentials, executions, and instance resources via the n8n CLI command-line tool.
Claude Code, Codex, Cursor +4 · about 2.9K tokens · pinned 6 days ago
Related in Security
claude-security
Scans your repository for security issues using Claude, examines code changes or commits for vulnerabilities, and generates patch files to fix findings.
by AnthropicOfficial publisher
Claude Code · about 1K tokens · pinned 6 days ago
sensitive-logging-audit
The skill helps audit and fix sensitive data leaks in Python SDK logging, exceptions, and telemetry by collecting candidate sinks, manually tracing values…
by OpenAIOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 970 tokens · pinned 6 days ago
security-audit
This skill guides security audits of codebases, APIs, and services by finding vulnerabilities that cross real trust boundaries.
by CloudflareOfficial publisher
Contains scripts
Claude Code · about 5.4K tokens · pinned 6 days ago
assess-patch-risk
This skill analyzes patch artifacts to assess their program impact, regression risk, and suitability for automated merging.
by OpenAIOfficial publisher
Codex · about 2.3K tokens · pinned 6 days ago
attack-path-analysis
This skill analyzes security findings to build explicit attack paths from source to sink, calibrates severity, and decides whether each finding is reportable.
by OpenAIOfficial publisher
Codex · about 2.1K tokens · pinned 6 days ago
deep-security-scan
Performs exhaustive, multi-pass security analysis across a repository or scoped directory by running repeated independent security scans and aggregating…
by OpenAIOfficial publisher
Codex · about 3.4K tokens · pinned 6 days ago
Open roles at n8n
3 open roles on the jobs board
- Forward Deployed Engineer - US East Coast
Boston | California | Pennsylvania | New York | Massachusetts | Virginia | Colorado | New Jersey | Georgia | Texas (Remote)
- Forward Deployed Engineer - EMEA
Germany | Netherlands | Portugal | London Office | Ireland | United Kingdom | Spain (Remote)
- Agentic Engineering Platform Engineer
Remote (Europe) (Remote)