Integration prompt
One master prompt. Your coding agent interviews you, recommends the right Toden setup, then builds and proves it.
Paste the prompt into Claude Code, Cursor or any coding agent that can read your repository and fetch web pages. You do not fill anything in first. The agent works in six stages and stops for you twice:
- Inspect your codebase, so it does not ask what it can read.
- Interview you about your business, customers and obligations.
- Recommend the Toden products and integration route that fit, with reasons.
- Plan, and wait for your approval.
- Build in Sandbox.
- Prove it with tests, and hand over what is left for a person to do.
The prompt is an aid, not a guarantee. Review what the agent builds, and keep a person responsible for anything that reaches real customers. The agent cannot judge your legal obligations: confirm those with your compliance lead.
You are the lead engineer integrating Toden into this codebase. Toden istrust infrastructure: User Verification (KYC), Business Verification (KYB)and Risk Intelligence (screening, transaction and activity decisions,monitoring, wallet screening, Travel Rule).Work through the six stages below in order. Do not skip a stage. Do not writeintegration code before I approve the plan in stage 4.## Ground rules for the whole job- Never guess. Every endpoint, field, enum value, header, event name and SDKmethod you use must come from the Toden documentation or its OpenAPIcontracts. If you cannot find it, say so and ask me.- Never invent a fact about my business. If you need it and the code does notshow it, ask.- Never ask me to paste a key into this conversation, and never write a keyinto source, a test fixture, a log line or a client bundle.- Names containing "Myaza" (headers such as X-Myaza-Signature-V2, theMyaza-Version header, packages under @myazahq, the <MyazaKYC/> component)are current Toden identifiers. Do not rename them.## Stage 1: Inspect before you askRead this repository and write down, for yourself:- Languages, frameworks and where the backend runs.- Client platforms: web (which framework), iOS, Android, React Native, Flutter.- How a customer is identified (the primary key or public id).- Where sign-up, onboarding, payouts or transfers happen in the code.- How secrets are loaded, how webhooks from other providers are received,and how background jobs run.- Any existing identity, fraud or screening provider.Then read the Toden documentation:- Fetch /llms.txt from the Toden documentation site and open pages asMarkdown (append .md to a page URL). Start with "Choose your integration".- OpenAPI contracts:- /api/kyc and /api/identity: https://api.toden.co/api/openapi/verification.json- /api/v1 (Risk Intelligence): https://api.toden.co/api/openapi.jsonIf a guide and a contract disagree, the contract wins. Tell me about thedisagreement.## Stage 2: Interview meAsk the questions below in ONE numbered message. Skip any question thecodebase already answered and state what you found instead, so I can correctit. For each question, say in a few words why it matters. Offer a defaultwhere one is sensible. Then stop and wait for my answers. If an answer isvague or two answers conflict, ask a follow-up before moving on.About the business1. What does the product do, and what is the customer doing at the momentyou need to trust them (opening an account, receiving a payout, sendingmoney, listing as a seller, something else)?2. Are the customers individuals, businesses, or both?3. Which countries are the customers in, and which ID documents do theyusually hold?4. Are you regulated or supervised? By whom, and what must you be able toshow an auditor (identity verified, sanctions screened, ongoingmonitoring, records kept for a set period)?About the checks5. Which of these do you need, now or soon: government ID check, livenessand face match, proof of address, email or phone confirmation, companyregistry lookup, the owners and directors behind a company, sanctions andpolitically exposed person screening, ongoing re-screening, a decision oneach transaction or login, crypto wallet screening, Travel Rule?6. Is the customer present and holding their phone or laptop when the checkruns, or do you already hold their details and only need to check them inthe background?7. Should the check run once, at set moments (for example before the firstpayout, or above an amount), or continuously?About the experience8. Do you want Toden to host the verification screens under your branding,or must the flow sit inside your own app?9. What should happen in your product for each outcome: approved, declined,sent to manual review, still processing, abandoned by the customer, and afault on Toden's side? Who on your team reviews the "manual review" cases?10. May a declined or abandoned customer try again? How many times?About your systems11. Which field identifies a customer in your system? (I will send it toToden as externalUserId so every result and webhook carries it.)12. Can this backend receive webhooks on a public HTTPS URL? If not, what isthe alternative?13. Are you replacing another provider? Do existing customers need to bebrought across, or only new ones verified?14. Roughly how many checks a month, and are there bursts?About access15. Do you have a Toden account with Sandbox keys already set as environmentvariables? Tell me the variable NAMES only, never the values.16. Have you built and published a workflow in the Toden console? If so,give me its id (it starts with wf_).## Stage 3: RecommendUsing my answers and the documentation, recommend ONE setup. Do not presenta menu. Apply these rules, and check each against the documentation beforerelying on it:Which product- Verifying a person: User Verification. Verifying a company and the peoplebehind it: Business Verification. Deciding whether to allow something aknown customer does, or screening them against watchlists over time: RiskIntelligence. Many businesses need verification at onboarding plus RiskIntelligence afterwards. Say so if mine does.- Only recommend what my answers justify. If I did not ask for a check andno obligation I named requires it, list it under "Consider later" insteadof building it.Which route for verification- Customer present, and Toden-hosted screens are acceptable: a hostedverification session. My backend creates a session for one customer andsends them the link. This is the default recommendation because it needsno client code.- Customer present, and the flow must sit inside my app: a client SDK. Todenpublishes SDKs for React, React Native and Flutter only. For any otherclient (for example Vue, native Swift or Kotlin) recommend a hostedsession opened in the browser or a web view, and read "Hosted page events".- Customer not present, and I already hold their ID details with theirconsent: a one-off check from my backend.- Reading the chip in a passport or ID card needs a mobile SDK. A browsercannot do it.- Backend calls use the REST API directly. Check the "Server SDKs" page forwhat is published before suggesting any server package. Do not add apackage that page does not list as published.What Toden cannot decide for me- A hosted session or SDK flow runs a workflow that a person builds andpublishes in the Toden console. You cannot create or publish it. If I havenone, tell me exactly what to configure (subject type, countries, IDtypes, checks, decision rules) based on my answers.- Coverage differs by country. Look up my countries in "ID types andcountries" and tell me plainly where a government-record check isavailable and where verification rests on the document alone.Present the recommendation as:- What I recommend, in two or three sentences.- Why, tied to my answers by question number.- What it costs me to build: files to add or change, and what a person mustdo in the Toden console.- What I am choosing NOT to build now, and why.- Open risks or anything in my answers that worries you.## Stage 4: Plan, then waitWrite a short plan: the endpoints you will call and with which key type; thewebhook events you will handle; the data you will store and where; how eachToden status maps to a product behaviour from question 9; the environmentvariables; the tests. Then STOP and ask me to approve or change it.## Stage 5: Build, in Sandbox only- Use test keys only (pk_test_, sk_test_) from environment variables. Asecret key (sk_) is used only on the server.- Sandbox identity verification accepts only the published test IDs. Usethem. Never use a real person's ID number.- /api/kyc and /api/v1 are different contracts with different error bodies.Write a separate error parser for each one you use.- Send my customer identifier as externalUserId.- Verification is asynchronous. Creating a session or a verification returnsan identifier, not a decision. Never grant access from a client-sidecallback. Grant it from my backend after reading the result.- Branch on the top-line status and handle every documented value, plus adefault branch. in_review, processing, awaiting_resubmission, error,abandoned and expired are neither approvals nor declines.- Make every write safe to retry: metadata.requestId for /api/kycverifications, the Idempotency-Key header where /api/v1 requires it,externalActivityId for transactions and activities. On a timeout, resendthe same body with the same key.- A failed or timed-out risk decision is never an approval.- Webhooks: verify X-Myaza-Signature-V2 over the raw request bytes with aconstant-time comparison, accept any of the v1 values present, rejecttimestamps outside the replay window, store the delivery id and ignorerepeats, respond 2xx quickly, then re-read current state from the APIbefore acting. Add a polling fallback for a result whose webhook neverarrives.- Follow this codebase's existing conventions for structure, naming, errorhandling, logging and tests. Do not log ID numbers, names or images.- Do not publish a workflow or policy, switch to live keys, change adecision rule or spend money. Tell me when one of those is needed.## Stage 6: Prove it, then hand overWrite automated tests for: the approved path; a declined result; a result inmanual review; a fault on Toden's side; a customer who abandons; a duplicatewebhook delivery; a webhook with a bad signature; a request retried after atimeout; and a request made with the wrong key type. Use the documentedSandbox test IDs and scenarios. Run the tests and show me the output.Then report:- What was built, and the endpoints called with which key type.- The environment variables I must set, by name.- How each status is handled, as a table.- Test results, exactly as run.- Anything you could not verify, stated plainly.- The go-live checklist a person must complete: business approval in theToden console, live keys, a production webhook endpoint, a publishedproduction workflow, prepaid balance, and a first real verificationwatched end to end.
What a good run looks like
- The agent’s first message is a list of questions, with what it already learned from your code. It is not code.
- It recommends one setup and ties each choice to an answer you gave.
- It waits for your approval before building.
- No key appears anywhere in the diff.
- Endpoint paths and field names match the API reference.
- Every status has an explicit branch, plus a default.
- The hand-over lists what it could not verify, instead of claiming everything works.
If the agent goes wrong
| It does this | Tell it |
|---|---|
| Starts writing code immediately | ”Go back to stage 2. Ask me the questions first.” |
| Offers three options and asks you to pick | ”Recommend one, with reasons from my answers.” |
| Uses a field or endpoint you cannot find in the reference | ”Show me where that is documented, or remove it.” |
| Asks for your key | ”Read it from the environment variable. I will not paste it.” |