Policy-Gated Invoice Exception Router

The agent extracts. The policy decides. A human gets everything it will not sign for.

Decision pipeline idle

1 · intake
Invoice
waiting
2 · MCP tool
extract_invoice_fields
Bedrock converse
3 · MCP tool
check_billing_policy
policy.yaml, deterministic
✓ auto-approve → audit stream
⚑ human queue → Redis LIST

Break it

Drift lowers extraction confidence, so the policy stops trusting the model and everything routes to a human. Killing Redis buffers audit writes and replays them on restore.

policy.yaml

Approved vendor panel

Invoice inbox

Live decision

Raw invoice text
click an invoice above
Model output (parsed JSON)
confidence

Policy tape — every rule, every reason

no evaluation yet

MCP traffic

Human queue

Audit stream

Matter budgets