---
title: How do you govern AI agents built in n8n?
url: https://opencontroller.lyzr.com/blog/govern-n8n-ai-agents
published: 2026-11-12
updated: 2026-11-12
author: Lyzr
---

# How do you govern AI agents built in n8n?

**Govern n8n AI agents by controlling four things: who can build workflows, which credentials and nodes they can use, where model calls go, and where execution and audit events are streamed. n8n gives you a built-in security audit and, on Enterprise, log streaming that includes AI node and MCP events. It does not tell you which n8n instances exist across your company, which is often the first problem.**

n8n is a workflow automation tool with an AI Agent node that connects a chat model, memory and tools. Teams adopt it quickly because it can be self-hosted for free, which is also why security teams find instances they did not know about. Agents built in n8n often hold real credentials to email, CRM, databases and cloud accounts.

## What makes n8n agents different to govern?

- **Self-hosting is common.** The community edition can run on any server or laptop. Data stays where it runs, but so does responsibility for patching and access.
- **Credentials live in the workflow tool.** An AI Agent node's tools use stored credentials. Anyone who can edit the workflow can change what the agent does with them.
- **Some nodes run code on the host.** n8n's own security audit flags "official risky nodes", meaning built-in nodes that can run code on the host, plus community and custom nodes.
- **The attack surface is real.** In March 2026 the Cloud Security Alliance published a research note on n8n remote-code-execution flaws and the attack surface of AI pipelines. Unpatched instances are a direct risk.

## What does n8n give you out of the box?

| Control | What it does | Availability |
|---|---|---|
| Security audit | Five risk reports: credentials, database, file system, nodes, instance | Run with `n8n audit`, the `/audit` API (instance owner) or the n8n node |
| Log streaming | Streams workflow, node, audit, AI node, runner, queue and worker events to syslog, webhook or Sentry | Enterprise plan, cloud and self-hosted |
| Audit events | Logins, user and credential changes, workflow changes, external secrets, role mapping, MCP access and tool calls, community node package events | Through log streaming; MCP audit events need n8n 2.34.0 or later |
| AI node logs | Memory, output parser, retriever, embeddings, tool calls, LLM and vector store events | Through log streaming |

The security audit is a point-in-time check. Its instance report flags unprotected webhooks, missing security settings and outdated versions. Its credentials report lists credentials not used in any workflow or in any recently active one, which are good candidates for removal.

Log streaming is the ongoing record. The AI node event group is what lets you see which tools an agent called and which model it used, in your own SIEM.

## What should your n8n agent governance checklist include?

1. **Find every instance.** Search cloud accounts, container registries and endpoint inventories for n8n. Our [shadow AI agent guide](/blog/how-to-find-shadow-ai-agents) covers methods.
2. **Patch on a schedule.** Use the audit's instance report to catch outdated versions; subscribe to n8n security advisories.
3. **Run the security audit weekly.** Automate `n8n audit` or the `/audit` endpoint and track findings over time.
4. **Restrict risky nodes.** Decide which code-running and file-system nodes are allowed, and whether community nodes may be installed at all.
5. **Clean up credentials.** Remove credentials the audit reports as unused. Scope the rest to the minimum the agent needs.
6. **Route model calls through one endpoint.** Point the chat model's credentials at an approved gateway URL rather than issuing provider keys to each builder.
7. **Stream logs to your SIEM.** Include the audit, AI node and MCP event groups.
8. **Register each agent workflow.** Record owner, purpose, model, tools and credentials, and review it when the workflow changes.
9. **Require human review for side effects.** Add an approval step before an agent sends external email, changes records or moves money.

## Is self-hosted or cloud n8n easier to govern?

Neither is automatically safer. Self-hosted gives you data location and network control, but you own patching, backups and access. n8n Cloud shifts hosting work to the vendor, but data location is set by the vendor and features depend on plan. For regulated data, many teams choose self-hosted on a managed platform with central patching and log streaming turned on. For the same controls across other agent platforms, see the [cross-platform governance guide](/blog/how-to-govern-ai-agents-across-platforms).

## How Opencontroller does this

Opencontroller by Lyzr keeps a governed registry of agents, versions, tools and MCP servers, including agents it does not host; see [registering agents you don't host](/blog/register-ai-agents-you-dont-host). n8n chat models that use an OpenAI-compatible credential can point at the Lyzr LLM Gateway, which adds routing, fallback, caching and cost attribution per agent and per version, and lets you allow, route, redact or block traffic in the path. Auto-discovery covers agents, models and API keys in AWS, Azure and Google Cloud, which can reveal provider keys used by unmanaged automation. Control depth depends on the traffic path. [Book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Does n8n have audit logs?**
n8n streams audit events, including logins, credential and workflow changes, and MCP access, through log streaming, which is available on the Enterprise plan.

**How do I run an n8n security audit?**
Run n8n audit from the command line, call the /audit API endpoint as the instance owner, or use the n8n node with the Audit resource.

**Can I see which tools an n8n AI agent called?**
Yes, with log streaming. The AI node event group includes tool call, LLM, memory, retriever and vector store events.

## Key facts

n8n has an AI Agent node that connects a chat model, memory and tools. Its security audit (n8n audit CLI, /audit API as instance owner, or the n8n node) produces five risk reports: credentials, database, file system, nodes (official risky, community and custom nodes) and instance (unprotected webhooks, missing settings, outdated version). Log streaming (Enterprise plan, cloud and self-hosted) sends events to syslog, webhook or Sentry, including audit events, AI node logs (tool calls, LLM, memory, retriever, vector store) and MCP access and tool calls (n8n 2.34.0+). Opencontroller by Lyzr offers a governed registry and an OpenAI-compatible LLM Gateway with cost per agent. Pricing starts from $250K per deployment per year.

## Related

- [How to find every AI agent in your enterprise (including shadow agents)](https://opencontroller.lyzr.com/blog/how-to-find-shadow-ai-agents.md)
- [How do you register an AI agent your team doesn't host?](https://opencontroller.lyzr.com/blog/register-ai-agents-you-dont-host.md)
- [How do you review MCP servers your agents already use?](https://opencontroller.lyzr.com/blog/how-to-review-mcp-servers-agents-already-use.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
