AI Systems Portfolio

I build AI systems
Built for Compliance

One live product and five live reference AI apps across finance, healthcare, education and legal, plus an open-source AWS CDK library. Each one has a case study with its architecture, real results and limits.

1
Live Product
5
Live Reference Apps
4
AWS Certifications
7
Case Studies
FinTech AI: SR 26-2 leaves generative AI out of scope, so I applied its practices anyway: model inventory, validation, approval gates and monitoring. EduAI Connect: FERPA, partly built.
Each project README lists: Status | Measured results and how they were measured | Limits | Tests in CI

I'm Johnathan Horner, an AI solutions architect in Brooklyn with 10 years in IT, cloud and AI, including 7 years on AWS. I find where AI pays off, design secure and cost-aware AWS architecture around it, and document it so teams can run it. ShootItPicks is the live product of my company, Shoot It Analytics LLC. The other projects here are independent reference projects built with public or synthetic data, each with its status, measured results and limits in its README.

SAP-C02 SA Professional SAA-C03 SA Associate AIP-C01 GenAI Developer Professional AIF-C01 AI Practitioner
Sports Analytics 21+ · Analytics only
ShootItPicks

A live NFL player-prop research site with paying subscribers: odds from several sportsbooks side by side, the site's own probability next to each price, and an AI chat that answers only from the site's data. It takes no bets and never tells anyone to bet.

Statistical models Market calibration Tool-grounded chat Cross-vendor graders Stripe billing CI/CD
Backtest
Defense adjustment on 47,299 predictions: Brier 0.20097 to 0.20063; shipped on 6 of 7 markets
Chat gate
112-question eval: quality 90%+, every category 75%+, zero hard-rule breaks before any model change
Tests
1,249 backend and 96 frontend tests run in CI on every pull request
Safety
21+, 1-800-GAMBLER, never tells anyone to bet; money-at-risk questions get numbers only
case study

Real-world problem

Americans legally wagered $166.94 billion on sports in 2025, up 11.0% (American Gaming Association). Prop bettors compare prices across several sportsbooks and lean on gut feel or tips nobody checks, and most tools show a number without saying where it came from or how often numbers like it turned out right.

Why I built it

I wanted to run a real product where every probability is logged before kickoff and settled after, and where an AI chat can explain a bet without inventing a number or telling anyone what to bet.

Key decisions

  • Statistical models make the probabilities; the language model only explains. The tradeoff is fewer eye-catching outputs, in exchange for probabilities that can be checked against results.
  • Pull every shown number toward the market. Each probability is pulled toward the book's no-vig price, refit weekly per market and blended with a prior so two noisy weeks can't swing it. Picks look less exciting, and they are more honest.
  • Every number in a chat answer must come from the data. A number check allows one rewrite, then falls back to a plain answer built from the data. Better a dull answer than a confident wrong fact; the eval gate allows at most 2% of answers to fall back.
  • Graders come from a different vendor than the model that answered. A model never grades its own work. Claim and verdict checks use the other vendor's model, and money-at-risk questions fail closed if the grader is down. The cost is extra latency, spend and a dependency on two vendors' rate limits.

Architecture

Board picks come from statistical models. Each probability is calibrated against the market, logged before the game and settled after, and ranking rules keep picks with thin data, long odds or suspect gaps off the featured list with the reason shown. The chat first fetches the data it needs through tools on the server; betting questions then run a five-step chain (player performance, matchup and situation in parallel, then line value, then the answer), and every answer passes number, claim, voice and verdict checks before it is shown with a Sources line underneath.

Governance and safety

  • 21+ and 1-800-GAMBLER across the site and chat; the site never tells anyone to bet, and the free plan gets no verdict.
  • Questions that mention money at risk get a fixed warning written by code, plain numbers only and no lean.
  • Number check on every chat answer, a cross-vendor claim check on paid plans, and a cross-vendor verdict check.
  • Ranking rules keep weak picks unranked (no recent games, low usage, Doubtful, long shot, suspect gap and others), with the reason attached.
  • Every board prediction is logged before kickoff and settled after; one log line per chat answer, with no user ID.
  • Tokens and emails are kept out of logs (tested), sign-up IPs are stored only as a keyed hash, and users can download their data.
  • Not built yet: a hard age check (age is self-attested through the Terms), automated data deletion, and human review before an answer is shown.

