Skip to main content

Programmatic Identity Verification for AI Agents in Python

Discover how AI agents can programmatically register and integrate with identity verification platforms. Learn about Didit's API-first approach, enabling headless registration, workflow configuration, and session management for.

Programmatic Identity Verification for AI Agents in Python

Contents

In this guide

Jump to the part you need.

Headless RegistrationAI agents can register and obtain API credentials with just two API calls, eliminating the need for manual browser interaction.

API-First ConfigurationVerification workflows, session creation, and billing management can all be configured and controlled programmatically via a comprehensive Management API.

Seamless Integration with AI ToolingDidit provides an MCP Server, allowing AI agents to natively discover and utilize identity verification tools within their existing environments.

Didit's AI-Native AdvantageDidit is purpose-built for the agentic era, offering a modular, AI-native platform with Core KYC, enabling rapid, automated deployment of robust identity solutions for AI.

The rise of AI agents is transforming how we interact with software and services. These intelligent systems are increasingly capable of performing complex tasks autonomously, from writing code to managing infrastructure. However, for AI agents to operate effectively and securely in real-world scenarios, they often need to interact with services that require identity verification. This is where programmatic identity verification becomes crucial, especially when integrating with Python tooling.

The Need for Programmatic Identity Verification in AI

Traditional identity verification platforms are designed for human users, often requiring browser-based interactions, CAPTCHAs, and multi-factor authentication (MFA) steps that can hinder an AI agent's autonomy. For AI agents to truly automate tasks that involve sensitive operations like account creation, financial transactions, or access to restricted data, they need a way to verify identities without human intervention.

Imagine an AI agent tasked with onboarding new users for a financial application. This process typically involves ID Verification, Passive & Active Liveness checks, and AML Screening. Without programmatic access to these services, the AI agent would hit a roadblock, requiring a human to step in and complete the verification. This defeats the purpose of automation.

Didit's Approach: AI-Native and Developer-First

Didit stands out as the most agent-friendly identity verification platform, designed from the ground up for programmatic interaction. Unlike legacy systems, Didit allows AI coding agents—such as Cursor, Claude Code, GitHub Copilot, and Devin—to register, configure workflows, and begin verifying identities entirely programmatically, without ever opening a browser.

This developer-first approach means that the entire identity verification lifecycle, from initial setup to ongoing management, can be controlled via clean APIs. For Python developers building AI agents, this translates into seamless integration and robust automation capabilities.

Headless Registration and Credential Management

One of Didit's most powerful features for AI agents is its programmatic registration process. An AI agent can go from zero to having API credentials in just two API calls:

  1. Register: The agent sends a POST request to the registration endpoint with an email and password.
  2. Verify Email: Upon receiving an email verification code (which could be relayed to the agent via a secure channel or a human intermediary for initial setup), the agent sends a POST request to verify the email.

The response to the verification step includes an API key, which the agent can immediately use for all subsequent API calls. Crucially, Didit eliminates 2FA friction for API accounts, returning tokens instantly after email verification. This headless, browser-less process is perfect for CI/CD pipelines and agent workflows, ensuring that AI systems can provision and manage their own verification capabilities efficiently.

For Python, this translates into simple requests calls:

import requests

# Step 1: Register
register_payload = {"email": "agent@example.com", "password": "StrongP@ss1"}
register_response = requests.post("https://apx.didit.me/auth/v2/programmatic/register/", json=register_payload)
print(register_response.json())

# Assuming manual input or secure relay for the verification code
verification_code = "A3K9F2" # Replace with actual code

# Step 2: Verify and Get Credentials
verify_payload = {"email": "agent@example.com", "code": verification_code}
verify_response = requests.post("https://apx.didit.me/auth/v2/programmatic/verify-email/", json=verify_payload)
credentials = verify_response.json()
api_key = credentials["application"]["api_key"]
print(f"API Key: {api_key}")

