n8n REST API credentials: HTTP request nodes and domain allowlists
n8n REST API credentials store encrypted tokens in the database. The HTTP Request node uses a domain allowlist to restrict outbound calls. This allowlist limits which hosts the node can reach. It does not stop an AI agent from sending destructive requests to allowed domains. How n8n stores and uses HTTP credentials You attach a credential to an HTTP Request node. This credential holds the API key or OAuth token. n8n encrypts these values before saving them to the database. It uses a random ke
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
n8n REST API credentials store encrypted tokens in the database. The HTTP Request node uses a domain allowlist to restrict outbound calls. This allowlist limits which hosts the node can reach. It does not stop an AI agent from sending destructive requests to allowed domains.
How n8n stores and uses HTTP credentials
You attach a credential to an HTTP Request node. This credential holds the API key or OAuth token. n8n encrypts these values before saving them to the database. It uses a random key generated on first launch. This protects secrets at rest. Once a workflow runs, n8n sends the credential with the request.
The node supports standard methods like GET, POST, PUT, PATCH, and DELETE. You can set this to specific domains. The node will only make requests to those hosts. This creates a useful network boundary. It is especially helpful for workflows triggered by external events.
This control manages destination, not intent. An AI agent can still send a DELETE request to an allowed domain. The allowlist prevents reaching a different host. It does not inspect the method, path, or payload. For example, an agent might be told to "clean up the test account." It could then send a DELETE request to a valid endpoint. This would delete real data on an allowed domain.
Where domain allowlists leave a gap
Domain allowlists are a form of network segmentation. They answer which servers you can talk to. They do not answer what you are doing to that server. In a traditional workflow, a human writes the request. The intent is known. In an agentic workflow, the model generates the request parameters. The framework provides tools for the model to fill in parameters. It relies on the underlying API to enforce authorization for each action.
This creates a risk of excessive agency. If the API key has broad permissions, the agent can perform any allowed action. The allowlist prevents reaching hosts outside the configured list. It does not stop the agent from overreaching within the allowed host.
Adding a check on the API connection
You need a control that sits on the API connection. It must inspect both the request and the response. hoop.dev is an open-source proxy that runs next to your internal HTTP API. It reads every request the agent sends. It also reads every result that comes back. Because it speaks HTTP, it sees the method, path, and headers.
REST API Authentication + Ephemeral Credentials: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
With hoop.dev, you can define guardrails. These guardrails refuse specific methods on specific paths. You can block DELETE requests to admin endpoints. This works even if the domain is allowed in n8n. The proxy sends a 403 Forbidden response with a clear message. The agent knows why the request failed. This is a runtime check that happens at the speed of the request. It is outside the agent's control.
hoop.dev also handles data coming back. Data Masking in hoop.dev rewrites sensitive values in the JSON response. It does this before the data reaches the n8n workflow. If the API returns a customer's email or credit card number, hoop.dev can mask those fields. It uses the JSON key path for this. The agent receives the masked value. This is different from log masking. Log masking happens after the data has already been processed.
How this fits with n8n's existing controls
hoop.dev does not replace n8n's credential encryption or domain allowlists. Those controls are still necessary. Encryption keeps secrets safe in the database. The allowlist limits the network blast radius. hoop.dev adds a layer of statement-level control on the API connection. It works behind whatever interface the agent uses. This includes n8n's HTTP Request node. The agent changes one thing. It points the host and port in its connection string to the hoop.dev proxy instead of the API directly.
This setup lets you keep your existing n8n workflows and credentials. You just add the proxy in front of the API. The proxy records every statement and decision to an audit trail. You can also see what was allowed or blocked. This is especially useful for compliance. It generates evidence for your security program. It does not change how the agent operates.
Getting started
If you use n8n to call internal APIs with AI agents, consider adding a proxy on the API side. Check out the hoop.dev HTTP protocol docs to see how to configure it for your API. You can also read about Data Masking to understand how to protect sensitive fields in responses. The project is open source. You can inspect the code and run it locally. Find the source on the hoop.dev GitHub repository.
Frequently asked questions
Does n8n's domain allowlist prevent SQL injection?
No. The domain allowlist restricts which hosts the HTTP Request node can connect to. It does not sanitize the request body or parameters. If the API is vulnerable to injection, the allowlist will not stop a malicious payload. That payload can still be sent to an allowed domain.
Can hoop.dev mask data in n8n workflows?
Yes, if the workflow calls an HTTP API that goes through hoop.dev. hoop.dev masks the response before it reaches n8n. The n8n node receives the masked data. The agent receives the masked values. This works for JSON responses where the sensitive data is in known fields.
Do I need to change my n8n credentials?
No. You keep your existing API keys and OAuth tokens in n8n. You only change the target URL in the HTTP Request node. You point it to the hoop.dev proxy. The proxy forwards the request to the actual API with the original credentials.
In this post