Repository navigation
feat(finance): add a KYC agent for the analyst's questions and the regulator's letter - #29
Merged
Merged
Conversation
…gulator's letter agent.py runs two jobs the workflow can't. In the first, the analyst asks about a customer who moved and has no bill at the new address; the agent answers from the handbook and the workflow's own check, and code fails any answer that hides where the two disagree. In the second, the regulator asks for every 2025 account opened on a mobile phone bill and what was done about each; the workflow checks each file, and code reads every 2025 address scan itself to check the agent found every account. The conversation came out as expected on 5 of 5 runs, the letter on 2 of 5. The agent never found k25-011 on its own; the completeness check sent it back every time. recipe.py gains one unused text field; its results are unchanged. The README also records a kyc-06 run where the models failed differently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The post isn't published yet, so its links returned 404, and its claims will change in the blog update. The README now links the root README's test and states each point on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- check_disagreement: once the latest KYC check shows address_document missing, any answer or email that talks about the address document (its id, its declared type, "proof of address", or a counts word, negated or not) must carry section 4.2, the sign-off and the workflow claim. Reads the email too. - Waivers: an analyst quote from a negated or question sentence signs nothing off. - Tools reach only the job's records: job a kyc-13, job b the cases of accounts opened in 2025. Anything else is a ToolError. - md_safe escapes text from documents, tools and Claude in the .md outputs; answers, emails and the summary go in fenced blocks longer than any backtick run inside. - Section numbers match on word boundaries; read_handbook and citations accept "Section 4.2" and "§4.2". - nothing_recorded fails beside a note recording an approved exception; exception_approved fails when a later document met every address requirement, or no KYC check ruled that out. - Claude API errors: connection, timeout, rate limit, 5xx, 408 and 409 end the job with no_answer and the reason; any other stops the run with its own message first. Tokens are counted per answering model and priced only where rules.yaml lists that model. - Verdict line opens "**Verdict:** Miss." README numbers from 5 new live runs: 9 of 10 (5 of 5 conversations, 4 of 5 letters). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
Self-reviewTwo review passes ran on this PR. One read the code: correctness, silent failures, tests and comments. The other covered security and checked the README against the code. Every finding below was fixed in 0a08207. Each fix has a selfcheck case that fails if the fix is undone. Important (3, all fixed)
Suggestions (all fixed)
Reruns after the fixes (5 live runs per job)9 of 10 came out as expected, up from 7 of 10.
|
rparundekar
force-pushed
the
feat/agent-kyc
branch
from
November 11, 2026 03:00
8a747ba to
b1ee2c5
Compare
rparundekar
marked this pull request as ready for review
November 11, 2026 03:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds
agent.pybeside the KYC workflow for the two odd jobs in the workflow-vs-agent guide.Live results (5 runs each, using SIE Serverless, 10 Nov 2026)
k25-011: the agent never found it on its own. The completeness check sent it back every time. The README draws the conclusion: the "find" half of the letter is a workflow, and the agent earns its cost on "what was done about each".recipe.pygains one unused text field, and its results are unchanged. The README also records akyc-06run where the models failed in a different way from before.Depends on the docs PR for the AGENTS.md layout and the CI step.
🤖 Generated with Claude Code