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
shadow_mode: true. - Monitor decisions and alerts.
- When confident, switch to
shadow_mode: false.
Handling decisions: summary
The mapping from decision to action is entirely up to you. MeshQu provides the signal; your application provides the behaviour.
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.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.