# Step 3: Use the API
headers = {"x-api-key": api_key}
sessions_response = requests.get("https://apx.didit.me/v3/sessions/", headers=headers)
print(sessions_response.json())

Orchestrating Workflows and Sessions Programmatically

Beyond initial registration, Didit's full Management API allows AI agents to configure and manage every aspect of identity verification. This includes:

  • Creating Verification Sessions: An agent can programmatically initiate a verification flow for a user, specifying the required workflow (e.g., ID Verification + Liveness). This is crucial for products relying on Didit's ID Verification and Passive & Active Liveness features.
  • Managing Workflows: Agents can list, create, update, and delete verification workflows, adapting to changing compliance needs or business logic.
  • Handling Questionnaires: Custom questionnaires for additional data capture can be created and managed via API.
  • Monitoring Billing: Agents can check credit balances and even initiate top-ups programmatically, ensuring uninterrupted service.
  • AML Screening & Monitoring: For financial services, agents can integrate with Didit's AML Screening & Monitoring capabilities, performing automated checks against watchlists.

This level of programmatic control empowers AI agents to build complete, self-managing identity verification integrations without human intervention, leading to faster deployment and greater operational efficiency.

How Didit Helps

Didit provides the essential infrastructure for AI agents to seamlessly integrate and manage identity verification. Our platform is built with an open, modular architecture, allowing AI agents to plug-and-play identity checks as needed. Key advantages for AI agent tooling in Python include:

  • Pay per use: Agents can start verifying identities without upfront costs, making it easy to experiment and scale.
  • AI-Native Design: Didit is engineered for automation, offering comprehensive APIs that cater specifically to the needs of intelligent agents. This includes headless registration and full management API access.
  • Modular and Composable: AI agents can dynamically compose verification workflows using Didit's building blocks like ID Verification, Passive & Active Liveness, 1:1 Face Match, and AML Screening & Monitoring, adapting to various use cases.
  • No Setup Fees: Simplifies adoption and reduces barriers for AI developers.
  • MCP Server Integration: For the ultimate agent experience, Didit offers a Model Context Protocol (MCP) server, enabling AI agents to discover and use Didit tools natively through natural language commands or structured tool calls. This integration means agents can leverage didit_register, didit_create_session, and other tools directly within their agentic frameworks, streamlining development and operation.

By leveraging Didit, Python-based AI agents can achieve a level of autonomy and integration with identity verification services that was previously unattainable, opening new possibilities for automated processes and secure digital interactions.

Ready to Get Started?

Ready to see Didit in action? Get a free demo today.

Start verifying identities for free with Didit's free tier.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

About Didit

Questions

Blog questions

Who writes the Didit blog?
The Didit team. Guides reviewed by Alberto Rosas, co-founder and CEO, carry his byline. The rest are published as Didit.
Which topics does the blog cover?
Eight topics: ID verification, business verification (KYB), AML, sanctions and compliance, fraud prevention, transaction monitoring and crypto, country guides, agents and developers, and product updates.
Is the blog available in my language?
Yes, in 15 languages: English, Spanish, French, German, Brazilian and European Portuguese, Catalan, Russian, Arabic, Chinese, Japanese, Hindi, Indonesian, Korean and Swahili. Not every post is translated, so each language shows the posts it has.
Where do I find product updates?
In the changelog at /changelog/ and under the Product updates topic.
Are these posts legal advice?
No. Regulation posts explain rules; your legal team decides how they apply.
How do I find posts on one topic?
Open one of the eight topics, or search the blog.
Are posts dated?
Yes. Every post shows when it was published and when it was last updated.
Do posts link to the docs?
Developer posts link to the matching page on docs.didit.me and to the API reference.
Is the blog the same as the docs?
No. The blog explains rules, markets and product changes for a general reader, while docs.didit.me holds the integration guides and the API reference. Developer posts link the matching docs page and the API reference they describe.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.