Tracer is the layer your authorization or onboarding system calls before a transaction goes through. It runs your fraud, risk, and limit policies in milliseconds and returns ALLOW, DENY, or REVIEW — so the decision lives in one place instead of being scattered across product code. What changes in your operation: decision logic stops living in scatteredDocumentation Index
Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
Use this file to discover all available pages before exploring further.
if statements across services. Rule changes ship through an API the same day, not in the next release. Audit goes from “let me piece together logs from N systems” to “here is the immutable record of why this transaction got this decision.”
Trade-off to be honest about: you add one HTTP call to the critical path of every transaction (target p99 under 80ms). In return, you get a single point for policy, audit, and analytics — and you remove duplicated logic from product code.
This guide walks you through setting up Tracer and running your first validation. In a few steps, you’ll have a working environment ready to validate transactions in real time.
For step-by-step API instructions with request and response examples, see the Tracer API quick start.
Why use Tracer
- Real-time validation: Make ALLOW/DENY/REVIEW decisions in under 80ms (p99)
- Flexible rules: Expression-based rule engine for custom business logic
- Spending control: Configure limits by account, portfolio, segment, and period
- Complete : Immutable validation records for SOX/GLBA compliance
- Product-agnostic: Supports any transaction type (Card, Wire, PIX, Crypto)
- Understand Tracer architecture and core concepts
- Have a working development environment
- Run your first transaction validation
- Configure a spending limit
What is Tracer
Tracer is a transaction validation platform that evaluates rules and limits and returns instant decisions. Your system calls Tracer before executing transactions and acts on the decision (ALLOW, DENY, or REVIEW) according to your business logic.
How it works