Results

  • Defense-vs-position backtest on 47,299 predictions: Brier score 0.20097 to 0.20063 and calibration error 0.0118 to 0.0108. It ships on 6 of 7 markets and is left off rushing yards, where it made things worse.
  • 112-question chat eval across 17 categories gates every model change: quality 90% or better, every category 75% or better, at most 2% fallback answers, zero hard-rule breaks.
  • 1,249 backend tests and 96 frontend tests run in CI on every pull request, plus a phone end-to-end check.

What I got wrong

  • I showed confidence scores nothing backed. Early LLM-generated confidence scores and a calibration layer built on them were deleted. Probabilities now come from statistical models and are settled against results.
  • The raw model was further from results than the books. Settled picks showed it, so shown numbers are now pulled toward the market and refit weekly.
  • I kept risk metrics that said nothing. CVaR, VaR and letter grades were removed because every bet is all-or-nothing; a Monte Carlo simulation stays only as a check on parlay odds.
  • I wired in a data source before checking its license. It was dropped the same day rather than ship a paid feature on it.

Constraints

  • Adults 21 and over only; the site is analytics and never tells anyone to bet.
  • Every number in a chat answer has to come from the site's own data.
  • Paid model calls are metered per user per day, and those counters fail closed.
  • Only data sources whose license allows the use.
  • Every probability is logged before kickoff so it can be settled against the result.

Limits

Projections are somewhat overconfident on narrow ranges, parlay legs are treated as independent, and calibration rests on a few weeks of settled results. It is analytics, not betting advice.

What I'd do in a real deployment

Add a hard age check and automated data deletion, model projection error and same-game correlation, and publish calibration on a full season of settled picks.

Financial Services Model risk practices
FinTech AI

Portfolio analysis assistant over a synthetic fund: three LangGraph agents and a RAG chat, where only model and prompt versions that passed a held-out evaluation may answer, and every answer is graded by a different model and traced.

Amazon Bedrock Claude Haiku 4.5 Google Gemini LangGraph FAISS HyDE Monte Carlo CVaR AWS CDK Streamlit MCP Server CI/CD Model Inventory
Measured
Held-out RAG chat: 23 of 23 passed on Claude Haiku 4.5, exact-fact accuracy 100%
Agents
Held-out sets: market 10/10, risk 9/10, portfolio 10/10, orchestrator 9/10
Risk engine
99% VaR backtest over 254 days in the Basel green zone, Kupiec p-value 0.72 to 0.78
Governance
Approval gate per exact model and prompt hash, independent grader, trace per answer
FinTech AI: Live architecture Live architecture. Tap to enlarge
case study

Real-world problem

SR 26-2 (April 17, 2026) replaced SR 11-7 as the Fed's model risk guidance (Federal Reserve), and footnote 3 of its attachment says generative and agentic AI are not within its scope (SR 26-2 attachment). SR 26-2 leaves generative AI out of scope, so I applied its practices anyway: model inventory, validation, approval gates and monitoring. A team that puts a language model near investment decisions still needs to know which model answered, whether it was validated, and what it said.

Why I built it

I wanted to see whether those controls could live in the code rather than in a policy document: numbers computed before the model sees them, only validated model and prompt versions allowed to answer, and every answer graded and traced.

Version 1

The first version ran the quant math live but mocked every LLM call, and its README showed a "SR 11-7 compliant" badge and performance figures that no code produced. I removed those figures, then rebuilt it so the agents and the chat call real models, every model and prompt version has to pass a held-out evaluation before it may answer, and each answer is graded and traced.

