Loading…
Wrap `send_refund`, `issue_payout`, or any tool that moves money — the inner tool only fires on an approve verdict.
For: Agent builders whose tool calls move money or write to a ledger
Auto-approves refunds under the escalation threshold for customers in good standing; escalates above it.
Blocks any refund tied to an active chargeback, regardless of amount.
Restrains a payout when the same claim reference has already been settled.
# LangChain Money-Moving Tool Gate
# Fork: thresholds mirror the "Refunds" governance template — change them.
# Wrap the tool with DecionisGateTool.wrap(shadow_mode=True) first.
apiVersion: decionis.dev/v1
kind: PolicyPack
metadata:
name: langchain-money-moving-tool-gate
surface: langchain
workflow_key: refund_execution
standards: [SOC2-CC7.2, ISO27001-A.8.9]
defaults:
mode: shadow
emit_dossier: true
rules:
- name: refund_ceiling
when: "tool == 'send_refund'"
decision: |
ALLOW IF refund_amount < 1000 AND customer.standing == 'good'
ESCALATE IF refund_amount < 10000
BLOCK OTHERWISE
reason_code: refund_over_threshold
- name: active_chargeback_block
when: "tool == 'send_refund'"
decision: |
BLOCK IF chargeback == true
ALLOW OTHERWISE
reason_code: refund_on_active_chargeback
- name: duplicate_claim_guard
when: "tool in ['send_refund', 'issue_payout']"
decision: |
RESTRAIN IF claim.reference in ledger.settled_references
ALLOW OTHERWISE
reason_code: duplicate_claim_reference
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.
Wraps any LangChain BaseTool. The LLM still picks the tool on the same prompt; Decionis decides if the call fires.
# pip install decionis-langchain
from decionis import DecionisClient
from decionis_langchain import DecionisGateTool
client = DecionisClient(api_key="...", base_url="https://api.decionis.com")
gated_refund = DecionisGateTool.wrap(
inner_tool=send_refund,
client=client,
tenant_id="org-uuid",
workflow_key="refund_execution",
shadow_mode=True, # ← every verdict recorded; inner tool always runs
site_base_url="https://decionis.com",
)
agent.bind_tools([gated_refund])