Yamlr User Guide
Kubernetes Configuration Safety Engine
Yamlr is a deterministic Kubernetes configuration safety engine based on a "Detection is Free / Remediation is Paid" architecture.
π The Yamlr Healing Engine
Yamlr unifies its capabilities under the Yamlr Healing Engine, tailored for specific environments:
- Audit Mode (Guard): Real-time diagnostics, semantic auditing, and risk analysis. Use this for 100% free, unlimited CI gating and IDE feedback.
- Healing Mode (Surgeon): Automated remediation and "Self-Healing" capabilities. Free users are gifted 5 files per day to keep manifests healthy.
[!IMPORTANT] Audit mode (
yamlr scan) never modifies files. Active Healing (yamlr heal) only changes manifests when explicitly invoked and backed by Global Atomic Sessions and automatic backups.
Runs 100% locally. No data leaves your machine.
π 60-Second Quick Start
1οΈβ£ Download Binary
Download the latest release for your OS:
- Linux (x86_64)
- macOS (Intel / Apple Silicon)
- Windows (PowerShell supported)
Make it executable and move it to your PATH:
bashchmod +x yamlr sudo mv yamlr /usr/local/bin/
Verify installation:
bashyamlr version
π New User?
Run yamlr welcome for an interactive dashboard and guided tour of all capabilities.
Run yamlr manual to read this entire guide or specific command help (e.g., yamlr manual scan) directly in your terminal.
ποΈ Architectural Primitives (Industrial Strength)
Yamlr is built on three first-class primitives that enable global reasoning:
| Primitive | Role | Why It Matters |
|---|---|---|
| CatalogManager | Dynamic Knowledge Base | Handles 150+ K8s resource types and their relational affinity. |
| RuleManager | Policy Orchestration | Manages the "Trust Gate" β ensuring every fix is safe and explainable. |
| ResourceGraph | Dependency Engine | Unlocks the "Blast Radius" feature by mapping complex cross-resource links. |
For deep technical details on extending these primitives, see the Developer Guide.
β‘ Your First Safety Scan
bashyamlr scan .
Yamlr will:
- Parse all Kubernetes manifests
- Build a cross-resource graph
- Detect semantic failures
- Provide deterministic remediation guidance
Nothing is modified in scan mode.
π§ What Makes Yamlr Different
Most tools validate structure.
Yamlr validates system integrity using the Yamlr Healing Engine architecture:
text[ Yamlr Healing Engine ] | +----+----+ | | [ Guard ] [ Surgeon ] (Audit) (Heal)
π₯ Top βMagic Momentsβ
Yamlr is testing a high-performance Rust-based scanner for repositories with 10,000+ manifests.
--fast[Pro]: Explicitly trigger the premium 150 MB/s native Rust extension for maximum throughput.--experimental-rust: Enable the experimental hybrid Rust scanner for early feedback.--timing: Integrated performance auditing. Tracks "Bootstrap" (Imports/OS) overhead vs. command execution.
π 100k+ Manifest Hyperscale Stability
Yamlr v1.6 "Matrix Stability" introduces a True Streaming architecture designed for enterprise-scale repositories:
- Constant RAM Usage: Maintains ~60MB RAM usage even when processing 100,000+ manifests via the
--stream-toNDJSON output. - Disk-Backed Index: Global cross-resource analysis now uses a SQLite-backed
DiskIndexto avoid memory exhaustion during relational resolution. - Zero-List Master Process: For ultra-scale runs (>5000 files), the master process operates in a "Zero-List" mode, ensuring zero memory accumulation.
ποΈ Engine Tiers (The Turbo Button)
Yamlr offers three engine tiers via the --engine flag to balance safety and speed:
- Python (Standard): High-fidelity healing with maximum comment preservation.
- Native (Turbo): 150 MB/s high-speed structural audit using the Rust extension. Ideal for rapid CI gating.
- Rust (Experimental): Hybrid experimental path for ultra-fast discovery.
0.5οΈβ£ Cross-Domain Safety (The Cloud Gap) π
Yamlr bridges the gap between your Kubernetes manifests and your cloud infrastructure.
It parses Terraform (.tf) files to ensure that your PersistentVolumes actually match your aws_ebs_volume and that your Secrets correctly link to your aws_db_instance credentials.
1οΈβ£ Ghost Services
Detects Services whose selectors match zero Pods.
kubectl apply succeeds.
Traffic silently fails.
Yamlr catches it.
2οΈβ£ Cross-Resource Port Mismatch
Aligns:
Ingress β Service β Container ports
Schema passes. Cluster applies. Traffic breaks.
Yamlr detects and fixes.
3οΈβ£ Deprecated API Migration
Upgrade cluster β manifests break.
bashyamlr upgrade . --to 1.31 # Also: yamlr migrate . --to 1.31
Covers K8s 1.9 β 1.31. Automatically migrates deprecated APIs safely.
4οΈβ£ Orphan ConfigMaps & Secrets
Finds unused or dangling resources polluting your cluster definitions.
5οΈβ£ Deterministic Healing
bashyamlr heal .
Shows visual diff before applying changes.
Backups are automatically created.
No silent rewrites.
6οΈβ£ Resource Topology & Blast Radius
Visualize complex dependencies and audit the "Blast Radius" of a potential failure.
bashyamlr graph topo yamlr graph blast-radius --resource Deployment/my-app yamlr graph export --format mermaid
𧬠Semantic DNA & Restoration
Yamlr ensures 100% intent preservation through its Semantic DNA Integrity engine.
yamlr dna
Verify configuration integrity in CI to ensure no unauthorized changes were made:
bashyamlr dna deployment.yaml yamlr dna deployment.yaml --hash <expected_hash> # Enforce immutability
yamlr restore
Instant rollback to previous configurations from the automatic backup vault:
bashyamlr restore <file_path> # Restore the specific file from its most recent backup
π‘ Safety Guarantees
Yamlr is designed for production environments.
Semantic DNA Integrity
Every manifest has a computed semantic hash.
If healing accidentally changes meaning beyond intended repair, Yamlr aborts the write.
No accidental production drift.
Automatic Backup Rotation
Before any modification:
.yamlr/backups/
- Timestamped snapshots
- Last 5 versions retained
- Instant rollback via:
bashyamlr restore <path> # Restore a single file yamlr rollback # Revert an entire atomic session
Non-Destructive Formatting
Yamlr preserves:
- Quote style
- Field ordering
- Whitespace where possible
Use --sovereign [Pro] for enterprise aesthetics, including schema-aware key sorting (apiVersion, kind, metadata at top) and comment grafting to preserve annotations during reformatting.
Clean diffs. GitOps-friendly.
π Core Commands
Read-Only Safety Analysis
bashyamlr scan . # Also: yamlr audit . yamlr check . # Strict validation Perfect for GitHub Actions / GitLab CI. ### π‘οΈ GitOps Guard (Regression Testing) Adopting Yamlr on a legacy repository can be noisy if you have hundreds of pre-existing violations. Use the **Baseline** command to snapshot existing issues and only block on **new** regressions. ```bash # 1. Establish Baseline yamlr baseline . --output .yamlr-baseline.json # 2. Enforce in CI (Exit 1 only on NEW issues) yamlr scan . --baseline .yamlr-baseline.json --fail-on any
Yamlr calculates a stable SHA-256 fingerprint for every finding. If a finding is already in the baseline, it is ignored and won't trigger a non-zero exit code.
π‘οΈ Auditor-Ready Evidence
bashyamlr heal . --evidence-dir ./audit-evidence yamlr evidence ./audit-evidence --format pdf
Generate mathematical proof of compliance. See yamlr_evidence.md for details.
Healing & Remediation
bashyamlr heal .
Interactive by default.
[!NOTE] Free Tier Usage: Automated healing is limited to 5 files per day for free users. This allows you to experience the "magic" of Yamlr Surgeon on small tasks or tricky deployments. Scanning and auditing (
yamlr scan) remain unlimited.
Advanced Surgeon Flags
| Flag | Effect | Tier |
|---|---|---|
--adapters-dir DIR | Directory containing custom Python/Bash remediation scripts | π Pro |
--adapter-shadow-mode | Record evidence receipts without modifying manifests | π Pro |
--allow-break-glass-adapters | Explicitly authorize high-privilege adapters | π Pro |
--yes-all | Auto-confirm all changes in batch mode | β Free |
--no-backup | Skip backup creation (DANGEROUS) | β Free |
--dry-run | Show diff without writing | β Free |
--fix-refs | Cross-Resource Auto-Fix (selectors, ports, etc.) | π Pro |
--stub-refs | Generate missing ConfigMaps/Secrets from schema | π Pro |
--harden | Apply PSS hardening (privileged: false, etc.) | π Pro |
--enforce-limits | Inject CPU/Memory requests & limits | π Pro |
--fix-tags | Remediate mutable image tags (e.g. :latest) | β Free |
--enforce-probes | Apply Liveness/Readiness probes | π Pro |
--check-deprecations | Audit for deprecated K8s APIs | β Free |
--enforce-namespace | Auto-inject namespace if missing | β Free |
--pro-preview | Simulate Pro fixes in Free version | β Free |
--sovereign | Enable high-fidelity sovereign export | π Pro |
--fast | Lightning-fast Rust scanning | π Pro |
π‘οΈ MCP for AI Agents (Pro)
Connect Yamlr to your AI assistant (Cursor, Claude, etc.) for surgical manifest analysis.
bash# Start the MCP stdio server yamlr mcp
Yamlr exposes scan_manifest, heal_manifest, and why tools to agents, ensuring AI suggestions are safe and deterministic.
Kubernetes Upgrade Migration
bashyamlr upgrade . --to 1.31 # Also: yamlr migrate . --to 1.31
Covers K8s 1.9 through 1.31 (forward-looking to 1.32). Forward-only safe migration.
π Cross-Domain ResourceGraph
Yamlr builds a ResourceGraph of your manifests and cloud infrastructure β 26 typed edge relationships:
- OwnerReference: (Deployment β RS β Pod). Crucial for "Auto-Cleanup" and "Blast Radius" mapping.
- VolumeMount β Container: Internal resource binding (finding which container is starving which PVC).
- Service β EndpointSlice: The literal traffic path that OPA often misses.
- ResourceQuota β Namespace: Mapping application appetite to cluster availability.
- KMS β Secret: Mapping the security chain for compliance audits (SOC2/FedRAMP).
- VPA β Workload: Vertical pod autoscaling dependencies.
- Gateway β GatewayClass: Full Gateway API depth.
- Service β Pod (selector match)
- Ingress β Service (backend)
- PersistentVolume β Cloud Storage (EBS/S3)
- Secret β Cloud Database (RDS/IAM)
- ConfigMap/Secret β Pod (volume/env)
- HPA β Deployment (scale target)
- NetworkPolicy β Pod (isolation)
- PDB β Pod (disruption budget)
- PriorityClass, RuntimeClass, CRD instances, Gateway routes
This enables blast radius analysis β knowing which resources are affected when one breaks.
ποΈ Architectural Primitives
Yamlr is built on three core pillars that ensure its surgical precision and reliability:
1. CatalogManager
The CatalogManager is the brain of Yamlr's K8s awareness. it manages the lifecycle of Kubernetes OpenAPI schemas, ensuring that every scan is performed against the exact API definitions of your target cluster. It supports version switching from v1.9 to v1.35+.
2. RuleManager
The RuleManager orchestrates the 100+ diagnostic rules that power Yamlr's analysis. It handles rule discovery, severity weighting, and risk classification, allowing Yamlr to provide consistent, explainable feedback across all environments.
3. ResourceGraph
The ResourceGraph is the connective tissue of your infrastructure. Unlike simple linters that look at files in isolation, Yamlr builds a directed acyclic graph (DAG) of your entire repository, mapping hidden dependencies like service selectors to pod labels and ingress backends to service ports.
β‘ Risk Classification (Safety Engine)
Every finding is processed by the Risk Classifier, which uses heuristic scoring to categorize risks into one of 15 safety buckets:
- Traffic Routing Failure
- Data Dependency Risk
- Resource Exhaustion Risk
- Security Posture Weakness
- Network Isolation Risk
- Image Pull Failure Risk
- And 9 more (Version, RBAC, Scheduling, etc.)
Each category has an impact scope (cluster/namespace) and risk level (HIGH/MEDIUM/LOW).
Cross-Resource Auto-Fix (Pro)
bashyamlr heal . --fix-refs
Used to correct selector typos (Service β Pod), fix port mismatches (Ingress β Service β Container), and stub missing ConfigMaps/Secrets referenced in volumes.
Includes:
- Selector alignment
- Port correction
- Missing reference stubs
π§ͺ Demo Mode
Instant playground:
bashyamlr demo
Creates intentionally broken manifests.
Run:
bashyamlr heal yamlr-demo/
Experience the βmagic momentβ safely.
Enterprise Demo (--pro-preview)
Try out all Enterprise features without a license and without modifying any files to see exactly what Yamlr Pro would fix for you:
bashyamlr heal . --pro-preview
π Project Health & ROI
Yamlr tracks its impact locally and provides per-application safety scoring.
bashyamlr stats yamlr stats --apps # Detailed per-app safety report
Shows:
- Fixes applied
- Time saved
- Detection coverage
- App Safety Score (0-100)
- Top Risk Categories (Security, Availability, etc.)
No telemetry leaves your machine.
π Executive ROI & Safety Dashboards
Yamlr provides high-level diagnostics for engineering leaders and founders to justify budgets and track ecosystem health.
bashyamlr roi # Business Value: Engineering hours saved & project rank yamlr roi --badge # Generate a Shields.io ROI badge for your README yamlr stats # Local telemetry: Files healed & ROI summary yamlr stats --apps # Detailed per-app safety report & blast-radius yamlr pulse # Founder Intelligence: Aggregate rule efficacy & coverage
π¦ Diagnostic & Support
yamlr diagnose
Deep-dive analysis with elevated verbosity for environment-specific debugging.
bashyamlr diagnose . yamlr diagnose . --output json # Machine-readable debug output yamlr diagnose . --bundle # [PRO] Export anonymized founder-ready support zip
The --bundle command creates a yamlr-bundle-<timestamp>.zip containing anonymized telemetry, configuration summaries, and environment data to help with strategic review.
π IDP Integration & Exports
Yamlr acts as a "Supplier of Truth" for your internal developer portals.
bashyamlr idp-export --format backstage yamlr idp-export --format prometheus
Supported formats:
- Backstage: JSON component annotations.
- Prometheus: OpenMetrics text for Grafana dashboards.
- JSON: Raw internal safety spec.
yamlr idp-export init
Generate opinionated integration templates for your IDP:
bashyamlr idp-export init --format backstage --output catalog-info.yaml yamlr idp-export init --format prometheus --output prometheus-scrape.yml
β Common Power Flags
| Flag | Purpose | Tier |
|---|---|---|
--diff / --dry-run | Show changes without writing | β Free |
--pro-preview | [Heal] Simulate PRO fixes safely | β Free |
--fail-on {error,warning,any} | CI/CD Gate: Exit 1 if issues found | β Free |
--risk-threshold {high,medium,low} | Exit 1 based on risk impact | β Free |
--kube-version | Target K8s version (e.g. 1.31) | β Free |
--strict | [Check] Treat warnings as errors | β Free |
--summary-only | Batch mode: show aggregate only | β Free |
--quiet / --clinical | Minimal output for GitOps/CI | β Free |
--compact | Minimal whitespace in output | β Free |
--concurrency N | Parallel worker count | β Free |
--stream-to FILE | Ultra-scale: Stream to NDJSON | β Free |
--baseline FILE | Path to violation baseline | β Free |
--identity-mode {infer,strict} | Identity detection style | β Free |
--experimental-rust | [Hybrid] Enable Rust scanner | β Free |
--timing | [Performance] Show execution breakdown | β Free |
--timing-file FILE | [Performance] Save profile to JSON | β Free |
--adapters-dir DIR | [Pro] Custom remediation scripts | π Pro |
--receipt | Generate DNA receipts | π Pro |
--sovereign | High-fidelity export | π Pro |
--fast | Max-speed Rust scanning | π Pro |
𧬠Semantic DNA Verification (Pro)
Verify configuration integrity in CI:
bashyamlr dna deployment.yaml
Invariant to:
- Comments
- Field order
- Formatting
Use --hash to enforce immutability.
π Zero-Trust Hardening (Pro)
Analyze and suggest security hardening automatically.
bashyamlr secure . # Read-only security audit yamlr heal . --harden # Interactive repair
Injects:
- runAsNonRoot
- Read-only FS
- Drop capabilities
- Default deny NetworkPolicy
π§ Philosophy
Kubernetes validates structure.
Yamlr validates system integrity.
Schema errors are obvious.
Logical misconfigurations are silent.
Yamlr exists to eliminate silent failures.
π’ Free vs Pro (Enterprise)
Yamlr uses a tiered model to support small teams while providing enterprise-grade automation at scale.
| Feature | Free Tier | Pro (Surgeon) |
|---|---|---|
| Scanning & Diagnostics | Unlimited | Unlimited |
| Risk Auditing (SARIF) | Unlimited | Unlimited |
| Automated Healing | 5 files / day | Unlimited |
| Security Hardening | Manual | Automated (--harden) |
| DNA Verification | Manual | Automated (--hash) |
| Ecosystem Adapters | N/A | OPA & Kyverno |
| Native Acceleration | Partial | Full (--fast) |
| High-Fidelity Export | Standard | Sovereign (--sovereign) |
Upgrade:
bashyamlr auth login
π¦ Catalog Management
Yamlr ships with embedded Kubernetes OpenAPI catalogs.
Check active version:
bashyamlr catalog status
Update:
bashyamlr catalog update --kube-version 1.32
π§ Additional Commands
Compliance Evidence & Auto-Remediation (Pro)
bash# Unified Remediation: Ingest OPA/Kyverno reports and apply Yamlr auto-fixes yamlr heal . --from-report policy-report.json # (Legacy) Ingest Kyverno reports specifically yamlr heal . --kyverno-report policy-report.json # Generate cryptographic DNA receipts yamlr evidence ./receipts --format pdf --output report.pdf
Aggregates cryptographic DNA receipts into auditor-ready PDF reports.
SRE Dashboard (Health)
bashyamlr status # SRE dashboard view yamlr doctor --k8s-matrix # Validate K8s catalog matrix integrity yamlr doctor --k8s-matrix-strict # Exit 1 if bundles are missing or stale (CI Gate)
Displays the system health dashboard, including configuration status, catalog info, and backup usage.
Deep Diagnostics
bashyamlr diagnose . yamlr diagnose . --bundle # [PRO] Export anonymized founder-ready support zip
Runs a deep audit with DEBUG logging. Use to trace engine decisions.
Rule Discovery
bashyamlr rules # Dashboard of all protections yamlr explain <rule_id> # Detail on a specific rule
Project Initialization
bashyamlr init # Create .yamlr.yaml config
Shell Autocompletion
bashyamlr completion bash --install # Also: zsh, fish, powershell
β Troubleshooting
βMissing path argumentβ
Specify target:
bashyamlr scan .
CI passes even when broken?
Ensure you are using:
bashyamlr scan . --fail-on error
π΅οΈ Security Model & Guarantees
Yamlr is designed for "A+" security grade compliance. Our safety architecture prioritizes Information Anonymity and Supply Chain Integrity.
1. Information Anonymity (Path Masking)
To prevent accidental information disclosure in CI/CD logs or portable audit reports, Yamlr aggressively masks system-specific absolute paths:
~: User home directory paths are redacted.[TMP]: System temporary directories are masked..: Current Working Directory is localized to promote environment-neutral results.- Standard Roots: Common sensitive Linux/K8s paths are audited but never leaked in raw form.
2. Supply Chain & I/O Safety
- YAML Bomb Protection: Standard depth limits prevent "Billion Laughs" Denial of Service attacks during manifest parsing.
- SSRF Mitigation: Remote policy fetching (
--data http://...) includes size limits and timeout gates to prevent internal network scanning.
- TOCTOU Hardening: All file writes use atomic
fsync+renamecycles within a protected, permissioned backup vault.
- Memory Hygiene: Sensitive environment variables like
Yamlr_LICENSE_KEYare scrubbed from memory immediately after verification.
3. Verification & Trust
- Signatures: Pro features utilize HMAC-SHA256 JWT validation with constant-time cryptographic comparisons.
- Local-First: 100% of analysis happens locally. No source code or manifest content is ever transmitted to Yamlr servers.
4. Expert Diagnostic Assets (PII-Redacted Forensics)
For deep forensic analysis, Yamlr provides expert-level logs that are redacted by default:
- --forensic-debug: Enables ree_dna.log and pe_debug.log.
- Redaction: System paths (CWD, HOME, TMP) and sensitive keys are masked to ensure zero PII leaks during forensic debugging.
- Off-by-Default: These assets are only generated when explicitly requested for deep-dive support cycles.
--
π Summary
Yamlr is not a linter.
It is a Kubernetes configuration safety engine.
It complements your existing toolchain.
It prevents silent deployment failures before they reach production.
Runs locally. Deterministic. Safe.