Key decisions

  • An approval gate keyed to the exact model and prompt hash. Each LLM component may call a provider only if the held-out evaluation recorded an approval for that provider, model ID and prompt version hash, and only the evaluation harness writes approvals. Any prompt or model change blocks live use until a new held-out run approves it; meanwhile the app falls back.
  • Code computes every number; the model only explains. Monte Carlo CVaR (10,000 seeded runs), VaR, stress tests and PSI drift are computed first, and the agents are told to use only those numbers. The agents can only discuss what the engine computed.
  • Bedrock first, Gemini as fallback, and a grader that is always a different model. Claude Haiku 4.5 answers through the US cross-Region inference profile, Gemini takes over on any Bedrock error, and fixed templates with no model call are last. The cost is two vendors and two prompt sets to validate, and Gemini is always needed for embeddings.
  • Production stack in CDK, synthesized in CI, not deployed. Bedrock Guardrails, KMS, CloudTrail with 7-year retention, API Gateway and Lambda are defined and checked by cdk synth on every push, with no AWS spend. Those controls are designed, not exercised.

Architecture

FinTech AI: Production design (not deployed) Production design (not deployed). Tap to enlarge

A chat question passes a topic filter, then the RAG chain writes a hypothetical answer (HyDE), searches the committed FAISS index with it and the raw question, re-ranks to the top 4 with a local cross-encoder, and asks the approval gate which provider may answer: Claude Haiku 4.5 on Amazon Bedrock, then Gemini, then fixed templates with no model call. A different model grades the answer, a number check runs, and a trace record is shown under it. The second diagram is the production design in the repo's CDK code, synthesized in CI and not deployed.

Governance and safety

  • Approval gate: only APPROVED or CONDITIONAL records for the exact provider, model ID and prompt hash may answer; approvals are written only by the held-out evaluation harness.
  • Model inventory of 6 models (MRM-001 to MRM-006) with risk tier, lifecycle stage and validation status.
  • Independent grader on every live output (always a different model) plus a check that every number rounds from a source number; marked UNGRADED if no other model is available.
  • A trace record per output: provider, model, prompt versions, index hash, sources, grade, approval status and latency.
  • A topic filter refuses insider-trading and market-manipulation questions, a PII regex redacts every output, live use is capped at 10 requests per session, and every output names the provider and model that answered.
  • Not in the running app: Bedrock Guardrails, KMS and CloudTrail (defined in CDK only), human review, and a durable audit log (traces are kept in memory).

Results

  • Held-out RAG chat (MRM-001), latest run on 2026-11-11: 23 of 23 passed on Claude Haiku 4.5 with 100% exact-fact accuracy, for $0.067 of Bedrock calls; the Gemini fallback also passed 23 of 23. The run before it passed 22 of 23, and on a 23-item set one item is about 4 points, so the change from 22 to 23 on Haiku is within run-to-run variation.
  • Agents on held-out sets with Claude Haiku 4.5: market 10/10, risk 9/10, portfolio 10/10, orchestrator 9/10, all approved.
  • 99% VaR backtest over 254 test days: 2 to 3 exceptions, Kupiec p-value 0.72 to 0.78, Basel green zone.
  • 118 automated tests in CI, plus cdk synth of the production stack.

What I got wrong

  • I published numbers before measuring them. The first README listed performance figures no code produced. I removed them, built a held-out evaluation, and now publish only its results.
  • The model did its own arithmetic. Early orchestrator runs failed when the model computed numbers itself. Now the engine computes every number first and the agents may only use those.
  • One prompt set did not fit two models. With the shared prompts, Claude Haiku 4.5 mislabeled return periods and two agents failed their held-out runs, so each provider now has its own validated prompts.
  • Retrieval could not answer whole-portfolio questions. Each position was its own document, so a question like the largest unrealized loss could not be answered from the top 4 chunks. A ranked P&L document fixed it.

Constraints

  • Synthetic portfolio, prices, macro data and transcripts only.
  • Hosted on the free Streamlit tier, which has no IAM role, so the Bedrock key comes from the host's secret store and the app sleeps when idle.
  • Live AI is capped at 10 requests per browser session, and the Gemini fallback runs on the free tier with its rate limits.
  • No AWS spend on infrastructure: the production stack is synthesized in CI, not deployed.
  • Every model or prompt change has to pass a held-out evaluation before it may answer.

Limits

Synthetic portfolio and market data, small held-out sets (23 chat items, 10 per agent), not reviewed by an independent validation team or a regulator, and not investment advice.

