Skip to content

Bundle review checklist

Use it on every pull request that changes a bundle. The reviewer is not the author. Each item is a question with a yes or no answer; a “no” is a requested change, or a note in the pull request saying why not.

Sefra checks the format, runs the tests and fails closed at run time. It cannot tell whether a rule is the right rule, whether a field is personal data, or whether a compensation really undoes the effect. Those are this list.

1. Sensitive data: every field, every place it appears

Section titled “1. Sensitive data: every field, every place it appears”

Nothing detects an unmarked sensitive field. Its clear value then goes into the audit payloads, the stored policy input and the approval summary, and stays there until you delete it. A 13-month retention default is Planned, and no job enforces it yet.

  • Every input field that identifies a person, or is secret, is marked x-sefra-sensitive: true: personal names, email addresses, phone numbers, postal addresses, tax ids (of sole traders and persons), bank accounts and IBANs, card data, dates of birth, free-text notes that may hold any of these.
  • Every fact has a response_schema. sefra bundle test warns about each one that has none; a warning here is a “no”.
  • Every response schema is closed, additionalProperties: false at every level, so that a field the system adds later stops the fact instead of reaching the stored decision unmarked.
  • Every field of every fact’s answer is in its response schema, not only the fields a rule reads, and each sensitive one is marked. The system returns the whole record, and the whole record is stored with the decision. Check against the system’s API documentation or a real answer, not against the policy.
  • A value that appears in more than one place is marked in each: an input field that a fact also returns (the starter’s vendor tax id is marked in create_vendor’s input, in the existing_vendor answer and in the vendor answer of the purchase order).
  • No sensitive field is needed in clear by a rule. A rule can compare redacted values for equality only.
  • The summary template names no sensitive field (it would show [redacted] to the approver, who then approves without seeing it).
  • The output schema returns to the agent only what it needs.
  • The description says what the intent does and what it refuses, in words an agent can act on.
  • The input schema is tight: additionalProperties: false, bounds, lengths, patterns or enums. Money is an integer in minor units, marked x-sefra-money, with a currency.
  • effect is right: a read changes nothing at the system.
  • A write has a compensate that undoes exactly this effect, or is irreversible: true with a reason in a comment.
  • The compensation’s already_undone statuses mean “nothing left to undo”, not “cannot undo”.
  • If the system can answer success before the undo has finished (a pending refund), the compensation declares success_when.
  • The idempotency mode matches the system: header only if the system deduplicates by that header, natural only if repeating is harmless.
  • A write with mode none has a probe whose key identifies the effect uniquely, or a comment on why an operator settles it.
  • Every operation the manifests call (execute, compensate, probe, facts) is permitted to Sefra’s credential at the system, and nothing more (credential scoping).
  • The summary template tells an approver what they approve, with amounts and units.
  • version is raised if the meaning of an existing input changed.
  • Every new or changed rule has tests on both sides of its boundary, named after the rule.
  • allow depends only on the principal and the intent type; data-dependent constraints are deny rules.
  • Approval rules depend on the agent’s input, not on facts or values a plan resolves later.
  • Where an absent value is not “unresolved yet”, the rule fails closed (deny) rather than skipping a check.
  • Thresholds are named constants, and the change to them is the intended one.
  • Approval requirements name the right roles, with distinct_from_requester: true for anything that moves money or master data, and min_evidence where auditors ask for a signed-in approver.
  • Violation messages and hints tell the agent what would be accepted.
  • Each grant gives the least set of intents the role or principal needs. No * beyond a domain.
  • No grant or limit names nothing (sefra bundle test warns).
  • Limits stop a looping agent before it does damage; money-moving intents have their own.
  • sefra bundle test exits 0 in CI, with every remaining warning explained.
  • sefra policy replay --bundle <dir> was run against production’s trail, and every decision whose effect changes is expected; the list is in the pull request.
  • The person who applies the bundle holds sefra_admin and is not its only author.