← Back to library

Make an investing agent cite where each number came from

u/Optimal_Operation836's hobby investing agent reads annual reports and computes adjusted earnings, returns on capital, owner earnings, plus an approximate reverse DCF. Reasoning is easy; data is not. Raw SEC XBRL tags vary by firm, data APIs hide provenance, and the agent builds confident theses on bad inputs. The author also finds their backtests look suspiciously strong.

  • OutcomeFeed a filings agent numbers with their source attached and have it flag figures it cannot trace, before it writes any thesis.
  • SetupAn afternoon+
  • LevelAdvanced
  • Creditu/Optimal_Operation836 on r/ValueInvesting
View original
Works with
Custom agent

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • You build stock research agents
  • You mix filings and API data
  • Your backtests look too good

Not for: Trading signals you act on blindly; Anyone without time to check sources

What do you need, and what do you get?

You need

  • Filings or XBRL data
  • Data API
  • List of metrics

You get

  • Metrics with sources
  • List of untraced figures
  • Notes on point-in-time data

How does it work, step by step?

  1. Attach sourcesStore each figure with its filing, page or API field.
  2. Flag gapsHave the agent mark any number without a source as unverified.
  3. Check footnotesPull leases, stock pay and segment margins from notes, with page cites.
  4. Use point-in-time dataBacktest only with figures as first reported.
  5. Write lastAllow a thesis only after the data check passes.

The prompt

Our own prompt, inspired by u/Optimal_Operation836 on r/ValueInvesting and written to work in Custom agent. Values in lime are placeholders.

Fill in the blanks (optional; the copied prompt uses your values)

Prompt3 variables
For {ticker}, compute {metrics} from {data_sources}.
For every figure, record the filing, page or API field it came from. Mark any figure you cannot trace as UNVERIFIED and exclude it from conclusions.
List footnote items that matter, such as leases or stock-based pay, with page references. Write a short summary only after the source table is complete.

Inspired by u/Optimal_Operation836 on r/ValueInvesting: Anyone building a value investing agent? what are you using for data. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • APIs can restate history; old figures may not match what investors saw then.
  • Custom XBRL tags break naive parsers.
  • An agent will reason confidently over wrong inputs.

Our take

This post names the real failure mode of finance agents: they do not hesitate when the input is wrong. Models write confident theses on whatever numbers they are given, so the fix is boring provenance work. Carry the source filing, page or API field with every figure, make untraced numbers visibly second class, and refuse to write a valuation on them. Read footnotes yourself for one-time items, restatements and non-GAAP adjustments that automated tags miss. For backtests, insist on point-in-time figures as first reported; restated history quietly makes strategies look better than an investor could have traded. Treat every output as research for your own decision, never as advice, and never let the agent place trades. Cross-check key numbers against the PDF of the 10-K, not only against a data vendor's feed. If a backtest looks too good, assume a leak or a look-ahead bias until you prove otherwise. Keep position sizing and risk limits entirely human.

Where the time goes back: You catch bad inputs before they become a confident memo.

FAQ

Why are his backtests suspect?
He suspects restated data leaking into the past.
Where is the hard part?
Getting clean, traceable data, not the reasoning.

Source and credit

Inspired by u/Optimal_Operation836 on r/ValueInvesting. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
Anyone building a value investing agent? what are you using for data
Creator
u/Optimal_Operation836 on r/ValueInvesting
Published on
Reddit
Original date
Oct 13, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Custom agent
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends, bookings or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Money & Admin

All 82 Money & Admin playbooks →

Related playbooks

Money & AdminWorkflow✓ AI dry run

Add a scribbled appointment slip to your calendar

Snap a handwritten appointment card or note, and have a small agent read it, add a calendar event and file any matching PDF from email into your document archive.

Credit: pimeys on Hacker News

An afternoon+
Money & AdminWorkflow✓ AI dry run

Browse, research tickers and refresh your watchlist

Do stock research without the tab-juggling by letting an AI browser read commentary, pull Reddit discussion and update your watchlist sheet in place.

Credit: RhinoInsight

Minutes
Money & AdminWorkflow✓ AI dry run

Compare your tax return to the IRS transcript

Have an assistant line up your filed return against the IRS record of your income forms to catch missing 1099s before a notice arrives.

Credit: Mark Riggins (@Ojenta)

Under an hour
Money & AdminWorkflow✓ AI dry run

Give a personal agent a limited card and a secrets vault

When an agent shops for you, give it a low-limit virtual card and machine secrets from a password manager, never your main card or passwords in chat.

Credit: Frannky on Hacker News

Under an hour