What I'd do in a real deployment

Deploy the CDK stack with the approval gate, RAG and grader inside the Lambda, apply Bedrock Guardrails to every call, keep traces in a durable audit store, use the bank's own market data, and have an independent validation team review it before anyone relies on it.

Healthcare Decision support only
Medical Image Triage

Scores chest X-rays with a small image model, auto-triages the cases it is sure about, sends the rest to a person, and logs every step. A Bedrock LLM writes a short note from the model's output only, never from the image.

PyTorch ResNet18 PneumoniaMNIST Amazon Bedrock Claude Haiku 4.5 SQLite Streamlit Model Card CI/CD Audit Log
Measured
Test split: 92.1% accuracy, 99.5% pneumonia recall, 79.9% specificity
Routing
76.9% auto-triaged at 97.9% accuracy with no missed pneumonia; the rest go to a person
Guardrails
LLM sees six output fields, never the image; template fallback; 10 calls per session
Cost
Trained on a laptop CPU; one live summary: 157 in / 49 out tokens, about $0.0004
Medical Image Triage: Live architecture Live architecture. Tap to enlarge
case study

Real-world problem

Imaging volumes have grown faster than the number of radiologists, and radiologists are leaving practice at over twice the rate of less than 10 years ago (ACR Bulletin, 2026). A triage aid helps only if it knows which cases it can sort on its own, sends the rest to a person, and leaves a record of every decision.

Why I built it

I wanted to see whether a small image model trained on a laptop CPU could split X-rays into a confident lane with no missed pneumonia and a review lane for people, and whether an LLM could add a readable note without ever seeing the image.

Version 1

The first version was a design for a TensorFlow EfficientNetB0 model on a SageMaker endpoint behind API Gateway, Cognito, Lambda and DynamoDB, described as production-grade, while its app ran on mock data. I rebuilt it in October 2026 as a pipeline that actually runs: a small model trained on a laptop CPU on public data, measured on the official test split, with a human review queue and an audit log.

Key decisions

  • Pick the routing threshold on half of the test split and report on the other half. Tuning on half the test set gives honest routing numbers, at the cost of resting them on 312 images.
  • The LLM sees six numbers, never the image. Claude Haiku 4.5 gets the label, probability, confidence, threshold, route and model version and writes two sentences. A fixed template takes over on any error, refusal, missing key or after 10 calls per session. The note adds wording, not information, which is the point: the LLM is not allowed to make clinical claims.
  • A small ResNet18 at 64x64, trained on CPU, with the weights in the repo. The app, tests and CI run with no GPU and no dataset download. The tradeoff is low resolution and pediatric data from one center.
  • An append-only audit log in SQLite. Every prediction and every reviewer decision is a new row, and a case's state is its latest row. It is simple to inspect and test, but it is one file shared by all visitors, with no sign-in.

Architecture

A visitor picks or uploads an X-ray in the Streamlit app. The ResNet18 model scores it, the router compares its confidence with 0.9903 and either auto-triages the case or puts it in the review queue, and each step is written to the audit log. The summary step sends only the six output fields to Claude Haiku 4.5 on Amazon Bedrock through the US cross-Region inference profile, or uses the fixed template.

Governance and safety

  • Confidence gate: anything below 0.9903 confidence goes to a human review queue, where a reviewer confirms or overrides.
  • Append-only audit log of every prediction and review, viewable and downloadable as CSV.
  • The LLM gets six output fields and never the image; its instructions forbid findings, diagnoses and treatment advice.
  • Template fallback on any error or refusal, and a cap of 10 LLM calls per browser session.
  • Every result carries "Decision support only, not a diagnosis"; tokens and estimated cost are logged per call.
  • Secrets come only from the host's secret store, and CI scans the full git history for leaked keys.

Results

  • PneumoniaMNIST test split, 624 images: 92.1% accuracy, 99.5% pneumonia recall, 79.9% specificity, ROC AUC 0.982.
  • Routing, on the half of the test split not used to pick the threshold (312 images): 76.9% auto-triaged at 97.9% accuracy with zero missed pneumonia; 23.1% go to review.
  • Live check on 2026-11-16: one Bedrock summary, 157 input and 49 output tokens, about $0.0004.
  • 23 automated tests in CI.

