AI agent audit prototype · Built on Stockurai

FX buying ahead of supplier invoices

Prepared for Jane Doe · Distribution · December 3, 2026

Sample data for illustration.
DecisionWhen to buy euros, yen and pesos before each supplier invoice is due
OptionsBuy · Wait · Sell
Data sourcesCurrency price feed, ERP payables export, Bank FX rate quotes
PolicyMax 25% of an invoice per purchase, never over 100% covered, treasurer approves
Deploying an AI agent for a decision like this? Request a formal proposal, or describe the agent’s decision to create a custom AI agent audit prototype.
STEP 01

Targets

Targets are what the system watches. Here, they are the currencies owed to suppliers, with open invoices, next due date and share already bought from the ERP.
TargetOpen invoicesNext dueCoveredStatus
EUR/USD€1,450,000Dec 10, 202614%Active
USD/JPY¥96,000,000Jan 4, 20270%Active
USD/MXNMX$7,200,000Nov 30, 202655%Active
STEP 02

Target detail

Where the feeds meet: the market (what the rate is doing), the bank's quotes and the payables (what is owed, and by when). Every signal is weighed against all three.

EUR/USD rate history (7 days)

DateOpenHighLowClose
Nov 191.08511.08601.08091.0824
Nov 181.08721.08801.08381.0850
Nov 171.08901.09011.08611.0873
Nov 161.08841.09071.08701.0891
Nov 131.08691.08951.08581.0885
Nov 121.08551.08801.08401.0868
Nov 111.08711.08891.08461.0857

Invoice schedule

Dec 10€800,000 · 25% covered
Dec 22€650,000 · open
Bank quote1.0869 (market 1.0824)
Rate at invoice1.0891 (Nov 16)
Feeds
MarketEUR, JPY and MXN rates against USD · Every minute
PayablesAmounts owed by currency, invoice and due date · Daily
Bank ratesRates the bank would actually offer · Hourly
STEP 03

Alerts: what the system watches for

Alerts are code-free. Pick a field, an operator and a value. Each alert watches one thing, such as a rate against the bank's quote or an invoice due date, and fires when it happens.

Edit alert

EUR/USD 1% below 30-day average
Market rate
Below
30-day average less 1%
1 Hour
PreviewMarket rate below 30-day average less 1%

Configured alerts

Rate at 20-day lowMarket
Rate 1% below 30-day averageBank rates
Invoice due within 30 daysPayables
Coverage below 50%Payables
Over 100% coveredPayables
Bank spread above 1%Bank rates
STEP 04

Decision logic: alerts, conditions, plays and rules

Alerts evaluate data in real time. Conditions add triggered alerts up to a score, and plays organize the conditions. Rules turn a play’s score into a real-time recommendation on the live feed. The policy gate caps each Buy at 25% of an invoice and stops any purchase that would leave an invoice over 100% covered, however good the rate looks. Rules drive the recommendations, not AI.

Play: Buy currency on weakness before invoices are due

+15Rate is cheap
  • Rate at 20-day low
  • Rate 1% below 30-day average
+10Invoice is coming
  • Invoice due within 30 days
+5Under-covered
  • Coverage below 50%

Rules

Score ≥ 25BUY
Score below 25WAIT
Covered above 100% of openSELL

Policy gate

Max per purchase25% of an invoice
Never above100% covered
ApprovalTreasurer
STEP 05

Live feed

This is the screen the decision team watches. Each card is a recommendation on one currency, printed the moment its rule is met, with the score and time it fired, ready for the treasurer to approve.

Buy (1)

EUR/USD  Rate 1.0824 · Score 30
Buy €200,000 toward Dec 10 invoice
11/19 09:32 AM

Sell (1)

USD/MXN  Rate 17.35 · Score 10
Sell MX$300,000 surplus (credit note)
11/19 10:48 AM

Wait (1)

USD/JPY  Rate 150.4 · Score 5
Mid-range; due Jan 4, nothing covered yet
11/19 08:15 AM
STEP 06

Audit trail: one recommendation, start to finish

Every recommendation is logged and traceable. Anyone can see which rates and invoices arrived, which conditions were met, when the treasurer approved the purchase and how it compared with the invoice-day rate.
EUR/USD — Audit trail

Data received

Market feed1.0824 at 2026-11-19 09:32
Bank rates feedBank quote 1.0869
Payables feed€800,000 due Dec 10, 25% covered

Play evaluated → rule fired

✓ Rate is cheap (+15)
✓ Invoice is coming (+10)
✓ Under-covered (+5)
Score30 → BUY
Policy gatePassed: 25% of invoice, coverage stays under 100%

Decision

ActionBought €200,000 at 1.0824
Approved byTreasurer, 09:47

Outcome

