Legal & RegTech · Python SDK

Clear a counterparty only when ownership is verified

Your diligence agent screens a counterparty and proposes clearance. The Python SDK hands the screening results to the legal team’s rules, which stop clearance while ownership is unverified and send politically exposed persons to a partner.

Python: compute the flag, then check

Work out opacity_risk before the call so the rule reads one clear flag.

Python · veriproof-sdk

HIGHER_OPACITY = {"cyprus", "bvi"}  # your firm's list

result = await vp.govern(
    "counterparty.clear",
    {"matterId": matter.id, "counterpartyId": counterparty.id},
    lambda context: matters.mark_cleared(context.input),
    facts={
        "jurisdiction": counterparty.jurisdiction,
        "opacity_risk": counterparty.jurisdiction in HIGHER_OPACITY,
        "transaction_value_usd": matter.value_usd,
        "sanctions_screen_result": screening.sanctions,
        "beneficial_ownership_verified": kyc.ownership_verified,
        "pep_exposure": kyc.pep_in_chain,
        "adverse_media_hits": screening.adverse_media_count,
        "active_litigation_flags": docket.open_flags,
    },
)

if not result.completed:
    matters.hold(matter.id, result.status, result.reason_code)

matters.mark_cleared runs only on a released result. A held matter keeps its current status.

Why Python here: Document review and screening pipelines in legal tech are mostly Python, so the check sits beside the code that reads the screening results.

Screening results the rule reads

The deal clearance simulator sends these fields. One of them, opacity_risk, your code works out.

FactWhat it holds
jurisdictionWhere the counterparty is registered, such as united_kingdom or bvi.
opacity_riskTrue when your firm treats the jurisdiction as higher opacity.
transaction_value_usdValue of the deal.
sanctions_screen_resultclear, potential_match, or confirmed_match.
beneficial_ownership_verifiedTrue when ownership has been verified.
pep_exposureTrue when a politically exposed person appears in the ownership chain.
adverse_media_hitsAdverse media results found.
active_litigation_flagsOpen litigation flags.

Your firm owns the opacity list

The simulator marks Cyprus and the British Virgin Islands as higher opacity. Your firm keeps its own list. Computing the flag in your code keeps the rule short and puts the list where your team already maintains it.

Clear, refer, or stop

Each row is a sample matter in the deal clearance simulator. Run deal clearance simulator

ResultWhenWhat your code seesWho picks it up
AllowedA domestic vendor with verified ownership and clean screening.The counterparty is cleared, and the record keeps the screening facts and the rule version.The Business Owner sees matters moving. Auditors read the record inside an engagement.
Sent to a personA politically exposed person appears in the ownership chain.Clearance waits for a partner.The partner with that authority, in the VeriProof Inbox, by email, or in Slack or Microsoft Teams, with reminders and escalation.
StoppedA $12 million clearance while ownership is still unverified.The status is blocked, and the matter isn’t cleared.The Governance Engineer sees the ownership rule that stopped it.

When the legal team adds a check

Developer fix request

If the team adds a rule on source of funds and your agent doesn’t send it, the Developer gets a fix request naming the field.

Changing the rule

Lowering the value that needs partner review can be tested in Shadow against live matters. The engineer who writes it can’t enforce it in production alone. An administrator or compliance officer approves it.

See how the six role portals hand off work

Documentation and simulator

Run the unverified ownership case

Try the $12 million matter in the deal clearance simulator and watch the rule hold it.