Skip to main content

Platform Agent

Overview

FieldValue
Agent IDplatform-agent
SDLC StageStage 6: Deployment and Release
Human OwnerPlatform Engineer
Role GuidePlatform / DevOps Engineer Guide
Prompt Templateprompt-library/by-role/platform-engineer/ci-quality-gates.md
Contract Version1.0.0
StatusActive

What This Agent Does

The platform-agent prepares and executes deployments. It is the last automated step before code reaches production — and the only stage where human approval is always mandatory, regardless of trust level.

Core responsibilities:

  1. Deployment manifest preparation — Generate deployment configuration (Kubernetes manifests, Terraform plans, serverless configs)
  2. CI/CD pipeline validation — Verify all prior gates passed and evidence exists
  3. Canary/feature flag configuration — Set up progressive rollout strategies
  4. Monitoring activation — Configure alerting, dashboards, and health checks
  5. Rollback plan preparation — Document and test the rollback procedure
  6. Deployment execution — Execute the deployment plan after human approval

Agent Contract

agent_id: platform-agent
contract_version: 1.0.0
role_owner: platform-engineer

allowed_inputs:
- compliance-evidence-pack
- security-cleared-code
- deployment-configuration
- monitoring-thresholds
- infrastructure-state

allowed_outputs:
- deployment-manifest
- canary-configuration
- monitoring-dashboard-config
- rollback-plan
- health-check-results
- deployment-execution-record

forbidden_actions:
- deploy-without-human-approval # ALWAYS requires human sign-off
- modify-source-code # Platform agent deploys, not develops
- skip-prior-gate-verification # All gates 1-5 must be verified
- access-production-secrets-directly # Secrets via vault only
- disable-monitoring # Monitoring is mandatory for deployments
- force-deploy-over-failures # Health check failures block deployment

required_checks:
- all-prior-gates-passed
- deployment-plan-validated
- rollback-procedure-tested
- monitoring-configured
- human-deployment-approval

handoff_targets:
- agent: ops-agent
artifact: deployment-record
condition: deployment-successful

escalation_path:
approver_role: platform-engineer
triggers:
- infrastructure-change-required
- deployment-configuration-error
- health-check-failure-post-deploy
- rollback-triggered

System Prompt Blueprint

You are platform-agent for [PROJECT_NAME].

Your role: Prepare deployment manifests, configure monitoring, and
execute deployments after human approval.

Infrastructure: [YOUR_INFRASTRUCTURE_DETAILS]
Deployment strategy: [canary / blue-green / rolling / feature-flags]

Contract boundaries:
- You MUST NOT deploy without explicit human approval
- You MUST NOT skip verification of prior gates (1-5)
- You MUST NOT disable monitoring
- You MUST NOT force deployment over health check failures
- You MUST prepare and test a rollback plan for every deployment

For every deployment, produce:
1. Deployment manifest (environment-specific configuration)
2. Canary/feature flag configuration
3. Monitoring and alerting setup
4. Rollback plan with tested procedure
5. Pre-deployment checklist (all prior gates verified)

After human approval, execute:
6. Deployment to target environment
7. Health check verification (15min, 1hr, 24hr windows)
8. Deployment record for audit trail

Standards: PRD-STD-007 (Quality Gates), PRD-STD-009 (Agent Governance)

Handoff Specifications

Receives From (Upstream)

SourceArtifactTrigger
compliance-agent + devmgr-agentCompliance evidence pack + quality metricsGate 5 passed

Sends To (Downstream)

TargetArtifactCondition
ops-agentDeployment record with monitoring configurationDeployment successful and health checks passing

Gate Responsibilities

This agent owns Gate 6:

CriterionHow This Agent Satisfies It
All prior gates (1-5) passedVerifies evidence chain before preparing deployment
Deployment plan reviewedProduces and validates deployment manifest
Rollback procedure documented and testedCreates and tests rollback plan
Monitoring and alerting activeConfigures dashboards and alerts
Human deployment approvalBlocks until human approves (always, all trust levels)

Trust Level Progression

Production deployment always requires human approval. Trust levels affect preparation, not the approval gate.

LevelDurationWhat Changes
Level 02 weeksHuman reviews deployment manifests, monitoring config, and rollback plan
Level 14 weeksAuto-generate manifests for known patterns; human reviews novel infrastructure
Level 28 weeksAuto-configure monitoring from templates; human reviews deployment plan summary
Level 3N/AHuman approval for production deployment is never automated

Environment Scope

EnvironmentAccessAllowed Actions
DevelopmentNoneDoes not operate in Development
StagingFullTest deployment procedures, validate manifests
ProductionControlledExecute deployments after human approval, monitor health

Implementation Guide

Step 1: Define Deployment Strategies

deployment_strategies:
canary:
initial_percentage: 5
increment: 10
interval_minutes: 15
rollback_threshold:
error_rate: 1%
latency_p99: 2x_baseline
feature_flags:
provider: "launchdarkly" # or equivalent
default_state: "off"
rollout_percentage: "progressive"
blue_green:
switch_method: "dns"
validation_window: 30 # minutes

Step 2: Configure Health Checks

health_checks:
- window: "15_minutes"
checks: [endpoint_health, error_rate, latency]
threshold: "all_green"
- window: "1_hour"
checks: [business_metrics, resource_utilization]
threshold: "within_baseline"
- window: "24_hours"
checks: [full_monitoring_suite]
threshold: "no_anomalies"

Step 3: Prepare Rollback Automation

Every deployment must have a tested rollback:

  1. Previous version image/artifact preserved
  2. Rollback command documented and tested in Staging
  3. Data migration rollback plan (if applicable)
  4. Feature flag kill-switch configured

Step 4: Safe Static Deployment Method (Stage -> Validate -> Switch -> Rollback)

For static-docs and similar release assets, use a versioned release layout with atomic symlink switching. The live site is not affected during staging.

Reference: Zero-Downtime Static Deployment.

  1. Stage the release (no traffic impact): build artifacts into releases/<release-id>.
  2. Validate staged release: run smoke checks before any traffic cutover.
  3. Switch atomically: update current symlink to the validated release.
  4. Reload edge/web server only if needed: use controlled reload_nginx path.
  5. Roll back fast if needed: switch current back to previous or a pinned release id.

Required deployment controls for this method:

  • Separate stage and switch operations (no combined blind deploys to production traffic).
  • Keep current and previous pointers for instant fallback.
  • Preserve at least one known-good release in releases/.
  • Block production switch unless all prior gates and human approval are present.
  • Record release_id, switch timestamp, approver, and rollback evidence in deployment artifacts.

Known Limitations

  • Infrastructure drift — The agent assumes infrastructure matches the declared state. Drift detection is separate.
  • Database migrations — The agent can deploy code but cannot fully validate data migration rollback.
  • Cross-service deployments — Multi-service deployments require orchestration beyond single-agent scope.
  • Human approval bottleneck — Production deployment always blocks for human. This is intentional, not a limitation.

Standards Compliance

StandardRequirementEvidence This Agent Produces
PRD-STD-007Quality gate enforcementPre-deployment gate verification, health check results
PRD-STD-009Agent governanceDeployment records, run records, approval records