|
| 1 | +{ |
| 2 | + "title": "RelayEnforcementPolicy", |
| 3 | + "description": "Type-validation schema for enforcement policies, derived from the Rust RelayEnforcementPolicy struct", |
| 4 | + "type": "object", |
| 5 | + "required": ["policy_version", "policy_id", "policy_scope", "rules"], |
| 6 | + "additionalProperties": false, |
| 7 | + "properties": { |
| 8 | + "policy_version": { "type": "string" }, |
| 9 | + "policy_id": { "type": "string" }, |
| 10 | + "policy_scope": { |
| 11 | + "type": "string", |
| 12 | + "enum": ["RELAY_GLOBAL"] |
| 13 | + }, |
| 14 | + "model_profile_allowlist": { |
| 15 | + "type": "array", |
| 16 | + "items": { "type": "string" }, |
| 17 | + "default": [] |
| 18 | + }, |
| 19 | + "provider_allowlist": { |
| 20 | + "type": "array", |
| 21 | + "items": { "type": "string" }, |
| 22 | + "default": [] |
| 23 | + }, |
| 24 | + "max_output_tokens": { |
| 25 | + "type": ["integer", "null"], |
| 26 | + "minimum": 1 |
| 27 | + }, |
| 28 | + "rules": { |
| 29 | + "type": "array", |
| 30 | + "items": { "$ref": "#/definitions/EnforcementRule" } |
| 31 | + }, |
| 32 | + "entropy_constraints": { |
| 33 | + "oneOf": [ |
| 34 | + { "$ref": "#/definitions/EntropyConstraints" }, |
| 35 | + { "type": "null" } |
| 36 | + ] |
| 37 | + } |
| 38 | + }, |
| 39 | + "definitions": { |
| 40 | + "EnforcementRule": { |
| 41 | + "type": "object", |
| 42 | + "required": ["rule_id", "type", "value", "scope", "classification"], |
| 43 | + "additionalProperties": false, |
| 44 | + "properties": { |
| 45 | + "rule_id": { "type": "string" }, |
| 46 | + "type": { |
| 47 | + "type": "string", |
| 48 | + "enum": ["unicode_category_reject"] |
| 49 | + }, |
| 50 | + "value": { "type": "string" }, |
| 51 | + "scope": { "$ref": "#/definitions/RuleScope" }, |
| 52 | + "classification": { "$ref": "#/definitions/EnforcementClass" } |
| 53 | + } |
| 54 | + }, |
| 55 | + "RuleScope": { |
| 56 | + "type": "object", |
| 57 | + "required": ["kind"], |
| 58 | + "additionalProperties": false, |
| 59 | + "properties": { |
| 60 | + "kind": { |
| 61 | + "type": "string", |
| 62 | + "enum": ["all_string_values"] |
| 63 | + }, |
| 64 | + "skip_keys": { |
| 65 | + "type": "array", |
| 66 | + "items": { "type": "string" }, |
| 67 | + "default": [] |
| 68 | + } |
| 69 | + } |
| 70 | + }, |
| 71 | + "EntropyConstraints": { |
| 72 | + "type": "object", |
| 73 | + "required": ["budget_bits", "classification"], |
| 74 | + "additionalProperties": false, |
| 75 | + "properties": { |
| 76 | + "budget_bits": { "type": "integer", "minimum": 0 }, |
| 77 | + "classification": { "$ref": "#/definitions/EnforcementClass" }, |
| 78 | + "review_trigger_pct": { |
| 79 | + "type": ["integer", "null"], |
| 80 | + "minimum": 0, |
| 81 | + "maximum": 100 |
| 82 | + } |
| 83 | + } |
| 84 | + }, |
| 85 | + "EnforcementClass": { |
| 86 | + "type": "string", |
| 87 | + "enum": ["GATE", "ADVISORY"] |
| 88 | + } |
| 89 | + } |
| 90 | +} |
0 commit comments