Engineering4 min read

Building an Agent for Compliance Workflows

How we approached automating compliance checks for customer onboarding without requiring workflow configuration.

Keon Kim

Keon Kim

Engineering

Abstract geometric pattern representing AI agent workflows

Background

Compliance workflows in fintech typically require multiple services: document verification, sanctions screening, adverse media monitoring, registry lookups. Each service has its own API, configuration requirements, and output format.

The standard integration approach uses workflow builders, visual tools where teams define rules and connect services. This works, but the setup cost is significant. Initial configuration takes weeks. Process changes require reconfiguration. Someone has to maintain each integration.

After the tooling is in place, the manual work often remains similar: monitoring outputs, handling edge cases, stitching together results from different systems.

We wanted to test a different approach.

Approach

Most compliance processes already exist as written SOPs. These documents describe, step by step, what to check and what to look for.

The idea: instead of translating SOPs into workflow configurations, have an agent read the SOP directly and execute it.

System Design

Jina exposes a single API. The request includes:

  • Subject information (company name, jurisdiction, etc.)
  • Uploaded documents
  • Reference to the SOP to follow

The agent parses the SOP into steps, executes each using available tools, and returns a structured report.

Available tools:

  • Document parsing (PDFs, images, forms)
  • Web search
  • Corporate registry APIs
  • Sanctions and PEP database lookups
  • Adverse media search

All actions are logged.

SOP Interpretation

SOPs vary. Some are detailed checklists. Others are general guidelines.

We use a two-pass approach:

  1. Extract intent and required checks
  2. Map to available tools

When instructions are ambiguous, the agent flags them rather than guessing. This adds friction but reduces errors.

Example

Given an SOP step like "verify the business address," the agent:

  1. Extracts addresses from submitted documents
  2. Queries the corporate registry
  3. Checks web presence
  4. Compares for consistency
  5. Reports findings and any discrepancies

The reasoning is included in the output for audit purposes.

API

Single endpoint. You specify which tasks to run.

POST /v1/decisions
{
  "reference_id": "KYB-2847",
  "type": "kyb",
  "subject": {
    "legal_name": "TechFlow Solutions Inc",
    "registration_number": "C4829104",
    "registration_country": "US",
    "website": "https://techflowsolutions.com",
    "beneficial_owners": [
      { "name": "John Chen", "title": "CEO", "ownership_pct": 60 }
    ]
  },
  "tasks": [
    "document_analysis",
    "website_analysis",
    "web_presence",
    "business_registry",
    "sanctions_screening"
  ],
  "documents": [
    { "type": "incorporation", "url": "https://..." }
  ]
}

Available tasks: document_analysis, financial_analysis, website_analysis, web_presence, identity_verification, sanctions_screening, pep_screening, adverse_media, business_registry, ubo_verification.

Response includes structured results per task:

{
  "decision_id": "dec_7x8y9z",
  "status": "completed",
  "outcome": {
    "decision": "review",
    "risk_score": 45,
    "risk_level": "moderate"
  },
  "summary": "Mixed verification signals. Document inconsistencies require review.",
  "recommendations": [
    "Request clarification on business address discrepancy",
    "Obtain original business license from issuing authority"
  ],
  "tasks": {
    "document_analysis": {
      "status": "completed",
      "result": "needs_review",
      "findings": {
        "issues": [
          { "code": "ADDRESS_MISMATCH", "severity": "medium" }
        ]
      }
    },
    "business_registry": {
      "status": "completed",
      "result": "passed",
      "findings": { "registered": true, "status": "active" }
    }
  }
}

Each task returns passed, needs_review, failed, or error. Full audit trail included.

Tradeoffs

SOP quality matters. Vague SOPs produce vague results.

Not everything automates. Phone verification, video calls, physical document inspection still require humans.

Adverse media has noise. Relevance filtering helps but doesn't eliminate false positives.

Latency. Full reports take 30-90 seconds depending on jurisdiction and checks required.

Tags

AgentsComplianceAPIOnboarding