raxe 0.4.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- raxe/__init__.py +101 -0
- raxe/application/__init__.py +48 -0
- raxe/application/ab_testing.py +170 -0
- raxe/application/analytics/__init__.py +30 -0
- raxe/application/analytics/achievement_service.py +444 -0
- raxe/application/analytics/repositories.py +172 -0
- raxe/application/analytics/retention_service.py +267 -0
- raxe/application/analytics/statistics_service.py +419 -0
- raxe/application/analytics/streak_service.py +283 -0
- raxe/application/apply_policy.py +291 -0
- raxe/application/eager_l2.py +503 -0
- raxe/application/preloader.py +353 -0
- raxe/application/scan_merger.py +321 -0
- raxe/application/scan_pipeline.py +1059 -0
- raxe/application/scan_pipeline_async.py +403 -0
- raxe/application/session_tracker.py +458 -0
- raxe/application/telemetry_manager.py +357 -0
- raxe/application/telemetry_orchestrator.py +1210 -0
- raxe/async_sdk/__init__.py +34 -0
- raxe/async_sdk/cache.py +286 -0
- raxe/async_sdk/client.py +556 -0
- raxe/async_sdk/wrappers/__init__.py +23 -0
- raxe/async_sdk/wrappers/openai.py +238 -0
- raxe/cli/__init__.py +21 -0
- raxe/cli/auth.py +1047 -0
- raxe/cli/branding.py +235 -0
- raxe/cli/config.py +334 -0
- raxe/cli/custom_rules.py +458 -0
- raxe/cli/doctor.py +686 -0
- raxe/cli/error_handler.py +665 -0
- raxe/cli/event.py +648 -0
- raxe/cli/exit_codes.py +57 -0
- raxe/cli/expiry_warning.py +302 -0
- raxe/cli/export.py +183 -0
- raxe/cli/history.py +247 -0
- raxe/cli/l2_formatter.py +872 -0
- raxe/cli/main.py +1137 -0
- raxe/cli/models.py +590 -0
- raxe/cli/output.py +403 -0
- raxe/cli/privacy.py +84 -0
- raxe/cli/profiler.py +262 -0
- raxe/cli/progress.py +379 -0
- raxe/cli/progress_context.py +101 -0
- raxe/cli/repl.py +394 -0
- raxe/cli/rules.py +542 -0
- raxe/cli/setup_wizard.py +721 -0
- raxe/cli/stats.py +292 -0
- raxe/cli/suppress.py +501 -0
- raxe/cli/telemetry.py +1384 -0
- raxe/cli/test.py +130 -0
- raxe/cli/tune.py +315 -0
- raxe/cli/validate.py +218 -0
- raxe/domain/__init__.py +30 -0
- raxe/domain/analytics/__init__.py +97 -0
- raxe/domain/analytics/achievements.py +306 -0
- raxe/domain/analytics/models.py +120 -0
- raxe/domain/analytics/retention.py +168 -0
- raxe/domain/analytics/statistics.py +207 -0
- raxe/domain/analytics/streaks.py +173 -0
- raxe/domain/engine/__init__.py +15 -0
- raxe/domain/engine/executor.py +396 -0
- raxe/domain/engine/matcher.py +212 -0
- raxe/domain/inline_suppression.py +176 -0
- raxe/domain/ml/__init__.py +133 -0
- raxe/domain/ml/embedding_cache.py +309 -0
- raxe/domain/ml/gemma_detector.py +921 -0
- raxe/domain/ml/gemma_models.py +346 -0
- raxe/domain/ml/l2_config.py +428 -0
- raxe/domain/ml/l2_output_schema.py +443 -0
- raxe/domain/ml/manifest_loader.py +309 -0
- raxe/domain/ml/manifest_schema.py +345 -0
- raxe/domain/ml/model_metadata.py +263 -0
- raxe/domain/ml/model_registry.py +786 -0
- raxe/domain/ml/protocol.py +282 -0
- raxe/domain/ml/scoring_models.py +419 -0
- raxe/domain/ml/stub_detector.py +397 -0
- raxe/domain/ml/threat_scorer.py +757 -0
- raxe/domain/ml/tokenizer_registry.py +372 -0
- raxe/domain/ml/voting/__init__.py +89 -0
- raxe/domain/ml/voting/config.py +595 -0
- raxe/domain/ml/voting/engine.py +465 -0
- raxe/domain/ml/voting/head_voters.py +378 -0
- raxe/domain/ml/voting/models.py +222 -0
- raxe/domain/models.py +82 -0
- raxe/domain/packs/__init__.py +17 -0
- raxe/domain/packs/models.py +304 -0
- raxe/domain/policies/__init__.py +20 -0
- raxe/domain/policies/evaluator.py +212 -0
- raxe/domain/policies/models.py +223 -0
- raxe/domain/rules/__init__.py +32 -0
- raxe/domain/rules/custom.py +286 -0
- raxe/domain/rules/models.py +273 -0
- raxe/domain/rules/schema.py +166 -0
- raxe/domain/rules/validator.py +556 -0
- raxe/domain/suppression.py +801 -0
- raxe/domain/suppression_factory.py +174 -0
- raxe/domain/telemetry/__init__.py +116 -0
- raxe/domain/telemetry/backpressure.py +424 -0
- raxe/domain/telemetry/event_creator.py +362 -0
- raxe/domain/telemetry/events.py +1282 -0
- raxe/domain/telemetry/priority.py +263 -0
- raxe/domain/telemetry/scan_telemetry_builder.py +670 -0
- raxe/infrastructure/__init__.py +25 -0
- raxe/infrastructure/analytics/__init__.py +18 -0
- raxe/infrastructure/analytics/aggregator.py +484 -0
- raxe/infrastructure/analytics/aggregator_optimized.py +184 -0
- raxe/infrastructure/analytics/engine.py +748 -0
- raxe/infrastructure/analytics/repository.py +409 -0
- raxe/infrastructure/analytics/streaks.py +467 -0
- raxe/infrastructure/analytics/views.py +178 -0
- raxe/infrastructure/cloud/__init__.py +9 -0
- raxe/infrastructure/config/__init__.py +56 -0
- raxe/infrastructure/config/endpoints.py +641 -0
- raxe/infrastructure/config/scan_config.py +352 -0
- raxe/infrastructure/config/yaml_config.py +459 -0
- raxe/infrastructure/database/__init__.py +10 -0
- raxe/infrastructure/database/connection.py +200 -0
- raxe/infrastructure/database/models.py +325 -0
- raxe/infrastructure/database/scan_history.py +764 -0
- raxe/infrastructure/ml/__init__.py +0 -0
- raxe/infrastructure/ml/download_progress.py +438 -0
- raxe/infrastructure/ml/model_downloader.py +457 -0
- raxe/infrastructure/models/__init__.py +16 -0
- raxe/infrastructure/models/discovery.py +461 -0
- raxe/infrastructure/packs/__init__.py +13 -0
- raxe/infrastructure/packs/loader.py +407 -0
- raxe/infrastructure/packs/registry.py +381 -0
- raxe/infrastructure/policies/__init__.py +16 -0
- raxe/infrastructure/policies/api_client.py +256 -0
- raxe/infrastructure/policies/validator.py +227 -0
- raxe/infrastructure/policies/yaml_loader.py +250 -0
- raxe/infrastructure/rules/__init__.py +18 -0
- raxe/infrastructure/rules/custom_loader.py +224 -0
- raxe/infrastructure/rules/versioning.py +222 -0
- raxe/infrastructure/rules/yaml_loader.py +286 -0
- raxe/infrastructure/security/__init__.py +31 -0
- raxe/infrastructure/security/auth.py +145 -0
- raxe/infrastructure/security/policy_validator.py +124 -0
- raxe/infrastructure/security/signatures.py +171 -0
- raxe/infrastructure/suppression/__init__.py +36 -0
- raxe/infrastructure/suppression/composite_repository.py +154 -0
- raxe/infrastructure/suppression/sqlite_repository.py +231 -0
- raxe/infrastructure/suppression/yaml_composite_repository.py +156 -0
- raxe/infrastructure/suppression/yaml_repository.py +510 -0
- raxe/infrastructure/telemetry/__init__.py +79 -0
- raxe/infrastructure/telemetry/acquisition.py +179 -0
- raxe/infrastructure/telemetry/config.py +254 -0
- raxe/infrastructure/telemetry/credential_store.py +947 -0
- raxe/infrastructure/telemetry/dual_queue.py +1123 -0
- raxe/infrastructure/telemetry/flush_helper.py +343 -0
- raxe/infrastructure/telemetry/flush_scheduler.py +776 -0
- raxe/infrastructure/telemetry/health_client.py +394 -0
- raxe/infrastructure/telemetry/hook.py +347 -0
- raxe/infrastructure/telemetry/queue.py +520 -0
- raxe/infrastructure/telemetry/sender.py +476 -0
- raxe/infrastructure/tracking/__init__.py +13 -0
- raxe/infrastructure/tracking/usage.py +389 -0
- raxe/integrations/__init__.py +55 -0
- raxe/integrations/availability.py +143 -0
- raxe/integrations/registry.py +122 -0
- raxe/integrations/utils.py +135 -0
- raxe/mcp/__init__.py +62 -0
- raxe/mcp/cli.py +97 -0
- raxe/mcp/server.py +409 -0
- raxe/monitoring/__init__.py +51 -0
- raxe/monitoring/metrics.py +372 -0
- raxe/monitoring/profiler.py +388 -0
- raxe/monitoring/server.py +136 -0
- raxe/packs/core/v1.0.0/pack.yaml +1394 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-001@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-006@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-014@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-017@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-022@1.0.0.yaml +67 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-023@1.0.0.yaml +91 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-024@1.0.0.yaml +80 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-025@1.0.0.yaml +81 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-026@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-027@1.0.0.yaml +77 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-028@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-029@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-030@1.0.0.yaml +55 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-033@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-034@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-035@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-046@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-047@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-048@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-049@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-050@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-068@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-078@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-2001@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-2004@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-201@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-202@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-203@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3007@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3016@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3026@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3027@1.0.0.yaml +64 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3028@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3029@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3030@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3031@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3032@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3033@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3034@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-79@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-80@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-81@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-82@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-83@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-84@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-85@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-86@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-87@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-88@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-89@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-90@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-91@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-92@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-93@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-94@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-95@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-96@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-97@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-98@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-007@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-015@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-016@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-017@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-021@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-022@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-023@1.0.0.yaml +78 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-024@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-025@1.0.0.yaml +93 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-026@1.0.0.yaml +81 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-027@1.0.0.yaml +82 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-028@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-033@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-036@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-037@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-052@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-054@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-056@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-065@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-075@1.0.0.yaml +45 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-079@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1080@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1090@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1104@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1105@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1112@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-201@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-202@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-203@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-204@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-205@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-206@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-207@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-208@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-209@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-210@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-211@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-212@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-213@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-214@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-215@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-216@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-217@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-218@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-219@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-220@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-221@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-222@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-223@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-224@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-225@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-226@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-227@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-228@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-229@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-230@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-231@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-232@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-233@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-234@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-235@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-236@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-237@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-238@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-013@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-019@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-020@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-024@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-029@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-038@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-044@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-067@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-069@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-100@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-101@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-102@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-103@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-104@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-105@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-106@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-107@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-108@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-109@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-110@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-111@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-112@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-113@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-114@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-115@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-116@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-117@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-118@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-119@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-120@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-201@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-203@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3004@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3006@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3011@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-5016@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-6001@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-6002@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-70@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-71@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-72@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-73@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-74@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-75@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-76@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-77@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-78@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-79@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-80@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-81@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-82@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-83@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-84@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-85@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-86@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-87@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-88@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-89@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-90@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-91@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-92@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-93@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-94@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-95@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-96@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-97@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-98@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-99@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-001@1.0.0.yaml +73 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-002@1.0.0.yaml +71 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-003@1.0.0.yaml +65 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-004@1.0.0.yaml +73 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-101@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-102@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-103@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-104@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-105@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-106@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-107@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-108@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-109@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-110@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-111@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-112@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-113@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-114@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-115@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-116@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-117@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-118@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-119@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-120@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-121@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-122@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-123@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-124@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-125@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-126@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-127@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-128@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-129@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-130@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-131@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-132@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-133@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-134@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-135@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-136@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-137@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-138@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-139@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-140@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-141@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-142@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-143@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-144@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-145@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-146@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-147@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-148@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-149@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-150@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-151@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-152@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-153@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-154@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-155@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-156@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-157@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-158@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-159@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-160@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-161@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-001@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-009@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-020@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-021@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-022@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-028@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-033@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-034@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-036@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-039@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-056@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-066@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-076@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-098@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-103@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-104@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-105@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-110@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-111@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-112@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-113@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-114@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-115@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-116@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-117@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-118@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-119@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-120@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-121@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-122@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-123@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-124@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-125@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-126@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-127@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-128@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-129@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-130@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-131@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-132@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-133@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-134@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-135@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-136@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-137@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-138@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-139@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-140@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-141@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-142@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-143@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-144@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-145@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-146@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-147@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-148@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-149@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-150@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-151@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-152@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-153@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-154@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-155@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-156@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-157@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-158@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-159@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-160@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-161@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-162@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-201@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-203@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-204@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-205@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-206@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-207@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-009@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-012@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-017@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-022@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-025@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-027@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-028@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-034@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-037@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-040@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-041@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-044@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-050@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-051@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-052@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-053@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-054@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-055@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-056@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-058@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2015@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2025@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2026@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2035@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2037@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2042@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3001@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3002@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3003@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3004@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3005@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3006@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3007@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3008@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3009@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3010@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3011@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3012@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3013@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3014@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3015@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3016@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3017@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3018@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3019@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3020@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3021@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3022@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3023@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3024@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3025@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3026@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3027@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3028@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3029@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3030@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3031@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3032@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3033@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3034@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3035@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3036@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3037@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3038@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3039@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3040@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3041@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3042@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3043@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3044@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3045@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3046@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3047@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3048@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3049@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3050@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3051@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3052@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3053@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3054@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3055@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3056@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3057@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3058@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3059@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3060@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3061@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3062@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3063@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3064@1.0.0.yaml +78 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3065@1.0.0.yaml +84 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3066@1.0.0.yaml +84 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3067@1.0.0.yaml +88 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3068@1.0.0.yaml +94 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3069@1.0.0.yaml +90 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3070@1.0.0.yaml +99 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3071@1.0.0.yaml +91 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3072@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3073@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3074@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3075@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3076@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3077@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3078@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3079@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3080@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3081@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3082@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3083@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3084@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3085@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-016@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-028@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-042@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-044@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-045@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-050@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-201@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3001@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3006@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3009@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3012@1.0.0.yaml +41 -0
- raxe/plugins/__init__.py +98 -0
- raxe/plugins/custom_rules.py +380 -0
- raxe/plugins/loader.py +389 -0
- raxe/plugins/manager.py +538 -0
- raxe/plugins/protocol.py +428 -0
- raxe/py.typed +0 -0
- raxe/sdk/__init__.py +77 -0
- raxe/sdk/agent_scanner.py +1918 -0
- raxe/sdk/client.py +1603 -0
- raxe/sdk/decorator.py +175 -0
- raxe/sdk/exceptions.py +859 -0
- raxe/sdk/integrations/__init__.py +277 -0
- raxe/sdk/integrations/agent_scanner.py +71 -0
- raxe/sdk/integrations/autogen.py +872 -0
- raxe/sdk/integrations/crewai.py +1368 -0
- raxe/sdk/integrations/dspy.py +845 -0
- raxe/sdk/integrations/extractors.py +363 -0
- raxe/sdk/integrations/huggingface.py +395 -0
- raxe/sdk/integrations/langchain.py +948 -0
- raxe/sdk/integrations/litellm.py +484 -0
- raxe/sdk/integrations/llamaindex.py +1049 -0
- raxe/sdk/integrations/portkey.py +831 -0
- raxe/sdk/suppression_context.py +215 -0
- raxe/sdk/wrappers/__init__.py +163 -0
- raxe/sdk/wrappers/anthropic.py +310 -0
- raxe/sdk/wrappers/openai.py +221 -0
- raxe/sdk/wrappers/vertexai.py +484 -0
- raxe/utils/__init__.py +12 -0
- raxe/utils/error_sanitizer.py +135 -0
- raxe/utils/logging.py +241 -0
- raxe/utils/performance.py +414 -0
- raxe/utils/profiler.py +339 -0
- raxe/utils/validators.py +170 -0
- raxe-0.4.6.dist-info/METADATA +471 -0
- raxe-0.4.6.dist-info/RECORD +668 -0
- raxe-0.4.6.dist-info/WHEEL +5 -0
- raxe-0.4.6.dist-info/entry_points.txt +2 -0
- raxe-0.4.6.dist-info/licenses/LICENSE +56 -0
- raxe-0.4.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"""Inline suppression types for SDK scan() method.
|
|
2
|
+
|
|
3
|
+
This module provides PURE domain types for inline suppressions passed
|
|
4
|
+
directly to scan() calls. These are separate from file-based suppressions
|
|
5
|
+
(.raxe/suppressions.yaml) and take precedence over them.
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
# Simple list of patterns
|
|
9
|
+
result = raxe.scan(text, suppress=["pi-001", "jb-*"])
|
|
10
|
+
|
|
11
|
+
# With action override
|
|
12
|
+
result = raxe.scan(text, suppress=[
|
|
13
|
+
"pi-001", # Default SUPPRESS action
|
|
14
|
+
{"pattern": "jb-*", "action": "FLAG", "reason": "Under review"}
|
|
15
|
+
])
|
|
16
|
+
|
|
17
|
+
Clean Architecture:
|
|
18
|
+
- This is PURE domain logic
|
|
19
|
+
- No I/O, no file access, no logging
|
|
20
|
+
- Converts inline specs to Suppression objects
|
|
21
|
+
"""
|
|
22
|
+
from dataclasses import dataclass
|
|
23
|
+
from datetime import datetime, timezone
|
|
24
|
+
from typing import Any, TypeAlias
|
|
25
|
+
|
|
26
|
+
from raxe.domain.suppression import (
|
|
27
|
+
Suppression,
|
|
28
|
+
SuppressionAction,
|
|
29
|
+
SuppressionValidationError,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
# Type alias for inline suppression specification
|
|
33
|
+
# Can be either a string pattern or a dict with pattern, action, reason
|
|
34
|
+
InlineSuppressionSpec: TypeAlias = str | dict[str, Any]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass(frozen=True)
|
|
38
|
+
class InlineSuppressionConfig:
|
|
39
|
+
"""Configuration for an inline suppression.
|
|
40
|
+
|
|
41
|
+
Represents a suppression passed directly to scan() rather than
|
|
42
|
+
loaded from a configuration file.
|
|
43
|
+
|
|
44
|
+
Attributes:
|
|
45
|
+
pattern: Rule ID pattern (supports wildcards: pi-*, jb-*)
|
|
46
|
+
action: Action to take when matched (default: SUPPRESS)
|
|
47
|
+
reason: Optional reason for suppression
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
pattern: str
|
|
51
|
+
action: SuppressionAction = SuppressionAction.SUPPRESS
|
|
52
|
+
reason: str = "Inline suppression"
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def parse_inline_suppression(spec: InlineSuppressionSpec) -> Suppression:
|
|
56
|
+
"""Parse an inline suppression specification into a Suppression object.
|
|
57
|
+
|
|
58
|
+
Accepts either:
|
|
59
|
+
- String pattern: "pi-001" or "jb-*"
|
|
60
|
+
- Dict with full config: {"pattern": "jb-*", "action": "FLAG", "reason": "..."}
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
spec: Inline suppression specification
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
Suppression object ready for use
|
|
67
|
+
|
|
68
|
+
Raises:
|
|
69
|
+
SuppressionValidationError: If specification is invalid
|
|
70
|
+
"""
|
|
71
|
+
if isinstance(spec, str):
|
|
72
|
+
# Simple string pattern - default to SUPPRESS action
|
|
73
|
+
return Suppression(
|
|
74
|
+
pattern=spec,
|
|
75
|
+
reason="Inline suppression",
|
|
76
|
+
action=SuppressionAction.SUPPRESS,
|
|
77
|
+
created_at=datetime.now(timezone.utc).isoformat(),
|
|
78
|
+
created_by="inline",
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
if isinstance(spec, dict):
|
|
82
|
+
# Dict with full config
|
|
83
|
+
pattern = spec.get("pattern")
|
|
84
|
+
if not pattern:
|
|
85
|
+
raise SuppressionValidationError(
|
|
86
|
+
"Inline suppression dict must have 'pattern' key"
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
# Parse action
|
|
90
|
+
action_str = spec.get("action", "SUPPRESS")
|
|
91
|
+
if isinstance(action_str, SuppressionAction):
|
|
92
|
+
action = action_str
|
|
93
|
+
else:
|
|
94
|
+
try:
|
|
95
|
+
action = SuppressionAction(str(action_str).upper())
|
|
96
|
+
except ValueError:
|
|
97
|
+
valid_actions = [a.value for a in SuppressionAction]
|
|
98
|
+
raise SuppressionValidationError(
|
|
99
|
+
f"Invalid action '{action_str}'. "
|
|
100
|
+
f"Valid actions: {', '.join(valid_actions)}"
|
|
101
|
+
) from None
|
|
102
|
+
|
|
103
|
+
# Get reason (optional, has default)
|
|
104
|
+
reason = spec.get("reason", "Inline suppression")
|
|
105
|
+
if not reason:
|
|
106
|
+
reason = "Inline suppression"
|
|
107
|
+
|
|
108
|
+
return Suppression(
|
|
109
|
+
pattern=str(pattern),
|
|
110
|
+
reason=str(reason),
|
|
111
|
+
action=action,
|
|
112
|
+
created_at=datetime.now(timezone.utc).isoformat(),
|
|
113
|
+
created_by="inline",
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
raise SuppressionValidationError(
|
|
117
|
+
f"Invalid inline suppression type: {type(spec).__name__}. "
|
|
118
|
+
"Expected str or dict."
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def parse_inline_suppressions(
|
|
123
|
+
specs: list[InlineSuppressionSpec] | None,
|
|
124
|
+
) -> list[Suppression]:
|
|
125
|
+
"""Parse a list of inline suppression specifications.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
specs: List of inline suppression specs, or None
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
List of Suppression objects
|
|
132
|
+
|
|
133
|
+
Raises:
|
|
134
|
+
SuppressionValidationError: If any specification is invalid
|
|
135
|
+
"""
|
|
136
|
+
if not specs:
|
|
137
|
+
return []
|
|
138
|
+
|
|
139
|
+
return [parse_inline_suppression(spec) for spec in specs]
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def merge_suppressions(
|
|
143
|
+
config_suppressions: list[Suppression],
|
|
144
|
+
inline_suppressions: list[Suppression],
|
|
145
|
+
) -> list[Suppression]:
|
|
146
|
+
"""Merge config file suppressions with inline suppressions.
|
|
147
|
+
|
|
148
|
+
Inline suppressions take precedence over config file suppressions
|
|
149
|
+
for the same pattern.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
config_suppressions: Suppressions from config files
|
|
153
|
+
inline_suppressions: Suppressions passed to scan()
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
Merged list with inline taking precedence
|
|
157
|
+
"""
|
|
158
|
+
# Build dict with config suppressions first
|
|
159
|
+
merged: dict[str, Suppression] = {}
|
|
160
|
+
for supp in config_suppressions:
|
|
161
|
+
merged[supp.pattern] = supp
|
|
162
|
+
|
|
163
|
+
# Override with inline suppressions (they take precedence)
|
|
164
|
+
for supp in inline_suppressions:
|
|
165
|
+
merged[supp.pattern] = supp
|
|
166
|
+
|
|
167
|
+
return list(merged.values())
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
__all__ = [
|
|
171
|
+
"InlineSuppressionConfig",
|
|
172
|
+
"InlineSuppressionSpec",
|
|
173
|
+
"merge_suppressions",
|
|
174
|
+
"parse_inline_suppression",
|
|
175
|
+
"parse_inline_suppressions",
|
|
176
|
+
]
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"""L2 ML-based threat detection.
|
|
2
|
+
|
|
3
|
+
This module defines the protocol and interfaces for L2 machine learning
|
|
4
|
+
threat detection that augments L1 rule-based detection.
|
|
5
|
+
|
|
6
|
+
L2 provides:
|
|
7
|
+
- Semantic threat detection using Gemma embeddings
|
|
8
|
+
- 5-head classification (is_threat, family, severity, technique, harm_types)
|
|
9
|
+
- Multilabel harm type classification
|
|
10
|
+
- Context-aware analysis with explainability
|
|
11
|
+
- Probabilistic predictions with confidence scores
|
|
12
|
+
|
|
13
|
+
L2 uses Gemma-based ONNX models containing:
|
|
14
|
+
- EmbeddingGemma-300M ONNX model (256d embeddings)
|
|
15
|
+
- 5 classifier heads (is_threat, threat_family, severity, primary_technique, harm_types)
|
|
16
|
+
- Gemma tokenizer
|
|
17
|
+
- Label configuration
|
|
18
|
+
|
|
19
|
+
Note: ML features require optional dependencies: pip install raxe[ml]
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
# Protocol and base types (no ML dependencies required)
|
|
23
|
+
# Domain models (no ML dependencies required)
|
|
24
|
+
from raxe.domain.ml.gemma_models import (
|
|
25
|
+
DEFAULT_HARM_THRESHOLDS,
|
|
26
|
+
GemmaClassificationResult,
|
|
27
|
+
HarmType,
|
|
28
|
+
MultilabelResult,
|
|
29
|
+
PrimaryTechnique,
|
|
30
|
+
Severity,
|
|
31
|
+
ThreatFamily,
|
|
32
|
+
)
|
|
33
|
+
from raxe.domain.ml.l2_config import (
|
|
34
|
+
L2Config,
|
|
35
|
+
L2EnsembleConfig,
|
|
36
|
+
L2ThresholdConfig,
|
|
37
|
+
create_example_config,
|
|
38
|
+
get_l2_config,
|
|
39
|
+
load_l2_config,
|
|
40
|
+
reset_l2_config,
|
|
41
|
+
set_l2_config,
|
|
42
|
+
)
|
|
43
|
+
from raxe.domain.ml.protocol import (
|
|
44
|
+
L2Detector,
|
|
45
|
+
L2Prediction,
|
|
46
|
+
L2Result,
|
|
47
|
+
L2ThreatType,
|
|
48
|
+
)
|
|
49
|
+
from raxe.domain.ml.scoring_models import (
|
|
50
|
+
ActionType,
|
|
51
|
+
ScoringMode,
|
|
52
|
+
ScoringResult,
|
|
53
|
+
ScoringThresholds,
|
|
54
|
+
ThreatLevel,
|
|
55
|
+
ThreatScore,
|
|
56
|
+
)
|
|
57
|
+
from raxe.domain.ml.stub_detector import StubL2Detector
|
|
58
|
+
|
|
59
|
+
# ML-dependent imports (require numpy, onnxruntime, transformers)
|
|
60
|
+
# These are lazily imported to allow basic SDK usage without ML deps
|
|
61
|
+
_ML_AVAILABLE = False
|
|
62
|
+
_ML_IMPORT_ERROR = None
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
from raxe.domain.ml.gemma_detector import (
|
|
66
|
+
GemmaL2Detector,
|
|
67
|
+
create_gemma_detector,
|
|
68
|
+
)
|
|
69
|
+
from raxe.domain.ml.threat_scorer import HierarchicalThreatScorer
|
|
70
|
+
_ML_AVAILABLE = True
|
|
71
|
+
except ImportError as e:
|
|
72
|
+
_ML_IMPORT_ERROR = str(e)
|
|
73
|
+
# Provide stub implementations for when ML deps are missing
|
|
74
|
+
GemmaL2Detector = None # type: ignore[assignment, misc]
|
|
75
|
+
HierarchicalThreatScorer = None # type: ignore[assignment, misc]
|
|
76
|
+
|
|
77
|
+
def create_gemma_detector(*args, **kwargs): # type: ignore[misc]
|
|
78
|
+
"""Stub: ML dependencies not installed."""
|
|
79
|
+
raise ImportError(
|
|
80
|
+
f"ML features require optional dependencies. "
|
|
81
|
+
f"Install with: pip install raxe[ml]\n"
|
|
82
|
+
f"Original error: {_ML_IMPORT_ERROR}"
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def is_ml_available() -> bool:
|
|
87
|
+
"""Check if ML dependencies are available."""
|
|
88
|
+
return _ML_AVAILABLE
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def get_ml_import_error() -> str | None:
|
|
92
|
+
"""Get the ML import error message if ML is not available."""
|
|
93
|
+
return _ML_IMPORT_ERROR
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
__all__ = [
|
|
97
|
+
# Availability check
|
|
98
|
+
"get_ml_import_error",
|
|
99
|
+
"is_ml_available",
|
|
100
|
+
# Domain Models (Gemma)
|
|
101
|
+
"DEFAULT_HARM_THRESHOLDS",
|
|
102
|
+
"GemmaClassificationResult",
|
|
103
|
+
"HarmType",
|
|
104
|
+
"MultilabelResult",
|
|
105
|
+
"PrimaryTechnique",
|
|
106
|
+
"Severity",
|
|
107
|
+
"ThreatFamily",
|
|
108
|
+
# Configuration
|
|
109
|
+
"L2Config",
|
|
110
|
+
"L2EnsembleConfig",
|
|
111
|
+
"L2ThresholdConfig",
|
|
112
|
+
"create_example_config",
|
|
113
|
+
"get_l2_config",
|
|
114
|
+
"load_l2_config",
|
|
115
|
+
"reset_l2_config",
|
|
116
|
+
"set_l2_config",
|
|
117
|
+
# Threat Scoring
|
|
118
|
+
"ActionType",
|
|
119
|
+
"ScoringMode",
|
|
120
|
+
"ScoringResult",
|
|
121
|
+
"ScoringThresholds",
|
|
122
|
+
"ThreatLevel",
|
|
123
|
+
"ThreatScore",
|
|
124
|
+
# L2 Detection
|
|
125
|
+
"GemmaL2Detector",
|
|
126
|
+
"HierarchicalThreatScorer",
|
|
127
|
+
"L2Detector",
|
|
128
|
+
"L2Prediction",
|
|
129
|
+
"L2Result",
|
|
130
|
+
"L2ThreatType",
|
|
131
|
+
"StubL2Detector",
|
|
132
|
+
"create_gemma_detector",
|
|
133
|
+
]
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"""
|
|
2
|
+
LRU Embedding Cache for L2 ML Inference
|
|
3
|
+
|
|
4
|
+
Thread-safe LRU cache for storing text embeddings to speed up repeated
|
|
5
|
+
inference on the same or similar prompts.
|
|
6
|
+
|
|
7
|
+
Performance characteristics:
|
|
8
|
+
- Cache hit: ~0.1ms (vs ~2ms for embedding generation)
|
|
9
|
+
- Memory: ~3KB per cached embedding (768 floats * 4 bytes)
|
|
10
|
+
- Thread-safe: Uses threading.Lock for concurrent access
|
|
11
|
+
|
|
12
|
+
This module is part of the domain layer and contains PURE logic:
|
|
13
|
+
- No I/O operations (database, network, file system)
|
|
14
|
+
- No logging (statistics are returned, not logged)
|
|
15
|
+
- Deterministic behavior for testability
|
|
16
|
+
|
|
17
|
+
Example:
|
|
18
|
+
cache = EmbeddingCache(max_size=1000)
|
|
19
|
+
|
|
20
|
+
# Check cache before generating embeddings
|
|
21
|
+
cached = cache.get("Hello world")
|
|
22
|
+
if cached is None:
|
|
23
|
+
embedding = generate_embedding("Hello world")
|
|
24
|
+
cache.put("Hello world", embedding)
|
|
25
|
+
else:
|
|
26
|
+
embedding = cached
|
|
27
|
+
|
|
28
|
+
# Check cache statistics
|
|
29
|
+
print(f"Hit rate: {cache.hit_rate:.1%}")
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
from __future__ import annotations
|
|
33
|
+
|
|
34
|
+
import hashlib
|
|
35
|
+
import threading
|
|
36
|
+
from collections import OrderedDict
|
|
37
|
+
from dataclasses import dataclass, field
|
|
38
|
+
from typing import TYPE_CHECKING
|
|
39
|
+
|
|
40
|
+
if TYPE_CHECKING:
|
|
41
|
+
import numpy as np
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass(frozen=True)
|
|
45
|
+
class CacheStats:
|
|
46
|
+
"""
|
|
47
|
+
Immutable cache statistics snapshot.
|
|
48
|
+
|
|
49
|
+
Attributes:
|
|
50
|
+
hits: Number of cache hits
|
|
51
|
+
misses: Number of cache misses
|
|
52
|
+
size: Current number of entries in cache
|
|
53
|
+
max_size: Maximum cache capacity
|
|
54
|
+
hit_rate: Ratio of hits to total requests (0.0-1.0)
|
|
55
|
+
evictions: Number of entries evicted due to capacity
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
hits: int
|
|
59
|
+
misses: int
|
|
60
|
+
size: int
|
|
61
|
+
max_size: int
|
|
62
|
+
hit_rate: float
|
|
63
|
+
evictions: int
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@dataclass
|
|
67
|
+
class EmbeddingCache:
|
|
68
|
+
"""
|
|
69
|
+
Thread-safe LRU cache for text embeddings.
|
|
70
|
+
|
|
71
|
+
Uses an OrderedDict for O(1) LRU operations and a threading.Lock
|
|
72
|
+
for thread safety. Cache keys are derived from SHA256 hashes of
|
|
73
|
+
the input text (first 16 characters for compactness).
|
|
74
|
+
|
|
75
|
+
Performance targets:
|
|
76
|
+
- Cache hit: ~0.1ms
|
|
77
|
+
- Cache miss overhead: ~0.01ms
|
|
78
|
+
- Memory per entry: ~3KB (768 floats * 4 bytes)
|
|
79
|
+
|
|
80
|
+
Attributes:
|
|
81
|
+
max_size: Maximum number of entries (default 1000)
|
|
82
|
+
Set to 0 to disable caching
|
|
83
|
+
|
|
84
|
+
Example:
|
|
85
|
+
# Create cache with default size
|
|
86
|
+
cache = EmbeddingCache()
|
|
87
|
+
|
|
88
|
+
# Create cache with custom size
|
|
89
|
+
cache = EmbeddingCache(max_size=5000)
|
|
90
|
+
|
|
91
|
+
# Disable caching
|
|
92
|
+
cache = EmbeddingCache(max_size=0)
|
|
93
|
+
|
|
94
|
+
# Use cache
|
|
95
|
+
embedding = cache.get("test prompt")
|
|
96
|
+
if embedding is None:
|
|
97
|
+
embedding = model.encode("test prompt")
|
|
98
|
+
cache.put("test prompt", embedding)
|
|
99
|
+
|
|
100
|
+
# Check statistics
|
|
101
|
+
stats = cache.stats
|
|
102
|
+
print(f"Hit rate: {stats.hit_rate:.1%}")
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
max_size: int = 1000
|
|
106
|
+
|
|
107
|
+
# Private fields initialized in __post_init__
|
|
108
|
+
_cache: OrderedDict[str, "np.ndarray"] = field(
|
|
109
|
+
default_factory=OrderedDict, repr=False
|
|
110
|
+
)
|
|
111
|
+
_lock: threading.Lock = field(default_factory=threading.Lock, repr=False)
|
|
112
|
+
_hits: int = field(default=0, repr=False)
|
|
113
|
+
_misses: int = field(default=0, repr=False)
|
|
114
|
+
_evictions: int = field(default=0, repr=False)
|
|
115
|
+
|
|
116
|
+
def __post_init__(self) -> None:
|
|
117
|
+
"""Validate configuration after initialization."""
|
|
118
|
+
if self.max_size < 0:
|
|
119
|
+
raise ValueError("max_size must be non-negative")
|
|
120
|
+
|
|
121
|
+
@staticmethod
|
|
122
|
+
def _compute_key(text: str) -> str:
|
|
123
|
+
"""
|
|
124
|
+
Compute cache key from text using SHA256 hash.
|
|
125
|
+
|
|
126
|
+
Uses first 16 characters of hex digest for compactness while
|
|
127
|
+
maintaining extremely low collision probability.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
text: Input text to hash
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
16-character hex string cache key
|
|
134
|
+
"""
|
|
135
|
+
return hashlib.sha256(text.encode("utf-8")).hexdigest()[:16]
|
|
136
|
+
|
|
137
|
+
@property
|
|
138
|
+
def enabled(self) -> bool:
|
|
139
|
+
"""Return True if caching is enabled (max_size > 0)."""
|
|
140
|
+
return self.max_size > 0
|
|
141
|
+
|
|
142
|
+
@property
|
|
143
|
+
def size(self) -> int:
|
|
144
|
+
"""Return current number of cached entries."""
|
|
145
|
+
with self._lock:
|
|
146
|
+
return len(self._cache)
|
|
147
|
+
|
|
148
|
+
@property
|
|
149
|
+
def hits(self) -> int:
|
|
150
|
+
"""Return number of cache hits."""
|
|
151
|
+
with self._lock:
|
|
152
|
+
return self._hits
|
|
153
|
+
|
|
154
|
+
@property
|
|
155
|
+
def misses(self) -> int:
|
|
156
|
+
"""Return number of cache misses."""
|
|
157
|
+
with self._lock:
|
|
158
|
+
return self._misses
|
|
159
|
+
|
|
160
|
+
@property
|
|
161
|
+
def evictions(self) -> int:
|
|
162
|
+
"""Return number of cache evictions."""
|
|
163
|
+
with self._lock:
|
|
164
|
+
return self._evictions
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def hit_rate(self) -> float:
|
|
168
|
+
"""
|
|
169
|
+
Return cache hit rate as ratio (0.0-1.0).
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
Hit rate as float between 0.0 and 1.0.
|
|
173
|
+
Returns 0.0 if no requests have been made.
|
|
174
|
+
"""
|
|
175
|
+
with self._lock:
|
|
176
|
+
total = self._hits + self._misses
|
|
177
|
+
if total == 0:
|
|
178
|
+
return 0.0
|
|
179
|
+
return self._hits / total
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def stats(self) -> CacheStats:
|
|
183
|
+
"""
|
|
184
|
+
Return snapshot of current cache statistics.
|
|
185
|
+
|
|
186
|
+
Thread-safe: Takes a consistent snapshot under lock.
|
|
187
|
+
|
|
188
|
+
Returns:
|
|
189
|
+
CacheStats immutable dataclass with current statistics
|
|
190
|
+
"""
|
|
191
|
+
with self._lock:
|
|
192
|
+
total = self._hits + self._misses
|
|
193
|
+
hit_rate = self._hits / total if total > 0 else 0.0
|
|
194
|
+
return CacheStats(
|
|
195
|
+
hits=self._hits,
|
|
196
|
+
misses=self._misses,
|
|
197
|
+
size=len(self._cache),
|
|
198
|
+
max_size=self.max_size,
|
|
199
|
+
hit_rate=hit_rate,
|
|
200
|
+
evictions=self._evictions,
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
def get(self, text: str) -> "np.ndarray | None":
|
|
204
|
+
"""
|
|
205
|
+
Retrieve cached embedding for text.
|
|
206
|
+
|
|
207
|
+
If found, moves entry to end of OrderedDict (most recently used).
|
|
208
|
+
Thread-safe operation.
|
|
209
|
+
|
|
210
|
+
Args:
|
|
211
|
+
text: Input text to look up
|
|
212
|
+
|
|
213
|
+
Returns:
|
|
214
|
+
Cached numpy array embedding, or None if not found.
|
|
215
|
+
Returns None immediately if caching is disabled.
|
|
216
|
+
"""
|
|
217
|
+
if not self.enabled:
|
|
218
|
+
return None
|
|
219
|
+
|
|
220
|
+
key = self._compute_key(text)
|
|
221
|
+
|
|
222
|
+
with self._lock:
|
|
223
|
+
if key in self._cache:
|
|
224
|
+
# Move to end (most recently used)
|
|
225
|
+
self._cache.move_to_end(key)
|
|
226
|
+
self._hits += 1
|
|
227
|
+
return self._cache[key]
|
|
228
|
+
else:
|
|
229
|
+
self._misses += 1
|
|
230
|
+
return None
|
|
231
|
+
|
|
232
|
+
def put(self, text: str, embedding: "np.ndarray") -> None:
|
|
233
|
+
"""
|
|
234
|
+
Store embedding in cache.
|
|
235
|
+
|
|
236
|
+
If cache is at capacity, evicts least recently used entry.
|
|
237
|
+
Thread-safe operation.
|
|
238
|
+
|
|
239
|
+
Args:
|
|
240
|
+
text: Input text (used to compute cache key)
|
|
241
|
+
embedding: Numpy array embedding to cache
|
|
242
|
+
|
|
243
|
+
Note:
|
|
244
|
+
Does nothing if caching is disabled (max_size=0).
|
|
245
|
+
If the text is already cached, updates the embedding
|
|
246
|
+
and moves entry to most recently used position.
|
|
247
|
+
"""
|
|
248
|
+
if not self.enabled:
|
|
249
|
+
return
|
|
250
|
+
|
|
251
|
+
key = self._compute_key(text)
|
|
252
|
+
|
|
253
|
+
with self._lock:
|
|
254
|
+
# If key exists, update and move to end
|
|
255
|
+
if key in self._cache:
|
|
256
|
+
self._cache.move_to_end(key)
|
|
257
|
+
self._cache[key] = embedding
|
|
258
|
+
return
|
|
259
|
+
|
|
260
|
+
# Check if we need to evict
|
|
261
|
+
if len(self._cache) >= self.max_size:
|
|
262
|
+
# Remove oldest (first) item
|
|
263
|
+
self._cache.popitem(last=False)
|
|
264
|
+
self._evictions += 1
|
|
265
|
+
|
|
266
|
+
# Add new entry at end (most recently used)
|
|
267
|
+
self._cache[key] = embedding
|
|
268
|
+
|
|
269
|
+
def clear(self) -> None:
|
|
270
|
+
"""
|
|
271
|
+
Clear all cached entries.
|
|
272
|
+
|
|
273
|
+
Thread-safe operation. Resets hits/misses/evictions counters.
|
|
274
|
+
"""
|
|
275
|
+
with self._lock:
|
|
276
|
+
self._cache.clear()
|
|
277
|
+
self._hits = 0
|
|
278
|
+
self._misses = 0
|
|
279
|
+
self._evictions = 0
|
|
280
|
+
|
|
281
|
+
def contains(self, text: str) -> bool:
|
|
282
|
+
"""
|
|
283
|
+
Check if text is in cache without affecting statistics.
|
|
284
|
+
|
|
285
|
+
Thread-safe operation. Does not update hit/miss counters
|
|
286
|
+
or change LRU order.
|
|
287
|
+
|
|
288
|
+
Args:
|
|
289
|
+
text: Input text to check
|
|
290
|
+
|
|
291
|
+
Returns:
|
|
292
|
+
True if text is cached, False otherwise.
|
|
293
|
+
Returns False immediately if caching is disabled.
|
|
294
|
+
"""
|
|
295
|
+
if not self.enabled:
|
|
296
|
+
return False
|
|
297
|
+
|
|
298
|
+
key = self._compute_key(text)
|
|
299
|
+
|
|
300
|
+
with self._lock:
|
|
301
|
+
return key in self._cache
|
|
302
|
+
|
|
303
|
+
def __len__(self) -> int:
|
|
304
|
+
"""Return current number of cached entries."""
|
|
305
|
+
return self.size
|
|
306
|
+
|
|
307
|
+
def __contains__(self, text: str) -> bool:
|
|
308
|
+
"""Support 'in' operator for cache membership check."""
|
|
309
|
+
return self.contains(text)
|