Drop a gate node between plan and execute so the graph's conditional edge branches on the verdict instead of a guess.
For: JS / Node agent builders running multi-step LangGraph workflows
Escalates a planned step whose blast radius exceeds the encoded ceiling.
Blocks a step that falls outside the agent's declared scope.
Escalates when the plan itself flags that a human approval is required.
# LangGraph Plan → Execute Gate
# Fork: place decionisGateNode between plan and execute; the conditional edge
# branches on state.decionis.outcome (allowed / blocked / errored).
apiVersion: decionis.dev/v1
kind: PolicyPack
metadata:
name: langgraph-plan-execute-gate
surface: langchain
workflow_key: agent_plan_execution
standards: [SOC2-CC7.2, ISO27001-A.8.9]
defaults:
mode: shadow
emit_dossier: true
rules:
- name: step_blast_radius_gate
when: "node == 'execute'"
decision: |
ALLOW IF step.risk_score < 60
ESCALATE IF step.risk_score < 85
BLOCK OTHERWISE
reason_code: step_risk_over_threshold
- name: out_of_scope_step_block
when: "node == 'execute'"
decision: |
BLOCK IF outside_scope == true
ALLOW OTHERWISE
reason_code: step_outside_agent_scope
- name: human_in_the_loop_hold
when: "node == 'execute'"
decision: |
ESCALATE IF requires_human == true
ALLOW OTHERWISE
reason_code: plan_requires_human_approval
Fork it, change the thresholds to match your environment, and deploy in shadow mode first — it defaults to listen-only so nothing in your live pipeline changes.
Same wrap-and-forget pattern as the Python version, for Node-land agents.
// npm i @decionis/langchain @decionis/sdk-node
import { createDecionisNodeSdk } from "@decionis/sdk-node";
import { DecionisGateTool } from "@decionis/langchain";
const client = createDecionisNodeSdk({
baseUrl: "https://api.decionis.com",
apiKey: process.env.DECIONIS_API_KEY!,
});
const gatedRefund = DecionisGateTool.wrap({
innerTool: sendRefund,
client,
orgId: process.env.DECIONIS_ORG_ID!,
decisionType: "refund_execution",
shadowMode: true, // ← every verdict recorded; inner tool always runs
siteBaseUrl: "https://decionis.com",
});
await agent.bindTools([gatedRefund]);
Ships in shadow mode — every verdict is recorded, nothing is blocked.
This recipe is one step in a path. The same five steps apply to every recipe in the exchange.
Run the policy against a realistic action in the browser. Push it past what the rules allow and watch the verdict come back. No account.
See exactly what was decided and why: the rule that fired, the evidence it read, the policy version in force, and an Ed25519 signature you can verify yourself.
Measure what the policy would have caught on your own traffic without touching the live path. Every recipe defaults to shadow, so the first deployment carries no execution risk.
Point the same policy at the system where the action actually originates — a checkout, an ERP posting, a Zap, an agent's tool call.
Publish the proof: a public verification link, an embeddable badge, a PR comment, or an anonymized shadow-mode finding. This is how the next person discovers Decionis.