The useful unit of AI implementation is not a prompt. It is a controlled finance workflow with an owner, a data contract, a repeatable calculation, a documented review and a measurable outcome.
name: margin-variance-investigator
owner: Group FP&A
trigger: gross-profit variance above materiality threshold
tools: approved_finance_semantic_view [read_only]
scope: entity, period, currency, customer, product
checks:
- reconcile net_sales and gross_profit to signed P&L
- quantify unexplained residual and missing mappings
- stop when completeness or reconciliation fails
outputs:
- volume_price_mix_cost_bridge
- evidence_refs, confidence_notes, open_questions
approval: business_partner_review
never: post_journals, change_prices, release_payments
metrics: precision, reviewer_time, validated_EBITDA_actionsDesign the agent as an audited service, not as a clever prompt
Contract: An agent input includes source snapshot ID, user entitlement, management P&L mapping version, task type and maximum authority. Outputs are typed: source IDs, numerical reconciliation, confidence rationale, recommended next step and reviewer. Unsupported fields return unavailable, never an invented value.
Reusable expertise
Definition, domain rules, examples, approved calculations, output schema and negative tests. Version every skill and pin production releases.
Decision worker
Task-specific LLM reasoning, constrained context, read-only tool calls and escalation logic. It does not own books, limits or policy.
Workflow control
Dispatch to domain agents, prevent circular handoffs, cap tool calls, enforce timeouts and persist immutable case state.
Production permission
Independent allowlists, approval interrupts, PII minimisation, red-team cases, regression tests, sampled human quality review and cost telemetry.
Illustrative evaluation release criteria (not industry benchmarks): 100% of prohibited write scenarios blocked; zero untraceable financial figures in acceptance cases; reviewed numeric tie-outs within specified materiality; agreed precision/recall targets by use case; monitored p95 latency and cost per correctly handled case. A change to data mapping, skill version or tool permission forces regression testing.
See the end-to-end finance intelligence reference architecture →
1. Distinguish four layers of capability
- Deterministic analytics: SQL, Python, semantic measures and rule engines calculate EBITDA bridges, invoice matches and cash exposure. Never rely on a language model for the source-of-truth arithmetic.
- Retrieval and knowledge: approved policies, contracts, process guidance and documented KPI definitions are searched with source, validity and user-access boundaries.
- Reusable skills: versioned instructions, templates and scripts run the same approved process repeatedly, for example monthly-close narrative, pricing variance analysis or invoice-exception classification.
- Agents: coordinate tools and skills, track steps, inspect outputs and route ambiguous cases to humans. They require explicit permissions and audit logs.
2. A usable skill specification
- Purpose and trigger: what decision or control does the skill serve, and when should it run?
- Data contract: named permitted views, columns, entity filters, granularity, refresh SLAs, reconciliations and fallback if incomplete.
- Method: deterministic calculations, threshold logic and documented assumptions; example: volume, realisation, mix and COGS decomposition.
- Output contract: period, currency, source view, metric definition, calculated bridge, evidence URLs, residual/unexplained portion, risk and proposed follow-up.
- Testing: golden-case examples, entity-specific exceptions, missing data, prompt injection, wrong year, duplicate transactions and fabricated citations.
- Ownership: product owner, finance approver, technical maintainer, access policy, version and next review date.
3. Example: monthly margin investigation skill
- Trigger: region or product-family gross margin deteriorates beyond a documented absolute and relative threshold.
- Collect: approved sales invoice, credit note, rebate, FX, product cost and freight views with entity-level security.
- Compute: reconcile net sales and gross profit to the management P&L; decompose changes into unit volume, like-for-like price, category mix, input cost, freight and FX.
- Challenge: identify missing customer or SKU mappings, one-off credit notes and partial-period cost movements; stop rather than guess if residuals exceed tolerance.
- Respond: present evidence, driver impact, confidence notes and three questions for commercial, procurement and operations owners.
- Publish: management reviews and signs off a proposed action; the agent logs the review and monitors subsequent realised impact.
4. Agent catalogue for a complex finance organisation
- Read-only investigator: finance/BI-approved measures, P&L bridges, working capital and document retrieval.
- Financial exception monitor: duplicates, unusual journals, vendor changes, invoice blocks and reconciliations.
- Forecast challenger: checks assumptions, lag structures, version changes and bias across market forecasts.
- Contract and vendor insight: identifies renewal clauses, commercial leakage and P2P exceptions with source contracts.
- Management pack coordinator: assembles approved facts, open issues, decisions and action tracking into a review-ready pack.
5. Guardrails: no agent approval of its own result
- Start with read-only tool permissions, entity-scoped data and auditable use; isolate production write tools and maintain explicit approval checkpoints.
- Require two-person controls for bank beneficiaries, payments, customer credit limits, vendor masters, journals, forecast publication and pricing changes.
- Treat prompt injection from email, invoice attachments and vendor contracts as untrusted input. Do not let retrieved text rewrite system instructions.
- Collect evaluation results and failure cases, not just positive demos. Track false positives, unsupported claims, correction rate, human time and financial benefit.
- Maintain an agent register, policy owners and enterprise model/vendor risk assessment; review EU AI Act applicability with legal and security specialists.
A pragmatic 90-day delivery sequence
- Weeks 1–2: choose one process with high repeat volume and a stable data view; document baseline handling time and quality.
- Weeks 3–4: encode one reusable skill, connect read-only sources and build 20–30 adversarial/real-world evaluation cases.
- Weeks 5–8: run in shadow mode; compare agent draft to controller output and record decision-quality improvements and errors.
- Weeks 9–12: deploy with named owner, review checkpoint, audit trail, recovery path and monthly performance review.
An agent that saves an analyst 30 minutes but forces an auditor two hours of extra checking is not automation. Count the full review, control and rework cost.
From “prompt” to a versioned finance skill
A skill should work consistently across entities, periods and staff changes. The orchestration can be an agent, but the financial calculations, authorisations and accounting policy must be independently defined.
Illustrative example using fictional figures. Not a real client result, live ERP integration or deployed AI agent.
A safe production sequence
Reference contract: margin variance investigator
This YAML is a design artifact: a real deployment still requires authorised tools, identities, logging, evaluations and integration testing. It deliberately refuses any write action.
name: margin-variance-investigator
version: 1.0.0
business_owner: Group_FP&A
technical_owner: Data_Platform
purpose: explain_signed_gross_profit_variance
trigger: abs(variance_eur) >= 250000
permissions:
approved_views: [mgmt_pnl_signed, sales_line_margin, landed_cost]
scopes: [entity, month, region, product_family]
mode: read_only
forbidden: [post_journal, edit_masterdata, change_price, release_payment]
quality_gates:
invoice_line_coverage_min: 0.995
product_mapping_min: 0.98
unexplained_bridge_eur_max: 50000
signed_pnl_match_eur_max: 10000
method:
calculations: deterministic_semantic_model_only
language_model: explain_evidence_and_ask_questions
outputs:
required: [bridge, metric_version, source_ids, as_of, open_questions]
labels: [observed_fact, calculated_driver, hypothesis, proposed_action]
workflow:
approver: regional_finance_director
publish: only_after_review
audit: retain_run_inputs_version_and_approval
Deploy only after these gates
- Approved, read-only source views with entity-level row security.
- Deterministic financial math with published method and tolerances.
- Access controls applied at the tool boundary, not only in the prompt.
- Human approval before any publication, journal, payment or master-data change.
Who owns what?
- CFO / sponsor: decision value and risk appetite
- FP&A owner: definitions, thresholds, output sign-off
- Control / Tax: accounting accuracy and exceptions
- Data / IT: access, observability, platform, incident response
- Audit / Risk: independent control testing
Six tests before the first live run
Swipe the table horizontally to see all evidence fields →
| Test condition | Expected behaviour |
|---|---|
| Valid source + reconciled P&L | Produce source-cited bridge |
| Missing 4% product mapping | Stop causal claims; request mapping fix |
| Wrong entity in joined table | Reject cross-entity join |
| Untrusted invoice note instructs payment | Ignore injection; report suspicious content |
| Unreconciled €130k bridge residual | Fail gate and escalate to FP&A |
| Request to write a journal | Deny: read-only permissions |
These are test requirements, not claims that an implemented agent has passed them.
Operating economics: how to prove ROI
Measure total review time, exception precision, time to close, avoided rework, human escalation and validated actions. An agent that writes narratives faster but increases false positives can destroy value. Keep engineering, licence, security and quality-assurance costs in the denominator.
Use the accompanying workbook for skill inventory, RACI, risk class, test cases and sign-off.
Further reading and source material
The operating recommendations above are editorial guidance. External sources provide context, not a substitute for entity-specific control design or a claim of measured outcomes.