Skill 8.1.3
Implement guardrails and policy as code
Key Concepts
Guardrails are automated controls that keep usage within agreed limits. Preventive guardrails block a non-compliant action before it happens, such as denying the creation of resources without required tags or of GPU instances in unapproved regions. Detective guardrails find and report non-compliance, such as a daily report of untagged resources. Corrective guardrails fix it automatically, such as stopping an idle development instance.
Policy as code writes these rules as code in version control: Azure Policy definitions, AWS service control policies and tag policies, Cloud Custodian policies or Open Policy Agent rules in a pipeline. Rules are reviewed, tested and deployed like any other code, and changes are audited.
A practical sequence starts with detective controls and notifications so teams can fix issues themselves, moves to preventive controls for clear rules such as required tags, and uses corrective automation where the action is safe and owners have agreed to it. Every guardrail needs a documented exception process.