agentleFS
dungnotnulldungnotnull/hybrid-harness-chaos-process-prm/skills/s21-cv-verification/SKILL.md

harness-cv-verification

Skill19 starsChanged 6 months agoMITView on GitHub

Configure Harness Continuous Verification (CV) to automatically validate deployments using real-time observability data. Use this skill whenever the user mentions continuous verification, canary analysis, deployment health, SLO, SLI, metric thresholds, log anomaly detection, monitored services, health sources, verification steps in pipelines, or wants to automatically roll back deployments based on metrics. Also trigger when the user asks how to detect regressions introduced by a deployment.

The file

Files
SKILL.md

Harness Continuous Verification (CV)

Purpose

Configure automated deployment validation that compares post-deployment metrics against pre-deployment baselines, triggering automatic rollback when regressions are detected.


Input Contract

InputSourceRequired
Pipeline YAMLs04 (workflow_context.artifacts)Yes
Service definitionss05 outputYes
Steady state baseline metricss15 outputYes
Observability tool configs20 output or userYes
SLO targets from PRDs01 contextNo
Sensitivity preferences02 taste (risk_tolerance)No

Output Contract

OutputDestinationFormat
Monitored service YAML.commandcode/artifacts/monitored-service-<name>.yamlYAML
Verify step configs04 (pipeline update)YAML
SLO definition.commandcode/artifacts/slo-<name>.yamlYAML
CV test resultss24 (resilience scoring), s25 (postmortem)JSON
Verification strategy docs18 (game day context)Markdown

Prerequisites

  • Observability tool configured: Prometheus, Datadog, New Relic, AppDynamics, Splunk, Dynatrace
  • Connector to observability tool created in Harness
  • Service already onboarded (see harness/02-service-onboarding)
  • Baseline metrics identified (error rate, latency p99, throughput)

CV Architecture

Deploy Stage
    │
    ├── Rolling/Canary Deploy (new version)
    │
    └── Verify Step ──────────────────────────────────────────────────
              │                                                        │
              │  Compares                                              │
              ├── Post-deploy metrics (canary/new) ──► Harness ML    │
              └── Pre-deploy baseline (primary/old) ──► Analysis     │
                                                         │            │
                                                    Pass │  Fail      │
                                                         │    │       │
                                                    Continue  Rollback│

Step 1 — Create Monitored Service

monitoredService:
  name: <SERVICE_NAME>-<ENV>
  identifier: <service_identifier>_<env>
  orgIdentifier: <ORG_ID>
  projectIdentifier: <PROJECT_ID>
  type: Application
  spec:
    serviceRef: <service_identifier>
    environmentRef: <env_identifier>
    sources:
      healthSources:
        - name: Prometheus Health
          identifier: prometheus_health
          type: Prometheus
          spec:
            connectorRef: prometheus_connector
            metricDefinitions:
              - identifier: error_rate
                metricName: Error Rate
                query: |
                  sum(rate(http_requests_total{
                    service="<SERVICE_NAME>",
                    status=~"5.."
                  }[5m])) /
                  sum(rate(http_requests_total{
                    service="<SERVICE_NAME>"
                  }[5m]))
                groupName: Performance
                analysis:
                  riskProfile:
                    riskCategory: Errors
                    thresholdTypes: [ACT_WHEN_HIGHER]
                  deploymentVerification:
                    serviceInstanceFieldName: pod
                    serviceInstanceMetricPath: label_values(pod)
              - identifier: p99_latency
                metricName: P99 Latency (ms)
                query: |
                  histogram_quantile(0.99,
                    rate(http_request_duration_ms_bucket{
                      service="<SERVICE_NAME>"
                    }[5m])
                  )
                groupName: Performance
                analysis:
                  riskProfile:
                    riskCategory: Performance/Throughput
                    thresholdTypes: [ACT_WHEN_HIGHER]
      changeSourceSpec:
        changeSourceList:
          - name: Harness CD
            identifier: harness_cd
            type: HarnessCD
            enabled: true

Step 2 — Add Verify Step to Pipeline

- step:
    name: Verify Deployment
    identifier: verify_deployment
    type: Verify
    timeout: 2h
    spec:
      isMultiServicesOrEnvs: false
      type: Canary         # Canary | Rolling | BlueGreen | LoadTest
      monitoredServiceRef: <service_identifier>_<env>
      healthSources:
        - prometheus_health
      analysisType: CANARY   # ML-based comparison
      duration: 15m          # How long to analyze
      sensitivity: MEDIUM    # LOW | MEDIUM | HIGH
      deploymentTag: <+artifact.tag>
      spec:
        deploymentVerificationJobInstanceIdentifier: <+INFRA_KEY>
    failureStrategies:
      - onFailure:
          errors:
            - Verification
          action:
            type: StageRollback    # Automatic rollback on verification failure

Step 3 — SLO Configuration

Define Service Level Objectives to track deployment health over time:

slo:
  name: <SERVICE_NAME> Availability SLO
  identifier: <service_identifier>_availability_slo
  orgIdentifier: <ORG_ID>
  projectIdentifier: <PROJECT_ID>
  monitoredServiceRef: <service_identifier>_production
  tags:
    managed-by: hcprm
  spec:
    type: Simple
    serviceLevelIndicatorType: Availability
    serviceLevelIndicators:
      - name: Availability SLI
        identifier: availability_sli
        type: Ratio
        spec:
          eventType: Good
          metric1: good_requests_count       # HTTP 2xx/3xx
          metric2: total_requests_count      # all HTTP requests
    target:
      type: Rolling
      spec:
        periodLengthDays: 30
    sloTarget:
      type: Calender
      spec:
        type: Monthly
        spec:
          dayOfMonth: 1
    target:
      sloTargetPercentage: 99.9   # 99.9% availability target
    notificationRuleRefs:
      - notificationRuleRef: slo_burn_alert
        enabled: true

Sensitivity Guide

SensitivityTriggers Rollback WhenUse For
HIGHAny metric deviationCritical payment / auth services
MEDIUMStatistically significant deviationStandard production services
LOWLarge, clear regression onlyExperimental / non-critical services

Verification Strategy by Deploy Type

Deploy StrategyCV TypeAnalysis Method
CanaryCanaryCanary pod metrics vs primary pod metrics
RollingRollingPost-deploy metrics vs pre-deploy baseline
Blue-GreenBlueGreenGreen metrics vs blue metrics before cutover
Load testLoadTestMetrics during load test vs SLO thresholds

AI Agent Integration

Autonomy Level

AspectLevelDescription
CurrentL1AI generates CV config and SLO validation
TargetL2AI configures verification and monitors SLOs

Harness AI Agent

Agent: Harness AI SRE Agent Capabilities:

  • CV config generation
  • SLO validation setup
  • Monitored service configuration
  • Verification metric analysis

Human Gates

  • Verification threshold approval
  • SLO target acceptance
  • Production monitoring changes

Success Criteria

  • Monitored service connected to observability backend
  • At minimum 2 metrics: error rate + p99 latency
  • Verify step added after deploy step in pipeline
  • Rollback on verification failure configured
  • SLO defined with target percentage
  • Burn rate alerts configured
  • CV tested by deploying a known-bad version (should trigger rollback)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.