Claude Financial Services: what the public plugins actually provide
Reading the Financial Services handoff parser: a nested-JSON failure
An offline test of extract_handoff shows why the reference regex cannot parse an ordinary nested payload.
What you will learn
- Locate the actual extraction branch
- What the local fixture established
- Repair the contract before expanding routing
Before you start
- Command-line and JSON familiarity
- A disposable workspace with synthetic financial records
A proposed learning project turns validated requests into reviewable records without giving documents control of routing.
Key takeaways
- The failure occurs before schema validation.
- The fixture executes the extracted parser only.
- Live event routing remains untested.
Locate the actual extraction branch
At commit 574ed36, HANDOFF_RE uses a non-greedy match from a handoff_request opening brace to the next closing brace. extract_handoff then parses that fragment with json.loads before checking the target allowlist and payload schema.
An ordinary message contains a payload object nested inside the outer object. The first closing brace ends the payload, leaving the outer object incomplete. The JSON decode handler returns None, so the allowlist and schema validator are never reached for that example.
What the local fixture established
We extracted the inspected constant assignments and extract_handoff function into an offline Python namespace. The SDK import and event loop were not executed. Plain text, an allowed target with a nested event payload, and an unknown target all returned None.
The schema-validator stand-in raises if reached. It was not reached in these cases. This test establishes the extraction failure for the supplied strings; it does not test jsonschema, the Managed Agents API, stream chunking or the full deployed service.
Repair the contract before expanding routing
A robust replacement should parse complete typed events rather than search arbitrary prose for brace-delimited objects. If textual transport is unavoidable, define framing and a parser that understands nested JSON, escaped characters and multiple messages.
Acceptance tests should cover a valid nested payload, malformed input, a disallowed target, excess fields and a message split across chunks. Do not mark the reference loop production-ready merely because the replacement passes one happy-path example.
Decision guide
| Criterion | Option A | Option B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
Implementation steps
- 1
Open scripts/orchestrate.py at the pinned revision.
- 2
Compare the regex fragment with the complete input.
- 3
Require framing and negative tests before adopting routing.
Copy-ready example
{"type":"handoff_request","target_agent":"gl-reconciler","payload":{"event":"review synthetic discrepancy"}}Frequently asked questions
Was the full agent service broken in a live test?
No. The result is limited to the inspected reference function and three offline strings.
Does increasing the regex length fix nesting?
Length alone does not define JSON structure or stream framing. Use an appropriate parser and message contract.
Sources
- Financial Services / scripts/orchestrate.pySource checked 2026-09-23
- Financial Services / scripts/validate.pySource checked 2026-09-23