diff --git a/SHA256SUMS b/SHA256SUMS index bc51948..6135719 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -2,21 +2,22 @@ b97a81728fc0d91f066bb92f27695c81f9bb25bd88d93bf470230132f33d0799 .github/workfl b63eff93f485d563b24680091496a39b3a62ecf3c8bb229cfc4eecd80c7e2262 .gitignore 3c0871d9b30c3e9647426b5b756be7dbfc5eee8728e6f0e0c371385de7c5f8f7 LICENSE 89e7fa8c08b6ada7931706085c33924173454fc51b866cb6726f8976d030e715 README.md -c3895b7b544b2bd2375c54d84967831bcc89eb455cc825c22f4e065035b3456b SOURCE.json -ab07a1b63c978192177ecd8a8d46f59d36883a1113b5c63005ac35db6936cd60 keel-policy/SKILL.md -6b449605b6b4fe6eb84f5b12befb90a57b7841d2973bbf9341cf40866e7dd81a keel-policy/examples/README.md +07a9182049a45069f411e9286304aa1fca00bcfa24272573631abb6680ee478a SOURCE.json +fc366f28d069cdccaf33d301d4054bd4ba494aa5ccc3d3e37e3b1bce382cf384 keel-policy/SKILL.md +8c893948ab615a69f28f7c97cd6bd9654bb025d38fbf396a8794077cc0cb98da keel-policy/examples/README.md 9a13b533704c1a37734bd6c28fc202c7acdaa8335773d55790dac50a693f8b2b keel-policy/examples/stripe-refund-approval-enterprise.json 2a52514e8db0901ab73e59b924f195008541d0069ebad9b514bd373cb905e2d2 keel-policy/examples/stripe-refund-approval.json +c2259a5a0cd31e31c579c442d34777e64a5bb32976f006318112fe774ecce91a keel-policy/examples/stripe-refund-owner-okta-level.json 49f43e551f32e484e263fa026dfd4fde5a8b50cd462f0f68e06ae371380f3b24 keel-policy/reference/enforceability-report.schema.json 8e818177237d6d99d5dd3867b60585160b3add4d17699c86c948b902328f9171 keel-policy/reference/field-provenance.json 5526029f8d79d7d2b31daed8ebeeb42942d0a18a0562a4a3789e8c8a7c83b14a keel-policy/reference/fields.md -8954c9b8c8af07cbb2576608575025d9d14588a55e32c3ee0e96858ab9df81b2 keel-policy/reference/policy-document.schema.json +eac892279165469de08cde1a90fe85d8aab50e94aecc743ad7d3ad21f3763ead keel-policy/reference/policy-document.schema.json 7d662cffa24744af7a26f62d813127b4bc0a44ff62f725c883054165ddec3272 keel-policy/scripts/consume_authoring_context.py d8a8ad9886f43efb6b5b7065ef167150b2c8b03f640cc8647f52680ae211e2eb keel-policy/scripts/validate_enforceability_report.py ff71e2933eb4ab5be18d5fa41eb324a376ffd460c39157ecd6db39bfc016ee44 keel-policy/tests/test_authoring_context_consumption.py 820069a6ce02f74dccc4f57a5788359b1377520330d00ba88471d60fec901f17 keel-policy/tests/test_basic_profile_fields.py 6bb3cfa21d826f95d790622b1dbee599c33ce262e2d5b41d2e9594b1ea830f0a keel-policy/tests/test_validate_enforceability_report.py -5aba155e2711a4bfd0241ce41ca97982effe53473764e669bcdfe9ea47aed4a7 keel-setup/SKILL.md +7ccf42764815510d57c36699ea2b5382fadffb33a0c3f8417e202eee10d81fcf keel-setup/SKILL.md 2b9c2490e921e83b83372a09e422a30f0f7ee338a2809b8e07edbd381d9eb650 keel-setup/reference/coverage.schema.json 70a69dcab29f61aaa3f96de5f65854fca63c4549ddc20d84ee00e102fc68c691 keel-setup/reference/integration_profiles.v1.json 9739501499b286d40f356af9c0378bbdcde41a364be083ccbc34adb000575160 keel-setup/reference/setup-state.schema.json @@ -33,19 +34,19 @@ d6638693e9cff6e01a82b304be447e42dd58b37ecce355c29938e378e67fab4a keel-setup/tes a891810ef4370ab3107627c972cfd66f18fa9554f5f2ff857312f0756c15a4f7 keel-setup/tests/test_execute_request_contract.py 6cb0fbad8e3e34ca65087c02f5498375cf91be7d86b0697401fcae27af4d89e0 keel-setup/tests/test_fast_first_run.py 9c3b0e8727848dfb52b499236b31c9a43e2a0649452c3df6783207ee12073c92 keel-setup/tests/test_inventory.py -a7a734c7a346ed297b4cbf412382269d3027df5441a3f48196b12a693ea664ca keel-setup/tests/test_post_proof_handoff.py +4bb260f8f9790d5c747d13af0660a033f54ee6bdba1f83bb589aa8e627c9d1d9 keel-setup/tests/test_post_proof_handoff.py af96ae9a32e470a2c1390ec452c13ae1c3657d7ed54c99925b0a57501503894b keel-setup/tests/test_prepare_voice.py c8006372327167f6317d7ae41d79da3c2dd45a7510f1cdc544616facd27d9d83 keel-setup/tests/test_setup_state.py ea797a44c033a6ce519b82595c858cdb0879868854b949226792f3bffe2d4ba3 keel-setup/tests/test_verify_execute.py ba172f0dcadea1b19f3279e3c3151dabc1719cdc65ddce77eb5c74550c101ce0 scripts/check_execute_contract.py -62f86699b30a07044abe6deb4e90451b0909005ae6c9e1f6aafb8300cf38581b scripts/check_release_bundle.py +ef23ea44dd1c88ef3bc9a4b0176792bf10d64d2a5cf2ab17dc9e5b457edff7dd scripts/check_release_bundle.py e0195765e2b9a31938a455fc81f93b02127f7b769948607b19a821f2bd82b2d1 shared/CONSTITUTION.md 6510e9f92c2a8fa3c40a2ca99eca06e2acaad146101c9526e06bb53f18085421 shared/feedback-report.schema.json 67ef5250861a9f1f3f2c3671205adc12dfa2e049ffd68449b78337d2ac490727 shared/feedback-report.template.md 378cd5a1c96810c36054553bde92c137deceec890a5c046a8e8d9a7bfecce51b shared/scripts/bounded_input.py e64ed436bc35d73cdad6366f2dd3f01530426cb529237d2990be07171c93b08c shared/scripts/schema_validation.py 0e15d2320554d19fddd24299afc807317c6313d7cd96c6fe0fd3dbaf25558fad shared/scripts/test_bounded_input.py -15cefd9bf0a20be746237f4970c4b95abf3ee6778442b43907dca4c5b85a0174 shared/scripts/test_schema_validation.py +cbc5bac12e8a633f12c18406e9414a42f3be904917a88a8f15fa1c557ae8656c shared/scripts/test_schema_validation.py 8f7c8bfd8ec6bc7faab7ea1341365ba67f31846232a2c3acac5f7c4bdaa3c411 shared/scripts/test_validate_feedback_report.py 696a0c609ef7895cfe3737942dc4e32feeeb870bbd23689fbeee965752498587 shared/scripts/validate_feedback_report.py 46a7d399e61d2aaa135d030455a75b704e9cbe028e604373c3ab5d6918876372 tools/public_surface.json diff --git a/SOURCE.json b/SOURCE.json index 3810a0e..451867b 100644 --- a/SOURCE.json +++ b/SOURCE.json @@ -1,7 +1,7 @@ { "bundle_schema_version": "keel.public_setup_bundle.v1", - "public_release_version": "2026-11-19.1", - "product_source_sha256": "64f2e92364468ae3140abb0e7798343712660ee755603fe0709e7ab306ca9b2a", + "public_release_version": "2026-12-01.1", + "product_source_sha256": "acfa113f987c459873afe76af46964f915be757ae02989f3a3f6d3a70a66f63b", "included_roots": [ "keel-policy", "keel-setup", diff --git a/keel-policy/SKILL.md b/keel-policy/SKILL.md index 16b6e26..838d7c8 100644 --- a/keel-policy/SKILL.md +++ b/keel-policy/SKILL.md @@ -482,6 +482,91 @@ has set another. You cannot see which, so never state a number as that project's project default belongs to a project owner or an organization owner or admin; the agent does not change it. +## How the approver proves who they are + +By default an approver proves who they are by signing in to Keel. A review rule can ask for a +stronger proof with an optional `verification` object. Leave it out and nothing changes: Keel +sign-in, no extra step. It is a user policy decision. Write it only when the user asks for it; +never add it as a protection of your own. + +**Where it goes.** The schema allows it in two places: + +- **Project owner review** (`require_attestation` with `attestor` exactly `project_owner`): + `require_attestation.verification`. It may ask for an Okta level, a security key, or both. No + other attestor can carry it. +- **Typed approvers** (`approval_requirement`, Enterprise): `approval_requirement.verification`. + An Okta level goes only on a `user` requirement, and Keel refuses it when the policy is saved + unless that user is the project owner. A security key may go on `org_role`, `approver_group`, + `team`, `user`, or `email`, never on `service_principal` (an API key has no security key). Both + together only on the owner's `user` requirement. + +**Never both on one rule.** A rule names `require_attestation` or `approval_requirement`, never +both. Keel refuses to save a rule that names both (422 `approval_requirement_ambiguous`), and a rule +saved that way before that check denies every request it matches (`policy.rule_denied`, detail +`approval_requirement_ambiguous`). For the project owner under `approval_requirement`, use type +`user` with the owner's user id. If an existing policy has such a rule, tell the user and keep only +`approval_requirement`; do not guess which one they meant to keep. + +An Okta-group review ("Your team" in the dashboard, approval type `idp_group`) takes an Okta level +only, on its `approval_requirement.verification`. This schema does not publish `idp_group`, so do +not write one: tell the user to set that review up in the dashboard. + +```json +"verification": { + "require": ["idp_level"], + "idp_level": { + "identity_source_id": "", + "identity_source_issuer": "", + "accepted_acr": ["phrh"] + } +} +``` + +`require` lists the checks; all of them must be met. Each listed check has its own object, and an +unlisted one must not. A security key is `"require": ["security_key"], "security_key": {}`. Its +only class is `hardware_attested`, so there is nothing to choose. `version` may be left out. + +**Okta level.** `accepted_acr` lists the levels Okta must report in its signed token for that +sign-in, such as `phr` (phishing-resistant) or `phrh` (phishing-resistant, hardware-protected). +Keel checks what Okta reports. It does not see the device the approver used, so Touch ID or a +passkey can meet a level only through Okta, if the user's Okta counts it at that level. The level +is met on the review sheet, so an approval from the dashboard or with an API key is refused. +`identity_source_id` and `identity_source_issuer` are facts about the user's own setup: ask for +them, never guess them. When the policy is saved Keel checks that the source is active in the +organization with exactly that issuer and that every level is one the source already accepts +(422 `policy.review_verification_invalid` if not). An owner with no operator link in that source +could never approve, so that rule is refused with 409 `policy.review_verification_unsatisfiable`. +A project with no organization cannot use a level. + +**Security key.** Each approval is signed with the approver's own registered hardware security key +over the exact approval terms, and Keel verifies the signature before the vote counts. It is +available in production. A deployment that has it switched off +(`KEEL_REVIEW_VERIFICATION_SECURITY_KEY_ENABLED`) refuses to save a rule that asks for it, with 422 +`policy.review_verification_invalid`. A rule nobody able to approve could meet, because none of +them has a usable key, is refused with 409 `policy.review_verification_unsatisfiable`. + +**Security key on every review.** That organization-wide setting is not part of a policy. Only an +organization owner can turn it on, in the dashboard. Never write a policy field for it. When it is +on, it applies to every review in the organization on top of the rule, and a rule cannot loosen +it. + +**What the Permit can prove.** A Permit approved with a security key carries the key's signature +over the approval terms and Keel's signed statement for that vote (the Permit, request, approver, +key, and that the key was active). keel-verifier 3.39.0 or later checks it offline. When the key's +registration evidence is present it also checks that the key is hardware. Its execution Permit +carries Keel's signed check that the key was still active at dispatch. This covers approvals made +after keel-api began exporting the proof (2026-12-01). Earlier security-key approvals cannot be +downloaded and read as missing approval proof. + +**Do not claim more than this.** That the key belongs to the approver rests on Keel's signed +statement, not on anything the verifier can check without Keel. A security key shows that a +registered key signed the terms. It does not show that the approver read them, or who held the +key. An Okta level is what Okta reported; Keel does not see the device. Only approving needs the +check; rejecting never does. + +In the readback, say what the approver will have to do, in words: "to approve, the project owner +must sign in through Okta at the phishing-resistant, hardware-protected level (`phrh`)". + ## What requires a user decision Three categories. Telling them apart is what keeps invention out of the document. @@ -740,6 +825,9 @@ Work this before showing anyone a draft. - [ ] **Availability.** Every threshold on a fallible fact is paired with a companion rule on `.state`, or its absence is stated in the handoff. A threshold alone is silent whenever Keel could not establish the value. +- [ ] **Review verification.** Any `verification` was asked for by the user, sits where the + schema allows it, and names an identity source the user gave you. No rule names both + `require_attestation` and `approval_requirement`. - [ ] **Examples.** Nothing carried over from an example file that this user did not ask for. Provenance catches invention; completeness catches silent omission. Faithfulness runs both ways: @@ -944,6 +1032,9 @@ and never allows customer deletion. `examples/stripe-refund-approval-enterprise. the same user decisions with an Enterprise-only `admin` organization-role approval requirement. Note the rule order — the deny and unavailable-state guard come before the amount branches — and that `$100` appears as `100000000`. +`examples/stripe-refund-owner-okta-level.json` sends every Stripe refund to the project owner, +who must sign in through Okta at level `phrh` to approve. Its identity source id and issuer are +placeholders for the user's own. **Every restriction in that file was explicitly requested by the user in that scenario.** It shows the JSON shape; it is not a menu of protections. Do not carry its deny rule, its $100 diff --git a/keel-policy/examples/README.md b/keel-policy/examples/README.md index 93fd3d3..a7f57f2 100644 --- a/keel-policy/examples/README.md +++ b/keel-policy/examples/README.md @@ -6,8 +6,13 @@ These are illustrations of the JSON shape, not a menu of protections. |---|---|---| | `stripe-refund-approval.json` | Production | `require_attestation` by the project owner | | `stripe-refund-approval-enterprise.json` | Enterprise | typed `approval_requirement` for the `admin` organization role | +| `stripe-refund-owner-okta-level.json` | Production | `require_attestation` by the project owner, who must sign in through Okta at level `phrh` | -Both refund examples pair every fallible `amount_usd_micros.value` comparison with +In `stripe-refund-owner-okta-level.json` the `identity_source_id` and `identity_source_issuer` are +placeholders. They stand for the user's own Keel identity source and must come from the user; never +copy or guess them. + +The two amount-based refund examples pair every fallible `amount_usd_micros.value` comparison with `amount_usd_micros.state == "present"` and route unavailable amounts to review. A non-USD or unpriced refund therefore cannot miss both amount rules and fall through to the policy default. diff --git a/keel-policy/examples/stripe-refund-owner-okta-level.json b/keel-policy/examples/stripe-refund-owner-okta-level.json new file mode 100644 index 0000000..32723bf --- /dev/null +++ b/keel-policy/examples/stripe-refund-owner-okta-level.json @@ -0,0 +1,41 @@ +{ + "name": "Stripe refunds with project-owner review at Okta level phrh (Production)", + "rules": [ + { + "if": { + "all": [ + { + "field": "context._keel.action_envelope.connector.identity.value", + "op": "eq", + "value": "stripe" + }, + { + "field": "context._keel.action_envelope.connector.tool_name.value", + "op": "in", + "value": [ + "create_refund", + "refund_payment" + ] + } + ] + }, + "action": "require_human_review", + "require_attestation": { + "attestor": "project_owner", + "timeout_seconds": 3600, + "verification": { + "require": [ + "idp_level" + ], + "idp_level": { + "identity_source_id": "00000000-0000-4000-8000-000000000000", + "identity_source_issuer": "https://example.okta.com", + "accepted_acr": [ + "phrh" + ] + } + } + } + } + ] +} diff --git a/keel-policy/reference/policy-document.schema.json b/keel-policy/reference/policy-document.schema.json index 9a41f1f..acc93cd 100644 --- a/keel-policy/reference/policy-document.schema.json +++ b/keel-policy/reference/policy-document.schema.json @@ -263,6 +263,17 @@ ], "default": null, "title": "User Id" + }, + "verification": { + "anyOf": [ + { + "$ref": "#/$defs/ReviewVerification" + }, + { + "type": "null" + } + ], + "default": null } }, "required": [ @@ -302,6 +313,23 @@ }, "user_id": { "type": "null" + }, + "verification": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/ReviewVerification", + "properties": { + "require": { + "const": [ + "security_key" + ] + } + } + } + ] } }, "required": [ @@ -337,6 +365,23 @@ }, "user_id": { "type": "null" + }, + "verification": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/ReviewVerification", + "properties": { + "require": { + "const": [ + "security_key" + ] + } + } + } + ] } }, "required": [ @@ -373,6 +418,23 @@ }, "user_id": { "type": "null" + }, + "verification": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/ReviewVerification", + "properties": { + "require": { + "const": [ + "security_key" + ] + } + } + } + ] } }, "required": [ @@ -408,6 +470,23 @@ }, "user_id": { "type": "null" + }, + "verification": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/ReviewVerification", + "properties": { + "require": { + "const": [ + "security_key" + ] + } + } + } + ] } }, "required": [ @@ -444,6 +523,23 @@ }, "user_id": { "type": "null" + }, + "verification": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/ReviewVerification", + "properties": { + "require": { + "const": [ + "security_key" + ] + } + } + } + ] } }, "required": [ @@ -514,6 +610,23 @@ }, "user_id": { "type": "null" + }, + "verification": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/ReviewVerification", + "properties": { + "require": { + "const": [ + "security_key" + ] + } + } + } + ] } }, "required": [ @@ -549,6 +662,9 @@ }, "user_id": { "type": "null" + }, + "verification": { + "type": "null" } }, "required": [ @@ -569,6 +685,17 @@ "exclusiveMinimum": 0, "title": "Timeout Seconds", "type": "integer" + }, + "verification": { + "anyOf": [ + { + "$ref": "#/$defs/ReviewVerification" + }, + { + "type": "null" + } + ], + "default": null } }, "required": [ @@ -576,7 +703,29 @@ "timeout_seconds" ], "title": "AttestationRequirement", - "type": "object" + "type": "object", + "oneOf": [ + { + "properties": { + "verification": { + "type": "null" + } + } + }, + { + "properties": { + "attestor": { + "const": "project_owner" + }, + "verification": { + "$ref": "#/$defs/ReviewVerification" + } + }, + "required": [ + "verification" + ] + } + ] }, "ConstrainMaxOutputTokensParams": { "additionalProperties": false, @@ -1729,6 +1878,170 @@ "title": "RequireHumanReviewRule", "type": "object" }, + "ReviewVerification": { + "additionalProperties": false, + "properties": { + "idp_level": { + "anyOf": [ + { + "$ref": "#/$defs/ReviewVerificationIdpLevel" + }, + { + "type": "null" + } + ], + "default": null + }, + "require": { + "items": { + "enum": [ + "idp_level", + "security_key" + ], + "type": "string" + }, + "maxItems": 2, + "minItems": 1, + "title": "Require", + "type": "array", + "uniqueItems": true + }, + "security_key": { + "anyOf": [ + { + "$ref": "#/$defs/ReviewVerificationSecurityKey" + }, + { + "type": "null" + } + ], + "default": null + }, + "version": { + "const": 1, + "default": 1, + "title": "Version", + "type": "integer" + } + }, + "required": [ + "require" + ], + "title": "ReviewVerification", + "type": "object", + "oneOf": [ + { + "properties": { + "require": { + "const": [ + "idp_level" + ] + }, + "idp_level": { + "$ref": "#/$defs/ReviewVerificationIdpLevel" + }, + "security_key": { + "type": "null" + } + }, + "required": [ + "idp_level" + ] + }, + { + "properties": { + "require": { + "const": [ + "security_key" + ] + }, + "idp_level": { + "type": "null" + }, + "security_key": { + "$ref": "#/$defs/ReviewVerificationSecurityKey" + } + }, + "required": [ + "security_key" + ] + }, + { + "properties": { + "require": { + "enum": [ + [ + "idp_level", + "security_key" + ], + [ + "security_key", + "idp_level" + ] + ] + }, + "idp_level": { + "$ref": "#/$defs/ReviewVerificationIdpLevel" + }, + "security_key": { + "$ref": "#/$defs/ReviewVerificationSecurityKey" + } + }, + "required": [ + "idp_level", + "security_key" + ] + } + ] + }, + "ReviewVerificationIdpLevel": { + "additionalProperties": false, + "properties": { + "accepted_acr": { + "items": { + "type": "string", + "pattern": "^[A-Za-z0-9:._/-]{1,128}$" + }, + "maxItems": 8, + "minItems": 1, + "title": "Accepted Acr", + "type": "array", + "uniqueItems": true + }, + "identity_source_id": { + "format": "uuid", + "title": "Identity Source Id", + "type": "string" + }, + "identity_source_issuer": { + "maxLength": 512, + "minLength": 1, + "title": "Identity Source Issuer", + "type": "string", + "pattern": "^\\S([\\s\\S]*\\S)?$" + } + }, + "required": [ + "identity_source_id", + "identity_source_issuer", + "accepted_acr" + ], + "title": "ReviewVerificationIdpLevel", + "type": "object" + }, + "ReviewVerificationSecurityKey": { + "additionalProperties": false, + "properties": { + "authenticator_class": { + "const": "hardware_attested", + "default": "hardware_attested", + "title": "Authenticator Class", + "type": "string" + } + }, + "title": "ReviewVerificationSecurityKey", + "type": "object" + }, "ThrottleIfRateExceedsParams": { "additionalProperties": false, "properties": { diff --git a/keel-setup/SKILL.md b/keel-setup/SKILL.md index 1b3ae7e..ec404f1 100644 --- a/keel-setup/SKILL.md +++ b/keel-setup/SKILL.md @@ -544,7 +544,11 @@ Keel used your first policy for this test. Ask questions, share feedback, and hear what we're building next. -**[Join the Keel Slack · Talk directly with the Keel team](https://join.slack.com/t/keel-rsh2729/shared_invite/zt-4b8kk23mc-aivLoo7uiFYPQwP6AkQmfQ)** +**[Request a Slack invite · Talk directly with the Keel team](mailto:hello@keelapi.com?subject=Keel%20Slack%20invite%20request&body=Name%3A%20%0AEmail%20to%20invite%3A%20%0AWhy%20you%27d%20like%20to%20join%20%28optional%29%3A%20)** + +We review each request and email you an individual invitation if approved. If the link doesn't open +your email, write to hello@keelapi.com with the subject "Keel Slack invite request", your name, the +email you'd like invited, and, optionally, why you'd like to join. Follow along: [X](https://x.com/KeelAPIHQ) · [LinkedIn](https://www.linkedin.com/company/keelapi/) @@ -577,7 +581,9 @@ bypasses, and never say Keel or this skill turned the policy on. Offer the three success response is not a policy interview. The stay-connected invitation belongs only in this successful proof block. It must not appear at a -human gate or after a failed or ambiguous proof. Use the official Slack invite in the successful proof block. +human gate or after a failed or ambiguous proof. Use the Slack invite request in the successful proof block, +exactly as written. Never link a Slack join or shared-invite URL: each invitation is sent individually +after a Keel admin reviews the request. ### `verification details` — the technical layer diff --git a/keel-setup/tests/test_post_proof_handoff.py b/keel-setup/tests/test_post_proof_handoff.py index 46497fb..e58682f 100644 --- a/keel-setup/tests/test_post_proof_handoff.py +++ b/keel-setup/tests/test_post_proof_handoff.py @@ -115,17 +115,26 @@ def test_stay_connected_is_optional_and_only_after_success(self): self.assertLess(self.block.index("**Stay connected with Keel**"), self.block.index("**Now make it yours.**")) self.assertIn( - "**[Join the Keel Slack · Talk directly with the Keel team]" - "(https://join.slack.com/t/keel-rsh2729/shared_invite/" - "zt-4b8kk23mc-aivLoo7uiFYPQwP6AkQmfQ)**", + "**[Request a Slack invite · Talk directly with the Keel team]" + "(mailto:hello@keelapi.com?subject=Keel%20Slack%20invite%20request" + "&body=Name%3A%20%0AEmail%20to%20invite%3A%20%0A" + "Why%20you%27d%20like%20to%20join%20%28optional%29%3A%20)**", self.block, ) + self.assertIn( + "We review each request and email you an individual invitation if approved.", + self.block, + ) + self.assertNotIn("slack.com", self.skill) + self.assertNotIn("shared_invite", self.skill) + self.assertNotIn("Join the Keel Slack", self.skill) self.assertNotIn("invite link not yet available", self.block) self.assertIn("[X](https://x.com/KeelAPIHQ)", self.block) self.assertIn("[LinkedIn](https://www.linkedin.com/company/keelapi/)", self.block) guidance = _slice(self.skill, "The stay-connected invitation belongs", "### `verification details`") self.assertIn("must not appear at a\nhuman gate or after a failed or ambiguous proof", guidance) - self.assertIn("Use the official Slack invite in the successful proof block", guidance) + self.assertIn("Use the Slack invite request in the successful proof block", guidance) + self.assertIn("Never link a Slack join or shared-invite URL", guidance) def test_default_response_offers_the_technical_layer_without_showing_it(self): self.assertIn( diff --git a/scripts/check_release_bundle.py b/scripts/check_release_bundle.py index ec2df97..4e3b3fa 100644 --- a/scripts/check_release_bundle.py +++ b/scripts/check_release_bundle.py @@ -11,8 +11,8 @@ ROOT = Path(__file__).resolve().parents[1] -PUBLIC_RELEASE_VERSION = "2026-11-19.1" -PRODUCT_SOURCE_SHA256 = "64f2e92364468ae3140abb0e7798343712660ee755603fe0709e7ab306ca9b2a" +PUBLIC_RELEASE_VERSION = "2026-12-01.1" +PRODUCT_SOURCE_SHA256 = "acfa113f987c459873afe76af46964f915be757ae02989f3a3f6d3a70a66f63b" PUBLICATION_LAYER_FILES = [ ".github/workflows/ci.yml", ".gitignore", @@ -40,6 +40,7 @@ "keel-policy/SKILL.md", "keel-policy/examples/README.md", "keel-policy/examples/stripe-refund-approval-enterprise.json", + "keel-policy/examples/stripe-refund-owner-okta-level.json", "keel-policy/examples/stripe-refund-approval.json", "keel-policy/reference/enforceability-report.schema.json", "keel-policy/reference/field-provenance.json", diff --git a/shared/scripts/test_schema_validation.py b/shared/scripts/test_schema_validation.py index b0ac942..abeceef 100644 --- a/shared/scripts/test_schema_validation.py +++ b/shared/scripts/test_schema_validation.py @@ -43,6 +43,59 @@ def test_cost_windows_are_exactly_the_ones_keel_accepts(self): for window in ("second", "per_second", "hour", "rolling_hour", "yearly"): self.assertTrue(schema_validation.validate({"window": window, "cap_micros": 100}, schema), window) + def test_review_verification_matches_where_keel_accepts_it(self): + root = pathlib.Path(__file__).resolve().parents[2] + policy_schema = json.loads((root / "keel-policy/reference/policy-document.schema.json").read_text()) + defs = policy_schema["$defs"] + identifier = "12345678-1234-4234-8234-123456789abc" + level = {"identity_source_id": identifier, "identity_source_issuer": "https://example.okta.com", + "accepted_acr": ["phrh"]} + idp = {"require": ["idp_level"], "idp_level": level} + key = {"require": ["security_key"], "security_key": {}} + both = {"require": ["security_key", "idp_level"], "idp_level": level, "security_key": {}} + + def ok(payload, name): + return schema_validation.validate(payload, defs[name], root_schema=policy_schema) == [] + + for verification in (idp, key, both, {**key, "version": 1, "idp_level": None}, + {"require": ["security_key"], "security_key": {"authenticator_class": "hardware_attested"}}, + {"require": ["idp_level"], "idp_level": {**level, "accepted_acr": ["phr", "urn:okta:loa:2fa:any"]}}): + self.assertTrue(ok(verification, "ReviewVerification"), verification) + for verification in ({"require": []}, {"require": ["idp_level"]}, {"require": ["security_key"]}, + {"require": ["webauthn"]}, {**idp, "security_key": {}}, {**key, "version": 2}, + {"require": ["idp_level", "idp_level"], "idp_level": level}, {**key, "unexpected": 1}, + {"require": ["security_key"], "security_key": {"authenticator_class": "platform"}}, + {"require": ["idp_level"], "idp_level": {**level, "accepted_acr": []}}, + {"require": ["idp_level"], "idp_level": {**level, "accepted_acr": ["phr", "phr"]}}, + {"require": ["idp_level"], "idp_level": {**level, "accepted_acr": ["ph rh"]}}, + {"require": ["idp_level"], "idp_level": {**level, "identity_source_issuer": " https://example.okta.com"}}, + {"require": ["idp_level"], "idp_level": {**level, "identity_source_id": "not-a-uuid"}}): + self.assertFalse(ok(verification, "ReviewVerification"), verification) + + # Owner review: only attestor project_owner carries verification. + for verification in (idp, key, both): + self.assertTrue(ok({"attestor": "project_owner", "timeout_seconds": 60, + "verification": verification}, "AttestationRequirement")) + self.assertFalse(ok({"attestor": "security_team", "timeout_seconds": 60, + "verification": verification}, "AttestationRequirement")) + self.assertTrue(ok({"attestor": "security_team", "timeout_seconds": 60}, "AttestationRequirement")) + + # Typed approvers: a level only on user; a key on any person type. + selectors = {"org_role": ("role", "admin"), "approver_group": ("group_id", identifier), + "team": ("team_slug", "reviewers"), "user": ("user_id", identifier), + "email": ("email", "review@example.invalid"), + "service_principal": ("service_principal_id", identifier)} + for kind, (selector, value) in selectors.items(): + base = {"type": kind, "timeout_seconds": 60, selector: value} + self.assertTrue(ok(base, "ApprovalRequirement"), kind) + self.assertEqual(ok({**base, "verification": idp}, "ApprovalRequirement"), kind == "user", kind) + self.assertEqual(ok({**base, "verification": both}, "ApprovalRequirement"), kind == "user", kind) + self.assertEqual(ok({**base, "verification": key}, "ApprovalRequirement"), + kind != "service_principal", kind) + + example = json.loads((root / "keel-policy/examples/stripe-refund-owner-okta-level.json").read_text()) + self.assertEqual(schema_validation.validate(example, policy_schema), []) + def test_date_time_requires_an_unambiguous_rfc3339_instant(self): schema = {"type": "string", "format": "date-time"} for value in ("2026-11-06T12:00:00", "20261106T120000Z", "2026-11-06T12:00Z",