Why AI Agents Need a Pre-Action Enforcement Gateway (Not Just Guardrails)
Prompt filters and model-level guardrails cannot enforce financial authority. Learn how an out-of-band enforcement boundary isolates credentials, binds intent digests, and fails closed.
Key Takeaways
- Agents should never hold direct ERP, treasury, or payment API credentials — only the enforcement gateway holds downstream secrets.
- Every high-risk action is canonicalized and hashed (SHA-256 intent digest) so human approvals bind to exact parameters, not summaries.
- Ambiguous downstream timeouts transition to UNKNOWN and reconcile against the target system before any retry is allowed.
The guardrail illusion at the system boundary
Most early AI agent deployments rely on prompt instructions, classifier guardrails, or SDK wrappers running inside the same process as the model runtime. While helpful for tone and content moderation, in-process checks collapse the moment an agent is tricked via indirect prompt injection, a plugin bug, or a misconfigured retry loop.
If the agent runtime holds the API key to your ERP or payment rail, authorization is advisory. A downstream API cannot tell whether a bank-account change came from a verified human workflow or a hallucinated tool call.
Non-bypassable boundary rule
Enforcement only holds when the target ERP or payment system rejects direct agent calls and accepts mutations exclusively from the customer-owned gateway.
Binding human approvals to exact canonical bytes
When an agent submits an action such as erp.supplier.bank_account.change or erp.invoice.approve, ActEscrow normalizes the parameters using RFC 8785-style canonical JSON and computes a SHA-256 intent digest.
If a supplier IBAN changes from DE89... to SE45... or an invoice amount shifts by a single minor unit after approval was requested, the digest mismatch blocks execution immediately.
{
"tool": "erp.invoice.approve",
"resource": "invoice:INV-1002",
"parameters": { "amountMinor": 250000, "currency": "EUR" },
"intentDigest": "sha256:9f2c8b4e...d41a",
"decision": "RequireApproval",
"requiredApprovals": 1
}Handling UNKNOWN downstream timeouts without double-execution
Real-world ERP integrations time out. Blindly retrying a payment or invoice approval risks double-settlement, while marking it failed hides a mutation that actually committed.
Our gateway records an UNKNOWN outcome whenever a downstream write times out or returns an ambiguous 5xx, dispatches an idempotent lookup against the target system, and only reconciles to Executed or Failed once read-back state is confirmed.
- Idempotency-Key derived deterministically per approved action ID
- Read-back verification checks target invoice status, amount, and currency
- Fail-closed 503 ControlPlaneUnavailable whenever policy authority is unreachable for high-risk mutations
A worked example: one invoice approval, end to end
Consider a hypothetical accounts-payable agent that wants to approve invoice INV-1002 for 250000 minor units EUR. It calls the gateway over HTTP with its OIDC token. The gateway takes the tenant only from the verified token, canonicalizes the tool, resource and parameters, and computes the action digest. The deterministic policy engine evaluates the ordered rules: if the first matching rule says RequireApproval, the action is parked and approvers are notified with ids and a link, never with the payload itself.
When the required approvers have voted on that exact digest, the gateway redeems the action, an atomic APPROVED to EXECUTING transition that can happen at most once. The invoice adapter performs the write with the credential only the gateway holds, then reads the invoice back. If the read-back matches, the evidence chain records an executed and verified outcome. If the ERP times out, the action becomes UNKNOWN and a lookup decides what really happened.
What the gateway deliberately does not do
A pre-action gateway is narrow on purpose. It does not judge whether the model reasoned well, it does not trace prompts, and it is not an identity provider. Its job is to decide whether one structured action may run, and to leave proof of that decision.
- It is not an LLM guardrail: keep prompt filtering upstream if you need it.
- It is enforcement only where the agent has no other credential or network path to the ERP; otherwise it is observation.
- It does not replace native controls in a single-cloud estate, where Microsoft or AWS tooling may be the simpler choice.
- It does not promise to stop fraud; it makes the authorization path explicit, bound and auditable.
First thing to verify in a pilot
Before measuring anything else, try to call the ERP directly from the agent host with every credential you can find. If that call succeeds, fix the bypass before you trust any gateway decision.
Security scope and deployment prerequisites
This is a pilot implementation, not a zero-risk guarantee or compliance certification. Examples describe repository capabilities or deployment recommendations, not proof that a live installation has enabled them.
Every enrolled write fails closed during control-plane outages. Privileged control-plane MFA is mandatory outside Development, but accepted MFA claims do not prove recent authentication or hardware-backed WebAuthn unless the identity provider enforces those properties.
Per-agent deactivation blocks new evaluations and redeems and cancels Pending/Approved actions; it cannot recall an already executing ERP write. Evidence verifies recorded events, not unrecorded ERP activity; independently retained heads and trusted keys are needed to detect truncation or replacement.
Production blockers remain
The static portal still uses sessionStorage tokens (BFF not implemented). Off-host backup signing, immutable backup storage, live IdP MFA/logout testing, restore drills, adapter validation, monitoring, and legal review require deployment-specific work. Anchoring and SIEM forwarding are optional and must be configured and tested. See the repository deployment guide and runbook gap register before using real customer data.
Related deep dives
iPaaS Connectors (Workato, Zapier, Make) vs. Fail-Closed Agent Gateways
Nov 19, 2026 · 3 min readArchitectureLLM Observability (LangSmith, Arize, Galileo) vs. Pre-Execution Control
Nov 17, 2026 · 3 min readArchitectureAWS Bedrock AgentCore Policy vs. Customer-Owned Action Gateways for Multi-Cloud Finance
Nov 15, 2026 · 3 min read