Key principle: you own enforcement
MeshQu evaluates and returns a decision. Your application decides what to do with it. MeshQu does not block, allow, or modify operations — it provides the verdict and your code acts on it.Pattern 1: Synchronous pre-execution check
The most common pattern. Call MeshQu before the decision boundary and gate on the verdict.Pattern 2: Record for audit
When you need a persisted audit trail of every decision, userecord instead of evaluate. This stores the evaluation result with an idempotency key.
Pattern 3: Asynchronous monitoring
If you do not want to block the hot path, evaluate asynchronously after the operation completes. This is useful for monitoring and alerting rather than gating.Pattern 4: Advisory mode rollout
When introducing a new policy, start in advisory mode. Advisory policies are evaluated but theirDENY decisions are downgraded to ALERT. This lets you observe what the policy would do without affecting production.
- Create the policy with
advisory_mode: true. - Monitor decisions and alerts.
- When confident, switch to
advisory_mode: false.
Handling decisions: summary
| Decision | Typical action |
|---|---|
ALLOW | Proceed with the operation. |
REVIEW | Queue for manual review, notify compliance, or proceed with a flag. |
DENY | Block the operation and surface violations to the caller. |
ALERT | Log and review; no enforcement by MeshQu. |
Resilience considerations
- Timeouts: Configure the SDK
timeoutto match your SLA. If MeshQu is unreachable, decide whether to fail open (allow) or fail closed (block). - Retries: The SDK supports automatic retries on transient errors (5xx, network failures). Configure
retriesin the client constructor. - Idempotency: Always supply an
idempotency_keywhen recording decisions. This makes retries safe.
Fail-open vs. fail-closed
Choose a failure strategy before going live. For compliance-critical workflows, default to fail-closed.| Strategy | Behaviour when MeshQu is unreachable | Best for |
|---|---|---|
| Fail-open | Allow the operation and log for later review. | Low-latency paths, advisory governance, early rollout. |
| Fail-closed | Block the operation until governance is available. | Compliance-critical workflows, regulated environments. |
Anti-patterns to avoid
- Calling MeshQu after irreversible execution when auditability is required.
- Treating MeshQu decisions as implicit enforcement. Your application must act on the verdict explicitly.
- Sending sensitive personal data when opaque identifiers are sufficient.