ExecutionId design
executionId is the most important field in every execute request. It is your business transaction identifier and the key for replay protection.
Rules:
- Unique per business transaction each claim, payment, refund, or authorization must have its own
executionId - Stable the same business event must always use the same
executionId. Do not regenerate it on retry - Namespaced prefix with a domain to avoid collisions across policy types:
claim-CLM-2024-00441,payment-TXN-20240115-0001 - Derived from your business ID generate it from your business event’s canonical ID, not from
crypto.randomUUID()at the call site
executionId is reused? The second execute call throws [INV-013@replay]. This is correct behavior. If a system retries with the same ID, the replay store blocks it — which is the intended protection.
Signal hygiene
Signals are the inputs to the authority verification process. They are hashed (theexecution_fingerprint) and included in the signed attestation, making them part of the proof.
Rules:
- No personally identifiable information (PII) names, email addresses, SSNs, and similar data should not be in signals. Use member IDs, account IDs, and clinical codes
- No large payloads the request body limit is 64 KB. Signals should be structured scalar values, not raw documents or images
- Normalize before sending floating point values should be rounded consistently. String values should be lowercased or normalized to a canonical form before sending
- Be consistent the same business scenario must produce the same signals every time. If signals vary (due to upstream rounding or formatting), the
execution_fingerprintwill differ
Always verify after execute
Verification is lightweight (cryptographic only no database call) and proves the attestation is intact. Always verify before authorizing the real-world action.Check execution_state, not just decision.action
A decision can beaction: "approve" but still be in execution_state: "pending_override" if the policy rule sets requires_override: true. Check both:
Use RedisReplayStore in production
MemoryReplayStore does not persist across process restarts and does not work with multiple server instances. In any production environment, use RedisReplayStore:
MemoryReplayStore is only appropriate for local development, single-process integration tests, and ephemeral test environments. If you are using the Parmana server via Docker, Redis is configured automatically.
Store attestations
The signed attestation is your proof of governance. Store it alongside your business record:Handle pending override asynchronously
Whenexecution_state === "pending_override", the execution is blocked. Design your review workflow to be event-driven rather than polling-based:
- Store the
executionIdand mark the record as pending - Route it to your review queue (email, Slack, JIRA, etc.)
- When the reviewer acts, call
POST /override - Update your record with the resolution
Graceful degradation
Decide upfront what your system does if the governance runtime is unreachable:Production checklist
-
executionIdis derived from a stable, canonical business event ID - Signals are normalized and contain no PII
- Verification (
client.verify()) is called after everyexecute() - Both
execution_stateanddecision.actionare checked before authorizing -
RedisReplayStoreis configured (notMemoryReplayStore) - Attestations are stored in your database alongside business records
- Pending override flow is implemented (do not ignore
pending_overridestate) - Error handling distinguishes replay errors (no retry) from transient errors (retry with backoff)
- Network failure handling fails closed for critical paths
-
PARMANA_API_KEYis loaded from a secrets manager, not hardcoded