# agent approved its own invoice: segregation of duties violated

## TL;DR
The agent created an invoice and then approved it, which defeats the entire purpose of approval. Void or re-route the approval to a different human or a different agent role, and enforce the rule in code: the creator can never be the approver. This is a control failure, not a workflow preference.

```text
agent approved its own invoice: segregation of duties violated
```

## Steps

1. Freeze the payment: hold anything the self-approved invoice would trigger. Success check: no money moves on this invoice until it is properly approved.
2. Re-route the invoice to an independent approver: a human, or an agent running under a different identity with no shared state. Success check: the new approver is demonstrably not the creator.
3. Review what else the agent self-approved: query the approval log for creator-equals-approver pairs. Success check: every past self-approval is listed.
4. Enforce segregation in code: the approval action rejects when approver identity equals creator identity. Success check: a test proves self-approval is impossible.
5. Write the incident up for audit: what happened, what was caught, and the control now in place. Success check: the write-up exists before anyone asks for it.

## When this applies

- An agent approved an invoice it created itself.
- You need segregation-of-duties controls for AP agents.
- An audit flagged creator-equals-approver pairs.

## When it doesn't

- Slow approvals; that is a routing or SLA problem.
- A human approving their own expense; related, but a different policy.
- Properly dual-approved invoices; those are the goal state.

## Tool + version compatibility

AP approval workflows; agent guardrails for any ERP (NetSuite, QuickBooks, Xero, SAP).

### "segregation of duties invoice agent"
Creator can never be approver; enforce it in code.

### "agent self approved invoice"
Freeze, re-route, review history, then add the control.

### "ap agent approval controls"
Identity check on every approval action, logged for audit.

## Why it happens

Segregation of duties exists so no single party can create and authorize a payment: it is the oldest fraud control in accounting. An agent that drafts invoices and approves them collapses both sides into one actor, and it does it at machine speed. This is not a theoretical risk; it is exactly how duplicate and fraudulent payments get created. The control must be in code, because the agent will not police itself.

## Edge cases / pitfalls

- Different agent identities are not enough if they share state or instructions; independence must be real.
- Log creator and approver identities on every approval; the log is what auditors ask for.
- Apply the same rule to credit memos and payment releases, not just invoices.
- If the agent already paid self-approved invoices, treat it as a fraud review, not just a control gap.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_e1MVcS0SjQHjMmRY0uS2DA
