Skip to main content

Overview

The corsa-rule-engine-authoring skill adds deep Corsa rule engine knowledge to your coding tool (Cursor, Claude Code, VS Code, etc.) so it can build, test, and manage transaction-monitoring rules directly via the REST API. It covers the complete property catalog, advanced aggregation operators, nested condition logic, rule lifecycle, and evaluation. Pair with corsa-rule-spec-drafting to go from a compliance policy clause → grounded rule description → implementation.

What It Helps With

  • Translating a compliance policy into a valid rule JSON payload
  • Building complex conditions with nested AND/OR logic and aggregation/velocity time windows
  • Configuring CREATE_ALERT and HALT_TRANSACTION actions
  • Managing rule lifecycle (draft → activate → disable → delete)
  • Testing rules against transaction history with the evaluation API

Quick Start

After installing the skill, ask your coding tool questions like:
  • “Build a rule that flags structuring: 3+ deposits between 9K9K–9,999 in 24 hours”
  • “Create a rule that fires when a sender’s total deposits in 7 days exceed $50K”
  • “What aggregation operators are available for velocity checks?”
  • “How do I update an active rule without downtime?”
  • “Test my rule against a transaction without creating an alert”

What the Skill Knows

Rule Lifecycle

  • Only active rules evaluate incoming transactions
  • Updating an active rule atomically creates a new version — the old version is disabled
  • activate and disable accept an optional { "reason": "..." } body for the audit trail
  • Disable a rule before deleting it

Condition Types

Simple conditions — compare a field on the entity to a value using an operator (equal, notEqual, greaterThan, lessThan, in, notIn, contains, between, isNull, isNotNull, and more). Aggregation conditions — rolling time-window checks for velocity and structuring detection (sum, count, countDistinct, avg, min, max, median, stddev, percentile, velocityChange, deviationFromAverage, baselineComparison). Dynamic thresholds — compare an aggregation against a per-client configured limit using path: "client.sender.dailyLimit" instead of a hardcoded value.

Entity Property Catalog

Rules inspect the transaction and its direct participants: transaction, client, wallet, bankAccount. Key properties include risk tier/score, KYC/AML status, country, amount, currency, type, and more — the skill knows the full catalog.

Actions

Evaluation API

  • On-demand testing: POST /v1/evaluation/evaluate — returns what would happen without creating alerts
  • History by transaction: GET /v1/evaluation/transaction/{id}/results
  • History by rule: GET /v1/evaluation/rule/{id}/results

Rule Templates

Browse pre-built templates, copy one as a draft, customize, and activate:

Common Mistakes It Prevents


Source

GitHub Repository

View the full skill source with the complete property catalog, aggregation examples, and API reference.