- Rules evaluate expressions against the transaction context
- Limits check spending thresholds for applicable scopes
- Decision returns ALLOW, DENY, or REVIEW based on evaluation results
Core contexts
Tracer is built around three bounded contexts:- Validation Context - Orchestrates requests, coordinates evaluation, records audit trail
- Rules Context - Manages rule definitions and expression evaluation
- Limits Context - Manages spending limits and usage tracking
Prerequisites
Before you start, make sure you have:
- Docker and Docker Compose installed
- Go 1.25.7+ (for local development)
- PostgreSQL 16+ (included in Docker Compose)
- API Key for authentication
Infrastructure dependencies
Tracer requires the following components:| Component | Version | Purpose |
|---|---|---|
| PostgreSQL | 16+ | Data persistence and audit trail |
Ports
Default ports used by Tracer services:| Service | Port | Description |
|---|---|---|
| Tracer API | 4020 | Main REST API |
| PostgreSQL | 5432 | Database |
Step 1: Set up the environment
You can run Tracer with Docker Compose or locally for development.
Option A: Docker Compose (recommended)
This is the fastest way to start. PostgreSQL starts automatically with the service.
Option B: Local run
For development, you can run Tracer locally:Essential environment variables
| Variable | Description | Example |
|---|---|---|
DB_HOST | PostgreSQL host | localhost |
DB_NAME | PostgreSQL database name | tracer |
API_KEY | API Key for authentication | your-secure-api-key |
API_KEY_ENABLED | Enable API Key authentication | true, false |
SERVER_PORT | API port | 4020 |
LOG_LEVEL | Log level | INFO, DEBUG, ERROR |
Step 2: Authenticate to the API
Tracer supports two authentication modes. Which one you use depends on the deployment topology:
| Deployment | Auth header | When to use |
|---|---|---|
| Single-tenant | X-API-Key: <api-key> | Local development, single-customer BYOC, or any deployment with MULTI_TENANT_ENABLED=false (the default). |
| Multi-tenant (SaaS / BYOC Multi-Tenant) | Authorization: Bearer <jwt> | Any deployment with MULTI_TENANT_ENABLED=true. The JWT is issued by Access Manager and carries the tenantId claim. |
X-API-Key: your-secure-api-key with Authorization: Bearer $JWT in every example.
API Key (single-tenant)
Include the API Key in theX-API-Key header:
Bearer JWT (multi-tenant)
Include the JWT issued by Access Manager in theAuthorization header:
tenantId claim from the JWT and routes the request to the correct tenant database. You never pass the tenant identifier in a header, path, body, or rule scope — the token is the only source of truth.
cURL example
Step 3: Configure a spending limit
Spending limits control transaction amounts by scope and period. Create a limit using
POST /v1/limits.
Limit types
| Type | Description | Reset behavior |
|---|---|---|
DAILY | Maximum amount per day | Resets at midnight UTC |
WEEKLY | Maximum amount per week | Resets every Monday at midnight UTC |
MONTHLY | Maximum amount per month | Resets on 1st of month |
CUSTOM | Maximum amount for a custom date range | Resets at end of custom period |
PER_TRANSACTION | Maximum per single transaction | No tracking needed |
Scopes
Apply limits to specific contexts:- Segment: Apply to all accounts in a segment (e.g., corporate customers)
- Portfolio: Apply to accounts in a portfolio
- Account: Apply to a specific account
- Transaction type: Apply only to CARD, WIRE, PIX, or CRYPTO
Create a limit
Activate a limit
Limit lifecycle
Limits are created inDRAFT status and follow the lifecycle DRAFT → ACTIVE → INACTIVE. Inactive limits can return to DRAFT for editing or be permanently deleted. Activate a limit to start enforcement. For the full lifecycle and transition rules, see the Spending limits guide.
Monitor usage
QueryGET /v1/limits/{id}/usage to check current consumption. The nearLimit flag turns true when utilization is strictly greater than 80% (utilizationPercent > 80), giving operators a heads-up before a limit is exceeded.
For detailed configuration options, see the Spending limits guide.
Step 4: Validate your first transaction
With limits configured, you’re ready to validate a transaction using
POST /v1/validations.
Submit a transaction for validation
Send a validation request with the transaction context including:- Transaction details (type, amount, currency, timestamp)
- Account information
- Optional: segment, portfolio, merchant, and custom
The
transactionTimestamp must be recent: future timestamps are rejected with TRC-0226 (1-minute clock skew tolerance), and timestamps older than 24 hours are rejected with TRC-0228.| Decision | Meaning | Your system should |
|---|---|---|
ALLOW | Transaction approved | Proceed with the transaction |
DENY | Transaction denied (rule matched or limit exceeded) | Block the transaction |
REVIEW | Requires manual review | Queue for human review |
Why Tracer returns a decision instead of blocking directly. Tracer is a decisioning layer, not an authorization gateway. The calling system is the one that holds the customer relationship, knows the channel, and decides what to do with a DENY — for example, your card-issuing system may decide to honor a
DENY for a stand-in pre-auth but still want to capture the request for analytics. By returning a decision, Tracer fits into any authorization flow without owning the customer-facing UX.Step 5: Create a validation rule
Rules let you define custom business logic that evaluates during validation. Create a rule using the
POST /v1/rules endpoint with an expression, action, and optional scopes.
For example, to block high-value transactions:
Activate a rule
Active rules are served from an in-memory cache that refreshes every
RULE_SYNC_POLL_INTERVAL_SECONDS (default 10). Newly activated rules can take up to ~10 seconds to start being evaluated, and deactivations take effect on the next sync. Plan integration tests accordingly.Rule lifecycle
Rules follow the same lifecycle as limits:DRAFT → ACTIVE → INACTIVE. To start evaluation, activate the rule using POST /v1/rules/{id}/activate. Active rules can be deactivated and reactivated as needed.
For detailed information about rule expressions and lifecycle management, see the Rules engine guide.
Observability
Tracer exposes endpoints for monitoring and observability.
Key metrics
Tracer exposes OpenTelemetry-compatible metrics via the OTLP exporter, plus custom application metrics:tracer_auth_failures_total{reason}- Authentication failures by reason (missing_api_key, invalid_api_key)tracer_audit_persist_failures_total- Audit record persistence failures (compliance risk)tracer_validation_rollback_failures_total- Usage rollback failures during REVIEW decisions (eventual consistency gaps that self-correct at period boundaries)
Verification
Confirm that everything is working correctly.
Checklist
- Docker services started and healthy
- API Key authentication working
- Spending limit configured
- Test transaction validated successfully
- Rule created and activated
Next steps
You’ve successfully set up Tracer and validated your first transaction. From here, you can explore more advanced features:
- Integration guide - Learn how to integrate your authorization system with Tracer
- Rules engine - Write validation rules in CEL and manage their lifecycle
- Spending limits - Configure and manage spending limits by scope and period
- Audit and compliance - Query validation history and understand the audit trail
Quick reference
The three flows you’ll use most:
- Validate a transaction:
POST /v1/validations— see the Tracer API quick start for the request shape. - Manage rules:
/v1/rules(CRUD + lifecycle endpoints/activate,/deactivate,/draft) — see the Rules engine guide. - Manage limits:
/v1/limits(CRUD + lifecycle +/usage) — see the Spending limits guide.
What your system should do with each decision
| Decision | Tracer recommends | Your system should |
|---|---|---|
ALLOW | Approval | Proceed with the transaction |
DENY | Denial | Block the transaction and inform the user |
REVIEW | Review | Queue for manual review in your system |
Tracer returns decisions as recommendations. Your system is responsible for implementing the appropriate action based on each decision.

