Skip to content
Docs

Enforce

Enforce checks a proposed action against the active constraints and decisions in your workspace’s governed memory. It writes the verdict to its output so the flow can branch on it, and can hard-stop the run outright. Place it ahead of an irreversible step you want memory to protect. You find it on the node picker’s AI shelf.

The input handle accepts the upstream node’s output; the output handle emits the verdict as JSON.

The Enforce node's settings form, with the fields described below
The Enforce node's settings form, with the fields described below
FieldTypeDefaultDescription
Proposed action (proposedAction)string ✦ (required) — The action or text to evaluate against governed memory constraints and decisions.
Tags (tags)string ✦ (required) — JSON array of tags that narrows which memory items are enforced, e.g. [“ai”,“security”]; an empty array evaluates all active items.
Fail on block (failOnBlock)boolean ✦ (optional) false When enabled, a ‘block’ decision hard-stops the flow with an error instead of just recording the result for downstream branching. So does a check that could not be made.

Fields marked ✦ accept expressions.

Try this node — run it once against your own workspace, with your credentials, without building a flow first.

Only Constraint and Decision memory items are enforced, and only when you have confirmed them (or imported them as trusted). An unreviewed item an agent extracted on its own informs recall but never blocks a run. Curate the items on the Memory screen: see Memory review.

When nothing matches, because the workspace has no confirmed constraints yet or because the tags filter excludes them all, the node returns allow with empty reasons and calls no model.

{
"decision": "allow",
"reasons": [],
"violatedItemIds": [],
"failed": false
}

decision is allow, warn, or block; reasons explains the verdict and violatedItemIds names the memory items the action contradicts. With failOnBlock enabled, a block verdict fails the run immediately instead of handing the result downstream.

A platform-configured model makes the judgement. When the evaluation itself errors, what happens depends on failOnBlock:

  • On: the action is stopped, not let through. The step is retried a few times, and if the model still cannot be reached, the run fails.
  • Off: the decision is allow, failed is true and the failure is recorded in reasons, so the flow carries on. Branch on $prev->failed if a check that could not be made should stop the branch too.

The template “Smoke / Governed memory — enforce gate” (browse it under Templates) feeds the run’s input into an Enforce node. The proposed action comes from the start data:

{{ $start->action }}

Its tags field narrows enforcement to items tagged ["policy","refund"]. Wire a Conditional Exit after it to stop the branch when $prev->decision is block, or enable failOnBlock to let the node fail the run itself.

A Check an action against policy flow on the canvas, with Start wired into a single Enforce policy node
A Check an action against policy flow on the canvas, with Start wired into a single Enforce policy node
  • With failOnBlock off, a check that could not be made lets the action through, marked failed. For an action that must never slip through unreviewed, turn failOnBlock on, or pair the flow with human approval instead of relying on this gate alone.