What it does
A versioned TOML policy file covers schema, access, residency, retention, backup and deployment admission. The kynetra policy command validates the file, checks a planned change set against it, exiting non-zero on any violation so it can gate a pipeline, and records approvals in a hash-chained, MAC-signed ledger bound to the policy and to the change.
How it works
kynetra policy validate parses the file strictly. Unknown keys, an unsupported version, inconsistent bounds, or a sensitive data class with no purpose binding are errors rather than ignored settings. The sections are schema (which collections may be created or are protected, which classifications are allowed), access (allow and deny rules and purpose bindings), residency (allowed regions for each data path and each data class), retention (day bounds for each collection), backup (required, interval, regions) and deployment (providers, regions, and whether bound data may replicate across regions).
kynetra policy check reads a change set, a JSON list of planned changes (create or drop a collection, change access, set retention, configure backup, deploy a topology, or run a governed export or inference), and prints each violation with a stable code. It exits non-zero when there is any. The access section of the policy is judged on every check, whatever the change set lists. Access rules are decided by the attribute-and-purpose engine described on its own page.
kynetra policy approve records a decision for a change set that passes the check. Each record is chained to the previous one, signed with a MAC under a ledger key you supply (at least 32 bytes) and anchored, and the latest decision for a change set and policy governs, so a rejection revokes an earlier approval. kynetra policy verify re-checks the chain, the MACs and the anchor, and reports whether an approval currently governs a named change set.
Where you reach it
- CLI
kynetra policy validate --policy <file> - CLI
kynetra policy check --policy <file> --changes <file> - CLI
kynetra policy approve --ledger <file> --ledger-key <file> --policy <file> --changes <file> --by <name> [--decision approved|rejected] - CLI
kynetra policy verify --ledger <file> --ledger-key <file> [--policy <file> --changes <file>]
Example
cat > policy.toml <<'EOF'
version = 1
[schema]
allowed_new_collections = ["notes", "events_*"]
protected_collections = ["audit_vault"]
[retention.bounds_days]
notes = [30, 3650]
EOF
cat > changes.json <<'EOF'
{ "id": "change-1", "changes": [ { "kind": "set_retention", "collection": "notes", "days": 90 } ] }
EOF
kynetra policy validate --policy policy.toml
kynetra policy check --policy policy.toml --changes changes.json # non-zero exit on a violationLimits
- The crate that implements it marks itself partial. It evaluates a change set that you or your pipeline produce. It does not read the live database and does not enforce the policy at run time.
- The commands work on local files and are refused when --remote or KYNETRA_REMOTE is set.
- The ledger is a file protected by a MAC under a key you hold. It shows tampering to a holder of that key. It is not a signature that a third party can check, and it does not defend a ledger whose key is compromised.
- Policy files and change sets are strict. A misspelled key is an error, not a silent default.
Evidence
- On this siteSecurity overview
- Tests61 tests in the policy crate (strict parsing, change-set checks, data-action decisions, ledger chaining, truncation and forgery detection, file-ledger locking)
Test coverage is listed as present in the engine repository at this edition. This page does not report test results.
KynetraDB is in private preview
Request a preview to talk through the limits above against your own workload.