The policy engine evaluates configurable rules before any transaction is broadcast to the Quantum Chain network. Policies provide compliance controls, spending protection, and operational guardrails.Documentation Index
Fetch the complete documentation index at: https://docs.quantumapi.io/llms.txt
Use this file to discover all available pages before exploring further.
How policies work
- You create policy rules on a vault account or tenant
- When a transaction is created, the policy engine evaluates all applicable rules
- If any rule is violated, the transaction is blocked or requires approval
- Only transactions that pass all policies proceed to signing
Rule types
| Type | Description | Example |
|---|---|---|
MAX_AMOUNT | Blocks transactions above a threshold | Max 100 QUANTUM per transfer |
DAILY_LIMIT | Caps total daily outflow | Max 1,000 QUANTUM per day |
WHITELIST_ADDRESS | Only allows transfers to approved addresses | Known exchange addresses |
BLACKLIST_ADDRESS | Blocks transfers to specific addresses | Sanctioned addresses |
REQUIRE_APPROVAL | Requires manual approval before signing | All transfers above 50 QUANTUM |
TIME_WINDOW | Restricts transfers to specific hours | Business hours only (UTC) |
Creating a policy
Policy evaluation flow
All rules are evaluated. If any non-approval rule fails:- The transaction is moved to
REJECTEDwith an error code in the1200range. - If the failing rule is
REQUIRE_APPROVAL, the transaction entersPENDING_AUTHORIZATIONinstead.
Approval workflow
When aREQUIRE_APPROVAL rule matches:
- The transaction enters
PENDING_AUTHORIZATION. - A webhook event
approval.requiredis sent. - An authorized user calls
POST /v1/transactions/{id}/approveorPOST /v1/transactions/{id}/reject. - Approved transactions transition to
APPROVEDand then automatically toPENDING_SIGNATURE. Rejected transactions move toREJECTED.
Error codes
| Code | Meaning |
|---|---|
1200 | Policy violation (general) |
1201 | Amount exceeds MAX_AMOUNT limit |
1202 | Destination not in whitelist |
1203 | Destination is blacklisted |
1204 | Daily limit exceeded |
1205 | Transfer outside allowed time window |
Best practices
Defense in depth
Combine multiple rule types. Use
MAX_AMOUNT + WHITELIST_ADDRESS + DAILY_LIMIT together.Start permissive
Begin with high limits and tighten as you understand your transaction patterns.
Monitor violations
Policy violations emit webhook events. Monitor them for suspicious activity.
Separate by vault
Apply stricter policies to hot wallets and relaxed policies to treasury vaults.