Rate when invoice arrived1.0891 (Nov 16)
Result$1,340 better than the invoice-day rate (mid-market)
STEP 07

Daily flags

A short daily list of things worth a look, separate from the live feed. Invoices coming due with little cover, big currency moves, and bank quotes drifting away from the market.
PayablesMX$7.2M open, Nov 30 invoice due in 11 days
Coverage 55%; policy target is 50% at 30 days
MarketYen moved 2.3% in 5 days
Usual 5-day move is ±0.9%
Bank ratesBank EUR spread widened to 0.42%
Usual spread is 0.15%
PayablesCredit note cut peso invoices by MX$300,000
Nov 30 invoice now over 100% covered: Sell rule armed
STEP 08

ROI scoring and baseline

The optimization engine scores every decision. Every recommendation is measured against converting on the day each invoice arrived, and against the best rate available before it was due. The gap is the ROI you can measure.
TargetDecisionsAvg rateBaselineBest possibleCapturedResult vs baseline
EUR/USD121.08381.08811.079550%+$9,800
USD/JPY7150.9149.8152.442%+$6,300
USD/MXN917.5217.4117.7830%+$3,150

Baseline: Rate on the day each invoice arrived. Best possible: Best rate before it was due. Sample figures; in a live installation, these come from the organization’s own decisions and data.

STEP 09

AI Agent Decision Data

The agent is one more feed. Stockurai doesn’t call or run the agent. It records every output and scores it against the rules, the decision makers and the outcome, in shadow: flags never block anything.
RecommendsTreasury assistant agent

Reads rates and open invoices each morning and recommends Buy, Wait or Sell for each currency, with a short reason.

When it acts: Before the treasurer approves; the treasury analyst sees the agent's recommendation beside the rules' call.

Recommendation:BuyWaitSell
Agrees with rules85%
Agrees with decision makers81%
Policy breaches flagged2
Disagreements graded11

Agent feed: sample records

TimeTargetRecommendationModelAgent’s reason
11/19 09:31 AMEUR/USDBuyv2.4Rate near its 20-day low; Dec 15 invoice under 50% covered
11/19 10:47 AMUSD/MXNSellv2.4Coverage above 100% after the credit note
11/19 11:05 AMUSD/JPYBuyv2.4Yen weakening; Jan 10 invoice not yet covered
11/20 09:02 AMEUR/USDBuyv2.4Buy 40% of the Jan 5 invoice while the rate is low

Policy breaches flagged

EUR/USD · Buy
More than 25% of an invoice in one purchase (agent proposed 40%)
11/20 09:02 AM · Flagged; treasurer bought 25%
USD/MXN · Buy
Purchase would take coverage over 100%
11/13 02:20 PM · Flagged; not acted on

Checked against the policy gate the moment each output arrives.

Agent's call against the rules' call, last 30 days

AgentBuyWaitSell
Buy1860
Wait3411
Sell014

Rows are the agent's call, columns the rules' call. Most disagreements are the agent buying early on a trending rate, before the 20-day-low rule fires. Shaded cells are agreement.

Disagreements, graded on the outcome

TargetAgentRulesDecision makersWhat followedBetter call
USD/JPYBuyWaitWaitYen fell another 0.9% before the rules boughtAgent
EUR/USDWaitBuyBuyRate rose 0.4% the following weekRules
USD/MXNBuyWaitBuyPeso flat; buying early gained nothingTie

Drift

PeriodModelAgreement
Augv2.283%
Sepv2.3new86%
Octv2.387%
Novv2.4new85%

Agreement slipped after the v2.4 update as the agent began buying earlier on trending rates. Outcome grading shows whether that is paying off.

Where scoring is limited. Each currency's rate is visible whichever call was taken, so every disagreement can be scored against the rate that followed. The audit produces scoring and evidence; it doesn’t certify the agent.
STEP 10

Fit and next steps

What we’d check first

Why
  • Live rates, firm invoice due dates and the same buying decision repeated for every invoice
To verify
  • How often the ERP payables can be exported
  • Whether bank FX quotes are available as a feed
  • How credit notes and part payments appear
Extend with AI
  • Cash forecasts, more currencies and new rules

Next step: a formal proposal

ScopeThe decision, targets and data feeds
RulesRules and policy gate, written out
ROIHow ROI is measured against the current process
TermsSetup estimate, timeline and license terms
Where it runsThe organization’s own AWS account
Request a formal proposal Create a custom AI agent audit prototype

For IT and data teams: an AI data pipeline

Stockurai is licensed to researchers and institutions for real-time analysis of equity markets, with AI and machine learning built into the process. The same AI data pipeline can be built for this decision.

Design prototype prepared by Stockurai · Sample data for illustration only · stockurai.com