Skip to main content

Enforcement

The enforcement engine evaluates policy compliance before deployments and promotions. It checks all applicable policies, verifies guardrail requirements, and returns a clear verdict on whether a resource can proceed.

How Enforcement Works

When a resource is about to be deployed or promoted, the enforcement engine runs a comprehensive compliance check:

Deployment/Promotion Request

┌──────────────────────────────────────┐
│ 1. Find applicable policies │
│ (by resource type + active) │
├──────────────────────────────────────┤
│ 2. Check each policy instance │
│ - Missing? → violation │
│ - Incomplete? → violation │
│ - Denied? → violation │
│ - Expired? → violation │
│ - Completed? → pass │
├──────────────────────────────────────┤
│ 3. Check guardrails (AI models) │
│ - Required guardrails enabled? │
│ - Configuration correct? │
├──────────────────────────────────────┤
│ 4. Apply enforcement rules │
│ per environment │
│ (hard_block / soft_block / │
│ warning / post_review) │
├──────────────────────────────────────┤
│ 5. Check active overrides │
│ - Valid override? → bypass block │
│ - Expired? → enforce │
├──────────────────────────────────────┤
│ 6. Return enforcement result │
└──────────────────────────────────────┘

Allowed / Blocked / Requires Override / Warning

Enforcement Result

The enforcement check returns a structured result:

FieldTypeDescription
allowedBooleanWhether deployment can proceed
requiresOverrideBooleanWhether an admin override is needed
overallStatusStringallowed, blocked, requires-override, or warning
hardBlocksArrayPolicy violations that block deployment — cannot be bypassed
softBlocksArrayPolicy violations that block deployment — can be overridden with justification
warningsArrayInformational warnings — deployment proceeds
messageStringHuman-readable status summary

Status Meanings

StatusDeploymentAction Required
allowedProceedsNone
warningProceedsReview warnings for potential issues
requires-overrideBlocked until overrideAdmin must provide justification to proceed
blockedCannot proceedMust resolve hard-block violations

Block Detail Structure

Each item in hardBlocks, softBlocks, or warnings includes:

FieldDescription
policyIdThe policy that generated this result
policyNameHuman-readable policy name
categoryPolicy category (Security, Compliance, Quality, Operational)
severityViolation severity (Critical, High, Medium, Low, Info)
issueDescription of what is non-compliant
canOverrideWhether an admin can override (false for hard blocks)

Enforcement Actions

Policies define enforcement rules per environment. Each rule maps an environment to an action:

ActionBehaviorOverride Allowed
hard_blockDeployment completely blocked until all policy stages completeNo (admin override only via deployment override)
soft_blockDeployment blocked but can be overridden by authorized roles with written justificationYes
warningWarning logged, deployment proceeds normallyN/A
post_reviewDeployment blocked until manual post-deployment review is completedYes

Environment-Specific Enforcement

Different environments typically have different enforcement levels:

EnvironmentRecommended ActionRationale
DevelopmentwarningTrack compliance without blocking developer velocity
Stagingsoft_blockRequire compliance but allow overrides for testing
Productionhard_blockStrict enforcement to protect production workloads

Resource-Specific Policy Fields

Each resource type has specific policy fields that the enforcement engine evaluates:

Applications (app)

FieldDescription
securityScanRequiredSecurity vulnerability scan must pass
codeReviewRequiredCode review must be completed and approved
deploymentApprovalExplicit deployment approval required
resourceLimitsRequiredCPU/memory limits must be configured

Add-ons (addon)

FieldDescription
backupRequiredAutomated backup must be configured
encryptionRequiredEncryption at rest must be enabled
networkIsolationNetwork isolation must be configured
accessControlRequiredAccess control policies must be in place

Workflows (workflow)

FieldDescription
approvalGatesRequiredWorkflow must include approval gates
errorHandlingRequiredError handling must be configured
loggingRequiredLogging must be enabled
timeoutRequiredExecution timeout must be set

Data Sources (dataSource)

FieldDescription
dataClassificationData sensitivity must be classified
encryptionInTransitTLS/SSL must be configured
accessLoggingRequiredAccess logging must be enabled
piiHandlingPII handling procedures must be documented

AI Gateway Models (aiGatewayModel)

FieldDescription
guardrailsRequiredSpecific guardrails must be enabled
contentFilteringLevelMinimum content filtering level
rateLimitRequiredRate limiting must be configured
costBudgetRequiredCost budget must be set

Guardrail Compliance Checks