What I got wrong

  • I documented the target design before the pipeline existed. The first version described a full AWS deployment while the app ran on mock data. The rebuild started from a model I could train and measure.
  • The validation split was too easy. A threshold picked on validation auto-triaged 98% of cases at only 92.8% accuracy on test, so the threshold is now picked on half of the test split and reported on the other half.
  • Old code outlived the rebuild. A compiled file from the first version stayed in the repo after the rebuild, with claims the new code does not make. It was deleted in November 2026.
  • The audit log lives on the free host's disk. It is shared by every visitor and resets when the app restarts, which is fine for a reference app and not for any real use.

Constraints

  • Public research data only (PneumoniaMNIST, CC BY 4.0); never used with patients.
  • Trained on a laptop CPU with no GPU; the 22 MB model file ships in the repo.
  • Hosted on the free Streamlit tier, which has no IAM role, so the Bedrock key comes from the host's secret store.
  • The LLM sees only six output fields and makes at most 10 calls per browser session.
  • Every result is decision support only, not a diagnosis.

Limits

Built on public research data (PneumoniaMNIST: pediatric X-rays from one center at 64x64), never used with patients, not a medical device and not reviewed by a regulator. Specificity is 79.9%, so some normal X-rays get flagged.

What I'd do in a real deployment

Train and validate on full-resolution images from the target hospitals with subgroup checks, run it in the hospital's own AWS account with sign-in, a durable audit store and role-based review, and go through clinical validation and regulatory review before any clinical use.

Education FERPA: partly built
EduAI Connect

Lets a teacher ask plain questions about a class and get an answer from Claude Haiku 4.5 on Bedrock that uses only the student records it retrieved, with those records shown under the answer.

Amazon Bedrock Claude Haiku 4.5 Streamlit LangGraph FAISS FastAPI AWS CDK CI/CD Audit Log
Grounding
Answers only from retrieved records; records shown under every answer; cited IDs checked
Fail closed
No key, cap reached or any error: records only, never a generated guess
Tests
24 automated tests pass in CI, with Bedrock faked so tests make no live calls
Not measured
Accuracy and hallucination rate have not been measured yet
EduAI Connect: Live architecture Live architecture. Tap to enlarge
case study

Real-world problem

About 28% of U.S. students were chronically absent in the 2022-23 school year, meaning they missed at least 10% of school days (U.S. Department of Education). Teachers have the grades, attendance and engagement data that show who is slipping, but it is spread across systems and there is little time to read it.

Why I built it

I wanted to see whether a chat answer about students can be something a teacher can check: built only from the records it retrieved, showing those records, and refusing to guess when something fails. I also wanted to map what a FERPA-aware version would need in the school's own AWS account.

Version 1

The first version described a Canvas-to-Bedrock pipeline (EventBridge, Lambda, KMS-encrypted S3, Titan embeddings, FAISS, Claude 3 Sonnet and Bedrock Guardrails), and the app showed "FERPA Compliant", "Guardrails Active" and "KMS Encryption On" badges that the code did not back. I rebuilt it in October 2026 so the hosted chat really answers from Claude Haiku 4.5 using only the records it retrieved, and the README and app now say what is built and what is not.

Key decisions

  • Two tiers: a light hosted app and a local RAG and agents stack. The hosted chat finds records by keyword and makes one Bedrock call; LangGraph, FAISS and FastAPI stay local. There is no semantic search online, but the hosted app installs in seconds and makes exactly one model call per question.
  • Show the sources and check the citations instead of trusting the answer. Every answer lists the records sent to the model, and any student ID it cites that was not retrieved is flagged. IDs are checked, facts are not, so a teacher still has to read.
  • Fail closed. With no key, the cap reached or any error, the app shows the matching records and says no AI answer was generated. A broken key means no answers at all rather than a made-up one.
  • Small, capped model use. Claude Haiku 4.5 through the US inference profile, 400 output tokens, temperature 0, 10 live calls per browser session and the cost shown per answer. Cheap and predictable, with less depth than a larger model.

Architecture

