HR and accounting are where an AI agent looks most attractive and is easiest to get badly wrong. Both teams drown in repetitive, rules-based work: answering the same leave questions, keying invoices, chasing receipts, matching numbers across three documents. Both also hold the two things a company can least afford to leak or mishandle: money and personal data.
So the useful question is not "can an agent do accounting?" It is "which parts can it prepare, and which decisions must stay with a named person?" This guide answers that, includes a small tested code sample of the controls, and ends with a 30-day plan. It is written for finance and HR managers and the technical leads who support them.
The one rule: the agent prepares, a person approves
Accounting has a long-standing principle called segregation of duties: the person who enters a transaction should not be the one who authorises payment. The same logic applies to an agent, and it is the single most important design rule here.
One accounts-payable guide for controllers lists four controls as non-negotiable under any agent: segregation of duties, approval authority by amount, three-way matching and a complete audit trail. Its test is blunt: if an agent cannot show its work, it does not get your payment rails.
In practice that means the agent can read, extract, check, flag and draft. It cannot approve a payment, change who gets paid, change someone’s salary or file a return.
Accounting: where an agent earns its place
- Invoice data extraction. Read invoices arriving by email or PDF and capture vendor, amounts, tax and line items. A person checks the exceptions, not every invoice.
- Three-way matching. Compare three records: the invoice, the purchase order and the goods receipt, and flag differences in price, quantity or vendor.
- Duplicate detection. Catch the same invoice arriving twice, a classic way to pay a bill double.
- Coding suggestions. Propose the expense account or cost centre, for an accountant to confirm.
- Reconciliation help. Suggest matches between bank lines and ledger entries, and list what is left unexplained.
- Month-end checklists. Track which accruals, reconciliations and reports are done, and chase the people who owe an input.
- Expense receipts. Read receipts, check them against policy and prepare the claim for a manager to approve.
HR: where an agent earns its place
- Policy and benefits questions. Leave rules, holiday calendars, claims procedure, answered from the approved handbook, with "I will ask HR" when unsure.
- Own-record lookups. An employee asks for their own leave balance; the agent checks the person’s identity first and shows only that person’s data.
- Onboarding checklists. Remind new joiners and their managers which documents and accounts are still outstanding.
- Drafting. First drafts of job descriptions, offer letters and announcements, for HR to edit.
- Payroll variance notes. Compare this month’s payroll with last month and list unusual changes for a payroll officer to explain. The agent reads and flags; it does not change payroll.
What must stay with people
| Area | Keep with a person |
|---|---|
| Payments | Approving a payment run or a single payment |
| Vendors | Adding a vendor or changing bank details |
| Payroll and pay | Changing salary, bonuses or deductions |
| Hiring and firing | Selecting, rejecting, promoting or dismissing anyone |
| Tax and statutory filings | Submitting returns and filings |
| Disputes and sensitive cases | Grievances, harassment complaints, medical or family matters |
A clean match is not a safe invoice
Matching three documents catches honest mistakes. It does not catch fraud that arrives looking correct. The most common trap is the supplier bank-detail change: someone, often through a hacked or imitated email account, tells your accounts team that a supplier’s bank account has changed.
The scale is not small. In the United States, business email compromise losses reported to the FBI’s Internet Crime Complaint Center reached about US$3.05 billion in 2025, the largest share of business losses in that data. Typical advice from fraud-prevention guides is to require a second person to sign off any change to supplier bank details, and to confirm by calling a known number, not the one in the email.
So the sample below treats "bank account differs from the vendor master" and "bank details changed recently" as reasons to stop and send the invoice to a human, even if every number matches.
A tested sample: matching plus an approval gate
This is a small, self-contained Python file with three parts: an action policy (green, amber, red), a three-way match with fraud flags, and a payment gate that refuses to let an agent or the preparer approve a payment. All data and limits are invented demo values. Save it as controls.py:
"""Controls an HR and accounting agent must run INSIDE. Demo data and rules only."""
from dataclasses import dataclass, field
# ---- 1. Action policy: what the agent may do on its own ------------------------
POLICY = {
# green: agent acts alone (read-only or fixed-template)
"answer_policy_question": "auto", "lookup_own_leave_balance": "auto",
"extract_invoice_fields": "auto", "run_three_way_match": "auto",
# amber: agent prepares, a named person approves
"propose_payment": "draft", "draft_offer_letter": "draft",
"propose_journal_entry": "draft", "draft_payroll_variance_note": "draft",
# red: people only
"approve_payment": "human", "change_vendor_bank_details": "human",
"change_salary": "human", "hire_or_dismiss": "human", "file_tax_return": "human",
}
def decide(action):
return POLICY.get(action, "human") # unknown actions default to a human
# ---- 2. Three-way match: invoice vs purchase order vs goods receipt ------------
def three_way_match(inv, po, receipt, vendor, seen_invoice_ids, price_tol_pct=2.0):
reasons = []
if inv["invoice_id"] in seen_invoice_ids:
reasons.append("duplicate invoice id")
if inv["vendor_id"] != po["vendor_id"]:
reasons.append("vendor differs from purchase order")
if inv["bank_account"] != vendor["bank_account"]:
reasons.append("bank account differs from vendor master")
if vendor["bank_changed_days_ago"] < 30:
reasons.append("vendor bank details changed in the last 30 days")
ordered = {l["sku"]: l for l in po["lines"]}
received = {l["sku"]: l["qty_received"] for l in receipt["lines"]}
for line in inv["lines"]:
sku = line["sku"]
if sku not in ordered:
reasons.append(f"{sku}: not on purchase order"); continue
if line["qty"] > received.get(sku, 0):
reasons.append(f"{sku}: billed {line['qty']} but received {received.get(sku, 0)}")
po_price = ordered[sku]["unit_price"]
if abs(line["unit_price"] - po_price) / po_price * 100 > price_tol_pct:
reasons.append(f"{sku}: price {line['unit_price']} vs PO {po_price}")
return {"status": "exception" if reasons else "match", "reasons": reasons}
# ---- 3. Payment gate: preparer and approver must differ, agents cannot approve -
APPROVAL_LIMIT = {"ap_clerk": 0, "ap_manager": 100_000, "cfo": 1_000_000} # THB, demo values
@dataclass
class PaymentProposal:
invoice_id: str
amount: float
prepared_by: str
status: str = "proposed"
log: list = field(default_factory=list)
def approve_payment(p, approver, role):
if approver.startswith("agent"):
raise PermissionError("agents cannot approve payments")
if approver == p.prepared_by:
raise PermissionError("preparer cannot approve their own payment")
if p.amount > APPROVAL_LIMIT.get(role, 0):
raise PermissionError(f"{role} cannot approve {p.amount:,.0f}")
p.status = "approved"
p.log.append(f"approved by {approver} ({role})")
return p
And the checks, saved as test_controls.py. We ran them and they pass:
from controls import *
po = {"vendor_id": "V1", "lines": [{"sku": "A", "qty": 100, "unit_price": 50.0}]}
rc = {"lines": [{"sku": "A", "qty_received": 100}]}
vendor = {"bank_account": "111-1", "bank_changed_days_ago": 400}
inv = {"invoice_id": "I-1", "vendor_id": "V1", "bank_account": "111-1",
"lines": [{"sku": "A", "qty": 100, "unit_price": 50.5}]}
m = lambda i, v=vendor, seen=(): three_way_match(i, po, rc, v, set(seen))
assert m(inv)["status"] == "match" # clean, 1% price drift is inside tolerance
assert "billed 120 but received 100" in m({**inv, "lines": [{"sku": "A", "qty": 120, "unit_price": 50.0}]})["reasons"][0]
assert m({**inv, "lines": [{"sku": "A", "qty": 100, "unit_price": 55.0}]})["status"] == "exception" # 10% over
assert m({**inv, "bank_account": "999-9"})["status"] == "exception" # a changed account on an invoice
assert m(inv, {**vendor, "bank_changed_days_ago": 5})["status"] == "exception" # recent master change
assert m(inv, seen=["I-1"])["status"] == "exception" # duplicate
assert m({**inv, "lines": [{"sku": "Z", "qty": 1, "unit_price": 1.0}]})["status"] == "exception"
assert decide("run_three_way_match") == "auto" and decide("propose_payment") == "draft"
assert decide("approve_payment") == "human" and decide("anything_new") == "human"
def fails(fn):
try: fn()
except PermissionError: return True
return False
p = PaymentProposal("I-1", 50_000, prepared_by="agent-ap")
assert fails(lambda: approve_payment(p, "agent-ap", "ap_manager")) # agent can never approve
p2 = PaymentProposal("I-2", 50_000, prepared_by="somchai")
assert fails(lambda: approve_payment(p2, "somchai", "ap_manager")) # same person
assert fails(lambda: approve_payment(p2, "malee", "ap_clerk")) # over limit
assert approve_payment(p2, "malee", "ap_manager").status == "approved"
print("all control checks passed")
flowchart TD
A["Invoice arrives"] --> B["Agent extracts fields"]
B --> C["Three-way match and fraud flags"]
C --> D["Clean match"]
C --> E["Exception"]
D --> F["Agent proposes payment"]
F --> G["Different person approves within limit"]
E --> H["AP reviewer resolves"]
G --> I["Logged"]
H --> I
Notes on the design:
- Unknown actions default to a human. If the agent is given a new capability, it starts as a red action until someone classifies it.
- The agent can propose, never approve. The gate raises an error if the approver’s name begins with "agent". In a real system, enforce this in your accounting software’s permissions, not only in code the agent could be edited around.
- Preparer and approver must differ, and the approver’s role limit must cover the amount.
- Every approval is logged with who and in which role.
This is a teaching sample, not a finished product. Real thresholds, roles and vendor data come from your own policy and ERP, and a real deployment needs the audit log kept somewhere the agent cannot edit. Our agent readiness checklist covers those questions in more depth.
Employee data: the part HR cannot skip
HR holds some of the most sensitive data in a company. Under Thailand’s Personal Data Protection Act (PDPA), an employer needs a lawful basis (consent, contract or legal obligation, for example) to collect, use or disclose employee data, and must tell employees what is collected and why. Sensitive categories, such as health information from medical certificates, biometric data from attendance systems, criminal records from background checks and trade union membership, carry stricter conditions: explicit consent is required unless a statutory exception applies, for example obligations under labour protection and social security law.
For an agent project, that means:
- Give the agent only the fields the job needs. A leave-policy assistant does not need medical certificates.
- Check identity before showing personal data, and show a person only their own record.
- Keep sensitive categories out of the agent’s reach unless there is a specific, lawful, documented reason.
- Check where your AI provider processes data and what the contract says about retention and training.
- Ask a Thai lawyer to review consent forms and your AI provider arrangements. This article is general information, not legal advice.
A note on CV screening
If you are tempted to let an agent rank or reject candidates, be careful. In the EU, AI used for recruitment, candidate screening, promotion and termination is classified as high-risk under the AI Act. The high-risk deadline was pushed from August 2026 to 2 December 2027, but commentators stress that the delay is not a repeal, and the classification stands. Even outside the EU, bias and fairness risks are real. A safe first use is to summarise applications for a human, who decides.
A 30-day starter plan
Pick one of two safe starting points: an HR policy assistant, or read-only invoice matching in shadow mode.
| Week | What to do |
|---|---|
| 1 | Choose one process. Write its rules down, name an owner, and collect 20 real examples with the correct outcome. |
| 2 | Write the green, amber and red list. Decide exactly which fields the agent can read. |
| 3 | Run in shadow mode: the agent prepares, people do the work as usual, and you compare. Count disagreements. |
| 4 | Let the agent handle green-level work for one team. Review the log weekly. Add nothing amber until the numbers hold. |
Measure two things: time saved and how often a person had to correct the agent.
Common mistakes
- Letting the agent both prepare and approve. Segregation of duties exists for a reason.
- Trusting a match as proof. Add vendor-master and bank-detail checks.
- Giving broad access to the ERP or HR system "for convenience". Grant read-only on the specific data needed.
- Using real employee records for early testing without approval. Test on masked or synthetic data first.
- No audit trail. If you cannot reconstruct who did what, you cannot defend a decision.
- Quoting a vendor’s saving as a promise. Measure your own process.
Where Simplico fits
We connect agents safely to the systems they would touch: ERP and accounting integrations (including Odoo and ERPNext), single sign-on so each agent and each person has their own account, and security monitoring to log what happens. If you would like a second opinion on a first HR or accounting agent, what it should be allowed to do and how to wire the approval step into your existing system, write to hello@simplico.net with the subject "HR accounting agent" and a short description of the process. We will tell you honestly where we would start, including when the answer is "use the feature your current software already has". This post is educational and promises no particular result.
FAQ
Can an AI agent do our bookkeeping?
It can prepare much of it: extract data, suggest codes, propose matches and flag problems. A qualified person should still review and own the books, and statutory filings stay with people.
Is it safe to let an agent pay invoices?
Not on its own. Let it propose payments, and require a different person, with sufficient authority, to approve. Enforce that in your accounting system.
Should an agent screen CVs?
Treat that as high-risk. Use it to summarise, not to reject, keep a human decision-maker, and test for bias. In the EU such systems fall under the AI Act’s high-risk rules.
Can employees ask the agent about their own pay or leave?
Yes, if the agent verifies identity first and shows only that person’s data, and if you have a lawful basis and a privacy notice covering it.
Do we need to replace our accounting or HR software?
Usually not. Check whether your current software already has agent features, and connect to it through its proper permissions.
What is the first thing to build?
The action policy and the approval gate, before any clever extraction. They are what make the rest safe to switch on.
Sources
- Agentic AI in Accounts Payable: What to Automate, and What a Controller Should Keep Human, ProcureDesk
- Three-Way Matching Automation: Controls, Workflows, and AI Agent Governance, Gravitee
- Security and controls for AI accounts payable automation, Alpesh Nakrani
- Payment Fraud Index (FBI IC3 2025 findings), Eftsure
- Vendor invoice and payment redirection, Scam Atlas
- PDPA Thailand and HR data: Compliance checklist for employers, MiHCM, October 2026
- Thailand’s Personal Data Protection Act: requirements for employers, Tilleke & Gibbins
- AI Act Deadline Extension Confirmed: New Timeline for HR Recruitment Systems, MintHCM
- EU nears approval of agreement to delay rules for AI use in employment decisions, Ogletree
Latest Posts
- simpliMachine: A Used CNC Marketplace Where Every Listing Shows How Far It Has Been Checked December 2, 2026
- Maintenance Software That Speaks Your Plant’s Language: An Idea for a Maintenance System Localized for Each Country, and Why We Want Your Feedback First November 26, 2026
- Security Monitoring for Japanese-Affiliated Plants in Thailand: A One-Site Readiness Assessment November 25, 2026
- Connected Plants, Open Doors: Six Security Problems in Manufacturing, Logistics and OT (and What We Do About Them) November 16, 2026
- Measured, Written Down, Retyped: Six Data Problems in Precision Manufacturing (and How We Fix Them) November 16, 2026
- What Can AI Actually Do in Medical Research? A Reality Check for Thailand and Japan November 15, 2026