For AI Gateway Models, the enforcement engine performs additional guardrail verification:

  1. Check required guardrails — Verify that each guardrail specified in the policy is enabled on the model
  2. Check configuration — Verify guardrail settings meet policy requirements (e.g., content filter level is at least medium)
  3. Report results — Each guardrail check produces:
FieldDescription
guardrailIdWhich guardrail was checked
guardrailNameHuman-readable name
requiredWhether the policy requires this guardrail
appliedWhether the guardrail is currently enabled
configuredWhether the configuration meets requirements
issueDescription of any non-compliance

Missing required guardrails result in hard blocks or soft blocks depending on the policy's enforcement rules.

Deployment Overrides

When enforcement blocks a deployment, administrators can create temporary overrides to bypass specific policy blocks.

Creating an Override

  1. Navigate to the enforcement check result (shown on the resource detail page or during promotion)
  2. Click Request Override on a blocked policy
  3. Provide:
    • Justification — Written explanation of why the override is necessary
    • Expiration — When the override should expire (optional, recommended)
    • Blocked Policies — Which specific policy blocks to override
  4. An administrator must approve the override
  5. Once approved, the enforcement check treats the overridden policies as passing

Override Lifecycle

StatusDescription
activeOverride is in effect — enforcement blocks are bypassed
revokedOverride manually revoked by an administrator
expiredOverride has passed its expiration date

Managing Overrides

OperationWho Can Do ItDescription
Create overrideAdministratorsBypass specific policy blocks with justification
Revoke overrideAdministratorsDeactivate an override immediately with a reason
View overridesAdministratorsList all active overrides for a resource
Auto-expirationSystemOverrides with an expiration date are automatically expired

Override expiry is checked daily at 2 AM by the governance scheduled tasks.

Override Audit Trail

Every override action is logged in the audit trail:

  • Override created — Records justification, approver, affected policies
  • Override revoked — Records reason, revoker, timestamp
  • Override expired — Records automatic expiration timestamp

Scheduled Enforcement Tasks

The governance system runs automated tasks on a schedule:

Hourly: Deadline Checker

Checks all policy instances for SLA violations:

  • Identifies stages that have exceeded their slaHours
  • Sends escalation notifications to validators, creators, and admins
  • Updates instance metadata with escalation status

Daily (2 AM): Maintenance Tasks

  1. Attestation Expiry Checker — Sends notifications at 30, 14, 7, 3, and 1 days before attestation expiration
  2. Compliance Score Storage — Records daily compliance scores to the history collection for trend analysis
  3. Override Expiry — Expires deployment overrides that have passed their expiration date

Using Enforcement in Workflows

Pre-Deployment Check

Before deploying a resource, call the enforcement check to evaluate compliance:

  1. The system identifies all active policies applicable to the resource type
  2. For each policy, it finds the corresponding policy instance
  3. Each instance is evaluated:
    • Missing instance — Policy has not been applied to this resource
    • Incomplete instance — Required stages are not completed
    • Denied instance — A stage was denied by a reviewer
    • Expired instance — Instance has passed its expiration
  4. For AI Gateway models, guardrail requirements are additionally checked
  5. Results are categorized into hard blocks, soft blocks, and warnings based on enforcement rules
  6. Active deployment overrides are checked — valid overrides bypass blocks

Integration Points

Enforcement checks are triggered at these points:

TriggerContext
Resource deploymentBefore deploying an app, workflow, or model to an environment
Environment promotionBefore promoting a resource from one environment to another
Compliance dashboardOn-demand compliance evaluation for solutions
Snapshot creationPolicy evaluation when creating compliance snapshots

Best Practices

Progressive Enforcement

  • Start with warning enforcement for new policies to measure impact
  • Review warning logs to identify false positives and adjust policy rules
  • Graduate to soft_block once teams are comfortable with the policy
  • Use hard_block only for production environments and critical security policies

Override Discipline

  • Always set an expiration on overrides — open-ended overrides become security risks
  • Review override frequency per policy — frequent overrides suggest the policy needs adjustment
  • Require detailed justifications — vague overrides undermine governance accountability
  • Revoke overrides proactively when the original blocking issue is resolved

Monitor Enforcement Health

  • Track compliance rate over time — it should trend upward as teams adopt governance
  • Review blocked deployment frequency — spikes may indicate new policy issues
  • Monitor override trends — increasing overrides may signal unrealistic policies
  • Check SLA compliance — frequent escalations suggest SLA hours need adjustment
Important

hard_block enforcement cannot be overridden through the standard override mechanism. The only way to proceed past a hard block is to resolve the underlying compliance violation (complete the policy stages) or have an administrator create a deployment override. Use hard blocks judiciously.