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 testwarns about each one that has none; a warning here is a “no”. - Every response schema is closed,
additionalProperties: falseat 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 theexisting_vendoranswer and in thevendoranswer 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.
2. Intents
Section titled “2. Intents”- 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, markedx-sefra-money, with a currency. effectis right: a read changes nothing at the system.- A write has a
compensatethat undoes exactly this effect, or isirreversible: truewith a reason in a comment. - The compensation’s
already_undonestatuses mean “nothing left to undo”, not “cannot undo”. - If the system can answer success before the undo has finished (a
pendingrefund), the compensation declaressuccess_when. - The idempotency mode matches the system:
headeronly if the system deduplicates by that header,naturalonly if repeating is harmless. - A write with mode
nonehas 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.
versionis raised if the meaning of an existing input changed.
3. Policies
Section titled “3. Policies”- Every new or changed rule has tests on both sides of its boundary, named after the rule.
allowdepends only on the principal and the intent type; data-dependent constraints aredenyrules.- 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: truefor anything that moves money or master data, andmin_evidencewhere auditors ask for a signed-in approver. - Violation messages and hints tell the agent what would be accepted.
4. Grants and limits
Section titled “4. Grants and limits”- 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 testwarns). - Limits stop a looping agent before it does damage; money-moving intents have their own.
5. Before activation
Section titled “5. Before activation”sefra bundle testexits 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_adminand is not its only author.