Note: This document provides a high-level overview of the framework architecture. For technical implementation details, see Software Architecture.
The Thoth Framework is a Configuration Control Plane for Infrastructure as Code โ a system that treats IaC configuration not as static files applied at deploy time, but as a continuously validated, policy-enforced control surface distributed via Git.
ThothCTL is the CLI that implements this control plane. It combines a 4-layer architecture with the safety patterns that hyperscalers use for configuration management at scale: staged rollout, blast-radius containment, dependency-aware validation, and automated correction.
In modern distributed systems, configuration is a control plane operation โ it directly alters system behavior and must be treated with the same rigor as production code. The Thoth Framework applies this principle to Infrastructure as Code:
%%{init: {'theme':'base', 'themeVariables': {
'primaryColor':'#3b82f6',
'primaryTextColor':'#ffffff',
'primaryBorderColor':'#2563eb',
'lineColor':'#94a3b8',
'secondaryColor':'#10b981',
'tertiaryColor':'#8b5cf6',
'background':'transparent',
'mainBkg':'#3b82f6',
'secondBkg':'#10b981',
'tertiaryBkg':'#8b5cf6',
'clusterBkg':'rgba(241, 245, 249, 0.05)',
'clusterBorder':'#475569',
'titleColor':'currentColor',
'edgeLabelBackground':'transparent',
'nodeTextColor':'#ffffff',
'textColor':'currentColor',
'nodeBorder':'#1e293b',
'fontSize':'14px'
}}}%%
graph TB
subgraph source["<b>๐ Declarative Source of Truth (Git)</b>"]
direction LR
RULES[".thothcf.toml<br/>Org rules"]
POLICY["OPA/Rego<br/>Policy repo"]
SCAFFOLDS["Scaffolds<br/>Templates"]
TOML["Space config<br/>Credentials"]
end
subgraph controlplane["<b>โ๏ธ Configuration Control Plane (ThothCTL)</b>"]
direction LR
VALIDATE["<b>Validate</b><br/>Schema + policy<br/>Pre-deployment"]
GENERATE["<b>Generate</b><br/>Intent โ governed<br/>IaC code"]
ENFORCE["<b>Enforce</b><br/>Scan + review<br/>Enforcement gates"]
RECONCILE["<b>Reconcile</b><br/>Drift detection<br/>Self-correction"]
end
subgraph targets["<b>โ๏ธ Infrastructure (Desired State)</b>"]
direction LR
TF["Terraform"]
TG["Terragrunt"]
CDK["CDK v2"]
CFN["CloudFormation"]
end
source --> controlplane
controlplane --> targets
targets -.->|"actual state"| RECONCILE
classDef sourceStyle fill:#f59e0b,stroke:#d97706,stroke-width:2px,color:#fff
classDef cpStyle fill:#3b82f6,stroke:#2563eb,stroke-width:3px,color:#fff
classDef targetStyle fill:#10b981,stroke:#059669,stroke-width:2px,color:#fff
class RULES,POLICY,SCAFFOLDS,TOML sourceStyle
class VALIDATE,GENERATE,ENFORCE,RECONCILE cpStyle
class TF,TG,CDK,CFN targetStyle
The Thoth Framework maps directly to the industry-standard configuration safety patterns:
| Control Plane Pattern | Thoth Implementation | How It Works |
|---|---|---|
| Declarative source of truth | Git repos (org policies, scaffolds, .thothcf.toml) |
All configuration rules, templates, and governance live in version-controlled Git. No ad-hoc changes. |
| Schema validation | .thothcf.toml rules + OPA/Rego |
Naming conventions, required tags, security policies, and architectural constraints are validated before and during changes. |
| Staged rollout | workflow devsecops phases + enforcement gates |
Changes progress through Plan โ Build โ Test โ Secure โ Deploy with hard/soft gates at each phase. |
| Blast-radius containment | Spaces + per-stack scoping + --changed-only |
Spaces isolate projects with credential boundaries. Workflow scopes execution to changed stacks only. |
| Pre-deployment validation | scan iac + check iac + plan validation |
Multi-scanner security checks, cost analysis, and terragrunt plan validation before any apply. |
| Continuous reconciliation | check iac -type drift + scan history |
Drift detection compares live state against declared IaC. Scan history tracks compliance trends over time. |
| Policy enforcement | OPA/Rego evaluated at generation + scan time | Org policies enforced both when generating new code and when validating existing code. |
| Automated rollback / correction | Self-correction loops (generate โ validate โ fix โ retry) | AI generates code, scanner validates, violations fed back to AI for correction (max 3 iterations). |
| Dependency-aware impact analysis | Blast radius (ITIL v4) + cost analysis | Changes assessed for risk score, affected resource count, and cost impact before promotion. |
| Non-human identity & audit | Agent governance (Phase 2.5) + memory persistence | Every AI agent action logged with identity, budget tracked, decisions auditable. |
Unlike traditional configuration management (Chef, Puppet, Ansible) where a central server pushes state to agents, Thoth uses Git as the distributed configuration plane:
Organization Git Repos (Source of Truth)
โโโ org-iac-policies/ โ OPA/Rego rules (security, compliance)
โโโ terraform-scaffold/ โ Terraform project structure
โโโ terragrunt-scaffold/ โ Multi-environment Terragrunt
โโโ terraform-module-scaffold/ โ Reusable module patterns
โโโ cdk-scaffold/ โ AWS CDK v2 (TypeScript/Python)
โโโ cloudformation-scaffold/ โ CloudFormation / SAM
โโโ per-project .thothcf.toml โ Local overrides within org bounds
ThothCTL (Reconciler)
โโโ Reads org policies from Git (THOTH_ORG_POLICY env var)
โโโ Reads scaffolds from Git (thothforge org or custom)
โโโ Merges hierarchical rules (org โ space โ project)
โโโ Validates, generates, and enforces against this compiled context
โโโ Detects drift between declared (Git) and actual (cloud) state
This means:
Traditional IaC tools treat configuration as a static file problem: write HCL, apply, done. The control plane model recognizes that IaC configuration is a live system that:
Thoth addresses this by embedding safety directly into the control plane โ not as external gates bolted onto CI/CD, but as intrinsic properties of how configuration is authored, validated, and applied.
The control plane is implemented through a layered architecture with clear separation of concerns:
%%{init: {'theme':'base', 'themeVariables': {
'primaryColor':'#3b82f6',
'primaryTextColor':'#ffffff',
'primaryBorderColor':'#2563eb',
'lineColor':'#94a3b8',
'secondaryColor':'#10b981',
'tertiaryColor':'#8b5cf6',
'background':'transparent',
'mainBkg':'#3b82f6',
'secondBkg':'#10b981',
'tertiaryBkg':'#8b5cf6',
'clusterBkg':'rgba(241, 245, 249, 0.05)',
'clusterBorder':'#475569',
'titleColor':'currentColor',
'edgeLabelBackground':'transparent',
'nodeTextColor':'#ffffff',
'textColor':'currentColor',
'nodeBorder':'#1e293b',
'fontSize':'14px'
}}}%%
graph TB
subgraph layer4["<b>๐จ Developer Experience Layer</b><br/><i>Intuitive interfaces and AI assistance</i>"]
direction LR
CLI["<b>CLI Interface</b><br/>Rich terminal UI<br/>Autocompletion<br/>Cross-platform"]
AI["<b>AI Assistant</b><br/>Kiro ยท Claude + MCP<br/>Natural language<br/>26 MCP tools"]
SKILLS["<b>Skills</b><br/>Reusable knowledge<br/>Decision logic<br/>Remediation"]
DOCS["<b>Documentation</b><br/>Auto-generation<br/>AI-powered<br/>Multi-format"]
TMPL["<b>Templates</b><br/>Jinja2 engine<br/>Code generation<br/>Scaffolding"]
end
subgraph layer3["<b>โก Platform Capabilities Layer</b><br/><i>Core IDP functionality</i>"]
direction LR
SEC["<b>Security</b><br/>Checkov โข Trivy<br/>KICS โข OPA<br/>Compliance"]
COST["<b>Cost Analysis</b><br/>Real-time pricing<br/>14 AWS services<br/>Optimization"]
INV["<b>Inventory</b><br/>Dependencies<br/>Version tracking<br/>Reports"]
VAL["<b>Validation</b><br/>Environment<br/>IaC checks<br/>Blast radius"]
GEN["<b>Generation</b><br/>Stacks<br/>Components<br/>Boilerplate"]
WF["<b>Workflow</b><br/>DevSecOps SDLC<br/>Phase orchestration<br/>Enforcement gates"]
POL["<b>Policy</b><br/>OPA/Rego<br/>Org policies<br/>Remote repos"]
end
subgraph layer2["<b>๐ง IaC Tool Integration Layer</b><br/><i>Multi-tool support through parsers and CLI</i>"]
direction LR
TF["<b>Terraform</b><br/>HCL Parser<br/>CLI Execution"]
TG["<b>Terragrunt</b><br/>Parser Class<br/>CLI Execution"]
TOFU["<b>OpenTofu</b><br/>HCL Parser<br/>CLI Execution"]
CFN["<b>CloudFormation</b><br/>JSON/YAML<br/>AWS API"]
CDK["<b>CDK v2</b><br/>Synth Parser<br/>CLI Execution"]
end
subgraph layer1["<b>๐๏ธ Foundation Layer</b><br/><i>Building blocks for the framework</i>"]
direction LR
SCAFFOLD["<b>Git Scaffolds</b><br/>Templates<br/>Best practices<br/>Reusable"]
SPACE["<b>Spaces</b><br/>Multi-tenancy<br/>Credentials<br/>Isolation"]
ENV["<b>Environment</b><br/>Tool bootstrap<br/>Cross-platform<br/>Automated"]
CONFIG["<b>Configuration</b><br/>Hierarchical<br/>TOML format<br/>Overrides"]
end
CLI -.->|uses| SEC
AI -.->|orchestrates| GEN
DOCS -.->|leverages| TMPL
SEC -.->|scans| TF
COST -.->|analyzes| TG
INV -.->|tracks| TOFU
VAL -.->|validates| CFN
GEN -.->|generates| CDK
WF -.->|orchestrates| SEC
POL -.->|enforces| TF
TF -.->|uses| SCAFFOLD
TG -.->|operates in| SPACE
TOFU -.->|requires| ENV
CFN -.->|reads| CONFIG
CDK -.->|uses| SCAFFOLD
SKILLS -.->|guides| AI
classDef layer4Style fill:#3b82f6,stroke:#60a5fa,stroke-width:3px,color:#fff
classDef layer3Style fill:#10b981,stroke:#34d399,stroke-width:3px,color:#fff
classDef layer2Style fill:#8b5cf6,stroke:#a78bfa,stroke-width:3px,color:#fff
classDef layer1Style fill:#f59e0b,stroke:#fbbf24,stroke-width:3px,color:#fff
class CLI,AI,SKILLS,DOCS,TMPL layer4Style
class SEC,COST,INV,VAL,GEN,WF,POL layer3Style
class TF,TG,TOFU,CFN,CDK layer2Style
class SCAFFOLD,SPACE,ENV,CONFIG layer1Style
ThothCTL aligns with IDP business objectives through five core principles:
| Principle | Mechanism | Implementation |
|---|---|---|
| Minimize Mistakes | Meaningful defaults | Templates & scaffolds |
| Increase Velocity | Automation | IaC scripts & workflows |
| Improve Products | Fill product gaps | New components & tools |
| Enforce Compliance | Restrict choices | Wrappers & policies |
| Reduce Lock-in | Abstraction | Service layers & adapters |
Building blocks for the framework
| Component | Purpose | Key Features |
|---|---|---|
| Git Scaffolds | Project templates | Pre-configured structures, best practices, rapid creation |
| Spaces | Multi-tenancy | VCS integration, credential isolation, project organization |
| Environment | Tool bootstrap | Automated setup, version management, cross-platform |
| Configuration | Settings management | Hierarchical TOML, environment overrides, secure credentials |
Official Scaffolds:
Commands: thothctl init env, thothctl init space, thothctl init project
Multi-tool support through parsers and CLI wrappers
| Tool | Parser | Execution | Status |
|---|---|---|---|
| Terraform | HCL Parser | CLI Wrapper | โ Full Support |
| Terragrunt | Custom Parser | CLI Wrapper | โ Full Support |
| OpenTofu | HCL Parser | CLI Wrapper | โ Full Support |
| CloudFormation | JSON/YAML | AWS API | โ Full Support |
| CDK v2 | Synth Parser | CLI Wrapper | โ Full Support |
Key Features:
Commands: thothctl project iac, thothctl generate
Core IDP functionality
Multi-tool security scanning with Checkov, Trivy, KICS, and Snyk.
๐ Details: Security Scanning
Real-time AWS cost estimation with 14 services, automated HTML/JSON reports.
Commands: thothctl check iac -type cost-analysis
๐ Details: Cost Analysis
Dependency tracking, version checking, professional HTML reports.
Commands: thothctl inventory iac --check-versions
๐ Details: Inventory Management
Environment validation, IaC checks, blast radius analysis.
Commands: thothctl check environment, thothctl check iac -type blast-radius
๐ Details: Validation
Stack generation, component creation, boilerplate automation.
Commands: thothctl generate
๐ Details: Code Generation
Composite DevSecOps pipeline orchestration โ chains multiple commands into SDLC phases with enforcement gates and live progress.
Phases: plan โ develop โ build โ test โ secure โ deploy โ monitor
Commands: thothctl workflow devsecops --phase all, --phase secure, --phase pre-deploy
| ๐ Details: Workflow Command | DevSecOps SDLC |
Organization-level governance via OPA/Rego policies distributed from centralized Git repositories.
Features:
Commands: thothctl scan iac -t opa --policy-dir <git-url>
๐ Details: Policy as Code
Intuitive interfaces and AI assistance
Rich terminal UI with autocompletion, cross-platform support, and modern UX.
Features:
Agent companion integration with 26 tools via Model Context Protocol (MCP).
Capabilities:
thothctl_workflow_devsecops MCP tool๐ Details: AI-Powered Development
Reusable knowledge packages (.kiro/skills/) that teach AI agents domain-specific procedures, decision logic, and remediation patterns.
Bundled Skills:
devsecops โ DevSecOps SDLC orchestration, intent routing, remediation patternsterraform-skill โ Terraform/Terragrunt patterns, module design, state managementiac-versioning-commits โ Conventional commits and versioning for IaCStructure:
.kiro/skills/<skill-name>/
โโโ SKILL.md # Decision logic, procedures, response patterns
โโโ references/ # Domain knowledge (commands, fixes, templates)
Distribution: Skills are included in scaffold templates and distributed to new projects automatically.
๐ Details: DevSecOps Skill
Automated documentation with AI-powered content generation.
Commands: thothctl document iac, thothctl document iac --ai
๐ Details: Documentation
Jinja2-based code generation with scaffolding support.
Features:
๐ Details: Template Engine
ThothCTL supports comprehensive IDP workflows:
| Use Case | Commands | Documentation |
|---|---|---|
| Project Initialization | init env, init space, init project |
Getting Started |
| DevSecOps Pipeline | workflow devsecops --phase all |
DevSecOps SDLC |
| Security Scanning | scan iac -t checkov -t trivy -t opa |
Security |
| Policy Enforcement | scan iac -t opa --policy-dir <url> |
Policy as Code |
| Cost Analysis | check iac -type cost-analysis |
Cost Analysis |
| Dependency Management | inventory iac --check-versions |
Inventory |
| Drift Detection | check iac -type drift |
Check Command |
| Documentation | document iac --ai |
Documentation |
| AI Development | Kiro ยท Claude + MCP + Skills | AI-DLC |
| Observability | dashboard launch |
Dashboard |
๐ Complete Use Cases: Use Cases Documentation
1. Global Config (~/.thothctl/config.toml)
2. Space Config (.thothcf-<space>.toml)
3. Project Config (.thothcf.toml)
4. Environment Vars (THOTHCTL_*)
Example Configuration:
[project]
name = "my-infrastructure"
type = "terraform"
[space]
name = "lab-github"
vcs = "github"
[tools]
terraform_version = "1.6.0"
terragrunt_version = "0.54.0"