The teacher's question goes to the grounded chat, which picks matching records by keyword (named students, or the whole class sorted by topic) and sends only those records and the question to Claude Haiku 4.5 on Amazon Bedrock. The answer comes back with the records underneath, a citation check and one audit log line. The repo also has CDK code for a production design (KMS-encrypted S3, an EventBridge-triggered ingestion Lambda, CloudWatch logs) that was never deployed and is not complete.

Governance and safety

  • Answers may use only the retrieved records and must cite record IDs; the records are shown under every answer.
  • A citation check flags any student ID the answer cites that was not retrieved.
  • Fail closed: no key, cap reached or any error shows records only, never generated text.
  • 10 live calls per browser session; credentials only from the host's secret store.
  • One audit log line per answer with the full question and answer text; on the free host it is wiped when the app restarts.
  • The app states it is not FERPA compliant. Built: synthetic data only, the audit log, the session cap. Not built: sign-in, a PII guardrail on each call, CloudTrail, retention rules.

Results

  • 24 automated tests pass in CI, including 13 for the grounded chat run against a fake Bedrock client.
  • Accuracy, false positives and hallucination rate have not been measured; there is no labelled evaluation set yet.

What I got wrong

  • The app showed controls that weren't built. Badges like "FERPA Compliant" came off, and the app and docs now mark each control as built, defined or not built.
  • The full stack could not run on the free host. The RAG and agent modules open Bedrock clients and load FAISS as soon as they are imported, so the hosted app became a separate light tier with one model call per question.
  • The audit log keeps full text. The privacy design asks for no student details in logs, but the chat log stores the full question and answer. It is documented as a gap to fix before any real student data.
  • Accuracy is still unmeasured. There is no labelled evaluation set yet, so I state that instead of quoting a number.

Constraints

  • Synthetic student records only; never used with real students.
  • Hosted on the free Streamlit tier, which cannot load the RAG and agent stack and has no IAM role, so the Bedrock key comes from the host's secret store.
  • One Bedrock call per question and 10 live calls per browser session.
  • When anything fails, the app shows records and no generated text.

Limits

Synthetic data only: 12 student records in the hosted app with preset risk levels. Not FERPA compliant and not reviewed by any school, district or regulator.

What I'd do in a real deployment

Run it in the school's AWS account behind sign-in with role-based access, apply a Bedrock PII guardrail to every call, keep the audit log in encrypted durable storage without full student text, and measure accuracy on a labelled set before a teacher relies on it.

Financial Services Synthetic data
Transaction Anomaly Detection

Scores card transactions against each customer's own history with an Isolation Forest and five plain rules, gives every flag a reason a person can read, and splits flags into a hold lane and an analyst review queue.

scikit-learn Isolation Forest FastMCP SQLite Streamlit MCP Server CI/CD Audit Log
Measured
Later test period: hold lane 95.4% precise; 81.1% of anomalies flagged overall
Design
Model and rules calibrated on validation and combined into one score
MCP
6 read-only tools over the same detector; scoring there never logs or changes state
Data
328,448 synthetic transactions with labelled fraud patterns and hard negatives
Transaction Anomaly Detection: Live architecture Live architecture. Tap to enlarge
case study

Real-world problem

Consumers reported $15.9 billion in fraud losses to the FTC in 2025, up from over $12 billion in 2024 (Federal Trade Commission). Fraud teams work from alert queues where rules are easy to explain but narrow, models catch more but are hard to explain, and both produce more alerts than a team can read.

Why I built it

I wanted to see whether a small, explainable detector could split alerts into a high-precision lane that is safe to act on and a lower-confidence lane for people, with a reason on every alert, measured on a later period it was not tuned on.

Version 1

The first version was a design for Kinesis streaming into a PyTorch autoencoder on SageMaker, with a LangGraph investigation agent on ECS Fargate calling Bedrock and DynamoDB and SQS around it, while the prototype ran on mock data and its MCP tools returned random numbers. I rebuilt it in October 2026 as a detector that runs on a CPU, gives a reason for every flag, and is measured on a later period it was not tuned on.

