CerbiShield.Contracts 1.3.1

dotnet add package CerbiShield.Contracts --version 1.3.1
                    
NuGet\Install-Package CerbiShield.Contracts -Version 1.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CerbiShield.Contracts" Version="1.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CerbiShield.Contracts" Version="1.3.1" />
                    
Directory.Packages.props
<PackageReference Include="CerbiShield.Contracts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CerbiShield.Contracts --version 1.3.1
                    
#r "nuget: CerbiShield.Contracts, 1.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CerbiShield.Contracts@1.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CerbiShield.Contracts&version=1.3.1
                    
Install as a Cake Addin
#tool nuget:?package=CerbiShield.Contracts&version=1.3.1
                    
Install as a Cake Tool

CerbiShield.Contracts

Shared message contracts for the CerbiShield ecosystem — the single source of truth for DTOs exchanged between all CerbiShield microservices.

NuGet

Installation

dotnet add package CerbiShield.Contracts

Version 1.2.0 (Current)

Scoring Event Evidence Metadata

ScoringEventDto schema version 1.2 is an additive evidence extension for auditor-ready source-side logging governance. All evidence fields are nullable so producers using v1.1 payloads remain valid and consumers can adopt the metadata incrementally.

New Property Type Purpose
GovernanceProfileId string? Stable profile identifier used by the runtime.
GovernanceProfileVersion string? Profile version evaluated for the event.
GovernanceProfileHash string? Hash of the ruleset used to verify source-side evidence.
GovernanceDecision string? Final governance decision for the log event.
EnforcementAction string? Action taken at the source, such as tag or redact.
ExceptionId string? Approved exception identifier, when one applies.
ExceptionReason string? Reason captured for the applied exception.
ExceptionApprovedBy string? Principal or workflow that approved the exception.
ExceptionExpiresAtUtc DateTime? UTC expiration for the applied exception.

Rule → App → Violation Linkage

ViolationDto now carries full context so downstream consumers (dashboards, analytics, reports) can trace every violation back to the exact rule, profile, and app that produced it.

New Property Type Purpose
Description string? Human-readable rule description from the profile's FieldDescriptions. Tells the user why the rule exists and how to fix it.
ProfileName string? The governance profile name that produced the violation (e.g., "Orders").
AppName string? The app scope that owns the profile (e.g., "OrderService").
Composite RuleId Format

The RuleId field now supports a stable composite format:

{profile}:{field}:{code}

Examples:

  • Orders:UserId:Missing — Required field UserId is missing in the Orders profile
  • Payments:creditCardPlain:Forbidden — Forbidden field detected
  • Analytics:sessionId:InvalidType — Type mismatch on sessionId

This composite key enables the Violation Explorer dashboard to group, filter, and drill into violations by rule, field, profile, and app.

Backward-Compatible Schema Validation

ScoringEventValidator now accepts any schema version between 1.0 and 1.2 (inclusive), so existing producers sending 1.0 or 1.1 events are not rejected when consumers upgrade to this package.

Full Changelog

  • ViolationDto: added Description, ProfileName, AppName
  • ContractVersions.ScoringEventSchemaVersion: 1.11.2
  • ScoringEventValidator: range-based schema version check (1.01.2)
  • Package version: 1.3.01.3.1-preview.1 (repo package version already used the 1.3.x multi-targeting scheme)

Version 1.1.0

  • Added ServiceName, AppVersion, InstanceId, DeploymentId to ScoringEventDto
  • Added GovernanceConfigDto for dashboard-generated configs
  • TenantId can now come from governance config
  • SchemaVersion bumped to 1.1

Package Contents

Scoring Contracts

  • ScoringEventDto — Canonical scoring event payload (v1.2: additive nullable evidence metadata; v1.1: +ServiceName, AppVersion, InstanceId, DeploymentId)
  • ScoringQueueEnvelopeDto — Queue envelope wrapper
  • ScoreBreakdownDto — Score breakdown by category (Overall, Governance, Safety)
  • ViolationDto — Governance violation details (v1.2: +Description, ProfileName, AppName)
  • GovernanceFlagsDto — Governance processing flags

Governance Contracts

  • GovernanceConfigDto — Dashboard-generated config with embedded TenantId
  • GovernanceProfileDto — Profile with rules and environment overrides
  • GovernanceRuleDto — Individual governance rule
  • EnvironmentOverrideDto — Per-environment severity adjustments

Aggregation Contracts

  • AppMetricDto — Application-level metric data points

Validation

  • ScoringEventValidator — Validates ScoringEventDto instances (schema version range, required fields, score bounds)
  • ValidationResult — Validation result record

Schema Versions

Version Status Notes
1.2 Current Additive nullable ScoringEventDto evidence metadata; ViolationDto linkage fields
1.1 Supported Identity fields (AppVersion, InstanceId, DeploymentId)
1.0 Supported Initial release

Data Flow

┌──────────────────┐     ┌─────────────────────┐     ┌──────────────────────┐
│  Runtime Engine   │────▶│  Scoring Shipper     │────▶│  Scoring Aggregator  │
│  (GovernanceRT)   │     │  (Serilog/MEL/Stream)│     │  (ScoringApi)        │
└──────────────────┘     └─────────────────────┘     └──────────────────────┘
        │                         │                           │
        │  ViolationDto           │  ScoringEventDto          │  ScoringEvent
        │  .RuleId                │  .Violations[]            │  .ViolationCount
        │  .Code                  │  .AppName                 │  .GovernanceProfile
        │  .Field                 │  .GovernanceProfile       │
        │  .Description           │  .DeploymentId            │
        │  .ProfileName           │                           ▼
        │  .AppName               │               ┌──────────────────────┐
        │                         │               │  Analytics API       │
        ▼                         ▼               │  (ViolationExplorer) │
   GovernanceStore           Dashboard            └──────────────────────┘
   (Playground)

License

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on CerbiShield.Contracts:

Package Downloads
CerbiStream

CerbiStream.Logging - Secure, Scalable, and Standardized Logging for Modern Applications.

Cerbi.Governance.Core

Shared governance models, validation contracts, and plugins used across CerbiStream and GovernanceAnalyzer.

CerbiStream.GovernanceAnalyzer

Roslyn analyzer to enforce structured logging governance for CerbiStream apps. Ensures consistency, traceability, and compliance with score shipping support.

Cerbi.Governance.Runtime

Real-time governance enforcement for CerbiStream and other structured loggers. Uses canonical Dashboard Profile model.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.1 330 7/6/2026
1.3.0 118 5/3/2026
1.2.1 2,663 2/26/2026
1.2.0 126 2/22/2026
1.1.0 126 2/4/2026
1.0.0 126 2/3/2026

v1.3.1: Add ScoringEventDto v1.2 nullable evidence metadata for source-side governance auditability. Backward-compatible with v1.1 payloads.