n8n integration

Put Guardian in front of the step that cannot be undone.

Guardian judges an action before it happens, and your workflow does the work. Guardian never sends, deletes or pays anything itself. It answers one of three ways, and keeps a record of every answer.

ALLOWED

The action may run. Connect this output to your action node.

NEEDS APPROVAL

A human decides first. The workflow waits.

DENIED

Nothing runs. The attempt is recorded.

Setup

The integration, in four steps

  1. Place the Guardian node right before the action node (the send, the delete, the payment), after the step that produces the values.
  2. Fill two fields. Action Type is a name you choose, such as email.send. Payload is the JSON with the fields your policy will check, using the same field names as the policy. The credential needs an API key from the dashboard under Settings, plus the signing secret and base URL it asks for.
  3. Wire the three outputs. Connect Allowed to the action node. Leave Denied and Needs Approval pointing at a note or at nothing. Never connect all three to the action.
  4. If you use Needs Approval, add the approval path: Guardian Approval Trigger, then a Guardian node set to Enforce, then the action node. The action node reads the approved payload from the trigger's payloadJson, which holds the edited version when the approver changed it. The workflow must be active, and only one active workflow should listen for the same action type.
The Guardian API credential in n8n: API key, signing secret and base URL, with a successful connection test
The Guardian API credential in n8n, connection tested.

Example payload for an email, where a text value from an AI step is wrapped in JSON.stringify so line breaks cannot break the JSON:

payload
{
  "recipient": "customer@example.com",
  "subject": {{ JSON.stringify($json.output.subject) }},
  "body": {{ JSON.stringify($json.output.body) }}
}
The Guardian node with all three outputs connected: Allowed sends the email, Denied and Needs Approval each end in a visible response
All three outputs connected. Allowed sends the email. Denied and Needs Approval each end in a visible response.
Rules

Policies

An action type with no matching policy is denied by default, which is an org setting. Inside a policy every rule is evaluated and the strictest result wins. A threshold rule fires only when it matches, so the exact boundary value needs its own rule. A typo in a field name makes a rule silently dead, so run every policy through the Policy Tester with the real payload before you rely on it.

Before you go live

Test safely

Listen Mode records every request with its real payload and shows what your current policies would have decided, as "Would have: DENY (advisory)". It blocks nothing. You switch it on in the dashboard under the Organization tab, with a duration. The workflow continues through Allowed, and the action runs.

Listen Mode switch in the Organization tab
Listen Mode, in the Organization tab. Pick how long it stays on.
Audit Log rows recorded in Listen Mode, with the advisory Would have decision
Observed requests in the Audit Log. Nothing was enforced; each row shows what Guardian would have decided.

For a first run on a destructive step, disable the action node (select it and press D). A disabled node passes data through without acting. Then open the audit row of the observed run and use "Create policy from captured intent" to build the policy from the real payload.

Approvals list: requests waiting for a human
Requests waiting for a human in the Approvals list.
Edit Payload and Approve: original payload next to the approved payload
The approver can edit the payload before approving. The original stays next to it.
Troubleshooting

Common first-run surprises

What you seeWhy, and the fix
The first result is DENYNo policy matches the action type. Build one from the captured payload in Listen Mode.
A rule never firesThe rule's field name differs from the payload's, often a typo. Check it in the Policy Tester.
The action ran in Listen ModeListen Mode never blocks. Disable the action node while testing.
Subject or body is empty after GuardianThe Allowed output carries Guardian's data, not your earlier node's. Read the values from that node, for example $('Basic LLM Chain').first().json.output.body.
An amount rule sees 0In node versions before 1.0.9 the Amount field defaults to 0 and can overwrite the payload's amount. Update the node, or put {{ $json.amount }} in the Amount field.
An email goes out twice after an approvalTwo active workflows listen for the same action type. Keep one active.
Where we are

What Guardian does not do yet

  • The tamper-evident chain covers the submitted request and the decision. The approver, the approval time and status, and an edited payload are stored and fingerprinted, but not yet part of the chain.
  • The chain is verified inside Guardian. A customer-held anchor for independent verification does not exist yet.
  • Listen Mode results are advisory and not tamper-evident.
  • A per-action setting for what happens when Guardian is unreachable is planned, not built.
Support

Questions or stuck

Write to us. A person reads it.