Key decisions

  • Isolation Forest plus five plain rules, not a supervised model or an LLM. It needs no fraud labels to train, runs on a CPU, and each rule gives a sentence a person can read. Labels are still needed to calibrate and evaluate, and precision at the flag threshold is lower than rules alone.
  • Calibrate both signals and combine them into one score. The model's percentile goes through isotonic calibration and each rule is weighted by its measured precision on validation; the two are combined as 1 - product(1 - p). It adds a calibration step that has to be refit whenever the rules or the model change.
  • Split by time. Train on days 0 to 53, pick thresholds on days 54 to 71, test once on days 72 to 89: the way a detector meets new data in production. Thresholds tuned on an earlier period may not hold as patterns shift, which is exactly what the test period measures.
  • Two thresholds and three lanes, set from operational targets. The flag threshold keeps 80% recall and the hold threshold needs 95% precision. The cost is a review lane that is only 24.5% precise, about 62 alerts a day per 2,000 customers.

Architecture

The Streamlit app builds past-only features from the customer's own history, runs the Isolation Forest and the five rules, and combines them into one calibrated score that routes the transaction to clear, review or hold. Scores and analyst decisions go to an append-only SQLite audit log. A read-only FastMCP server gives an AI assistant the same detector over stdio; it runs locally, is not hosted, and nothing here uses AWS.

Governance and safety

  • Every flag carries a plain-language reason (tested).
  • Review queue where an analyst confirms fraud or marks the transaction legitimate; only those two actions are accepted.
  • Append-only audit log of every score and analyst decision (tested).
  • Features use only earlier transactions, so nothing leaks from the future (tested).
  • The MCP server has 6 read-only tools: its scoring neither logs nor changes customer history.
  • Labelled in the app as decision support for an analyst, not a fraud determination; "hold" is a label and nothing is blocked.

Results

  • Test period (days 72 to 89, 1,318 anomalies): the hold lane is 95.4% precise and catches 60.3% of anomalies.
  • Overall 81.1% of anomalies flagged at 54.8% precision, 13.7 false positives per 1,000 normal transactions.
  • By pattern: impossible travel 100%, card testing 87.5%, velocity bursts 71.7%.
  • 23 automated tests in CI, including all six MCP tools.

What I got wrong

  • The first version's MCP tools returned random numbers. Now they call the same detector as the app.
  • The rules added nothing until they were calibrated. Raw rule hits and the model score lived on different scales; calibrating both on validation and combining them fixed it.
  • MCP scoring changed customer history. Scoring through the MCP server used to add transactions to the shared history; it no longer logs or remembers anything.
  • Synthetic data flatters some rules. The night rule is 98.8% precise on validation because synthetic customers never shop between 1 and 5 am, which real customers do.

Constraints

  • Synthetic data only (328,448 generated transactions); no real customers or card data.
  • Runs on a CPU, with no network calls at runtime; the detector and recent history are committed.
  • Every flag has to carry a reason an analyst can read.
  • Thresholds are chosen on the validation period only, and the test period is used once.

Limits

Synthetic data only; the night rule is flattered because synthetic customers never shop between 1 and 5 am. Not a fraud decision system and not reviewed by a regulator.

What I'd do in a real deployment

Train and calibrate on the bank's own labelled history, feed analyst decisions back as labels, add merchant-level features and drift monitoring, and get model risk review before any automated hold.

Open Source TypeScript
cdk-ai-constructs

TypeScript AWS CDK library with 9 constructs for AI workloads: Bedrock access scoped to one model, SageMaker serverless endpoints, multi-tenant Cognito auth, audited S3 storage, event pipelines, model cards, Streamlit on Fargate and Stripe billing.

AWS CDK TypeScript Amazon Bedrock SageMaker Cognito CloudTrail Jest CI
Measured
147 Jest tests and 8 Python handler tests pass; all 9 constructs synthesize
Defaults
Permissions scoped to one model, endpoint or object; tenant ID only from the signed token
Package
2.0.0 on npm; the packed build imports from a clean project with all 9 constructs
Limit
Tested by synthesis only; not deployed to a live AWS account
cdk-ai-constructs: 9 constructs and what each deploys 9 constructs and what each deploys. Tap to enlarge
case study

