Tool & function calling
AuraScore 85/100

Compliance KYC Multi-Tool Agent Orchestration Script

Develop an automated Python script coordinating multi-tool calls across identity verification, sanctions checks, and audit logging.

Use this template when implementing customer onboarding agents that must query external identity providers sequentially. It establishes resilient tool calling with fallback mechanisms and audit trails.

Template

Role: Lead Compliance Systems Architect specializing in automated identity verification and regulatory technology.

Context

  • Banking Entity: {{bank_entity_name}}
  • Sanctions Watchlist API: {{sanctions_database_vendor}}
  • Credit Bureau Service: {{credit_bureau_api}}
  • Document Extraction Tool: {{ocr_service_provider}}
  • Immutable Audit Store: {{audit_logging_database}}
  • Max Tool Retry Attempts: {{retry_limit}}

Task

Construct an end-to-end Python script configuring agent tools that extract identity data via {{ocr_service_provider}}, screen against {{sanctions_database_vendor}}, query {{credit_bureau_api}}, and write immutable verification events to {{audit_logging_database}} on behalf of {{bank_entity_name}}.

Method

  1. Define tool schemas for identity document optical parsing and extraction.
  2. Define tool schemas for Politically Exposed Persons (PEP) and sanctions list matching.
  3. Define tool schemas for real-time credit profile verification and address confirmation.
  4. Write the agent controller loop that parses tool call requests and routes them to specific API clients.
  5. Integrate exponential backoff retry logic constrained by {{retry_limit}} for all network calls.
  6. Construct a deterministic fallback strategy whenever a third-party KYC provider returns an outage code.
  7. Build a telemetry writer recording every tool invocation timestamp and payload digest to {{audit_logging_database}}.

Constraints

  • Code MUST redact Personally Identifiable Information (PII) before printing standard out logs.
  • Tool calls MUST NOT execute in parallel if sanctions screening yields an unverified match.
  • Script MUST strictly adhere to Python asynchronous programming (asyncio and httpx).
  • Every tool response MUST return a normalized boolean approval status code.

Output format

1. Tool Definitions Block

List of agent tool definitions with parameters, required fields, and type annotations.

2. Async Orchestration Script

Executable async Python program with tool handlers, retry decorators, and fallback logic.

3. Verification Test Harness

Async test runner demonstrating a successful onboarding pass and a sanctions match trigger.

Self-review

  • Confirm that PII masking logic is active across all console logging statements.
  • Verify that {{retry_limit}} is referenced and parameterized in the retry handler.
  • Ensure audit logs are queued for every single tool invocation regardless of success or failure.
AuraScore breakdown
85/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency7/10 · Adequate

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-tool-calling
financial-services
kyc-automation
sanctions-screening
agentic-tools