Real-world problem

The AWS CDK guide describes constructs as the basic building blocks of CDK applications, each one representing one or more CloudFormation resources and their configuration (AWS CDK constructs guide). Teams putting AI on AWS rebuild the same pieces for every project (model access, tenant isolation, audit storage, model documentation), and the details are easy to get wrong, like a Bedrock policy with a wildcard or a tenant ID read from the request body.

Why I built it

I wanted a small set of constructs that carry those guardrails by default, each checked by an automated test before anything is deployed.

Key decisions

  • Grant on the caller's role instead of creating new roles. Each construct takes your Lambda function and grants on its role, so the permission reaches the code that calls Bedrock. The construct needs a function passed in.
  • Scope every permission to exactly one model, endpoint or object. No anthropic.* wildcard, and the model data URL must be a literal s3:// path. Switching models means a redeploy.
  • Fail at synth time on invalid input. Bad props stop the synth with a clear error, so mistakes show up in tests instead of in a half-deployed stack. The props are stricter as a result.
  • Inline Python handlers, tested with fakes. No build step or asset bundling. Handlers must stay under 4,096 characters (a test enforces it), and the Stripe SDK comes from a layer you supply.

Architecture

A stack built from the library puts API Gateway, a load balancer and Cognito at the edge, with the Stripe billing functions, Streamlit on Fargate and a sign-up trigger behind them. Your own Lambda functions get scoped grants to Bedrock, a SageMaker serverless endpoint, the model registry and a KMS-encrypted bucket, while CloudTrail records object-level events and CloudWatch alarms watch for errors. Nothing here is deployed; the diagram is what the constructs synthesize.

Governance and safety

  • Least privilege by default: Bedrock access scoped to one model or inference profile, InvokeEndpoint to one endpoint.
  • Tenant isolation: the tenant ID comes only from the signed token, the app client can't write tenant, tier or plan attributes, and sign-up never overwrites an existing tenant.
  • Stripe webhooks are signature-checked and checkout accepts only allow-listed price IDs.
  • CloudTrail data-event trails with log file validation; SSE-KMS with key rotation and TLS-only bucket policies.
  • The compliance modes set retention periods and tags only; they do not make a stack compliant.
  • CI scans the full git history for secrets.

Results

  • 147 Jest tests in 11 suites and 8 Python tests of the generated handlers pass (run on 2026-11-16).
  • All 9 constructs synthesize, and the packed 2.0.0 imports from a clean project with all 9 exported. 2.0.0 is published on npm.
  • Typecheck and lint pass in CI.

What I got wrong

  • Version 1.0.0 shipped broken. The published 1.0.0 could not be imported. A verify step now packs the library and imports it from a clean project before any release, and 1.0.0 is deprecated on npm.
  • It created roles nothing used. 1.0.0 made its own IAM role; the constructs now grant on the role of the function you pass in.
  • A Bedrock policy was broader than it needed to be. Permissions are now scoped to one model or inference profile, with no wildcard.
  • Model cards were written as generated code. The model card construct now passes user text as data through a custom resource instead.

Constraints

  • No AWS spend: every construct is tested by synthesis, not by deployment.
  • TypeScript only, no jsii builds yet.
  • Inline Lambda handlers have to stay under 4,096 characters.
  • Constructs grant on the functions you pass in rather than owning their own roles.

Limits

Tested by synthesis only and never deployed to a live account, and no project imports it yet.

What I'd do in a real deployment

Deploy each construct to a sandbox account with integration tests, add jsii builds for Python users, and adopt it in one of the other projects.

Writing & Thought Leadership

Published on LinkedIn

Why FinTech AI Needs SR 11-7 Governance

Bringing Federal Reserve model risk management discipline to hedge fund AI from day one: independent validation, continuous monitoring, documented limitations.

Read on LinkedIn →

Model Risk Management with Monte Carlo Methods

How MRM, CVaR, and Monte Carlo simulation work together to govern AI systems that influence capital allocation decisions.

Read on LinkedIn →

Get in touch

If you are working on AI in a regulated setting and want to compare notes, I'd like to hear from you.

Email LinkedIn