---
title: "CloudFormation Guard integrity"
description: "See how policy intent stays intact across evaluation, reporting, tests, and published rule packs in Madison Hope Steiner's CloudFormation Guard work."
url: https://mh0pe.github.io/work/cloudformation-guard/
author: "Madison Hope Steiner"
---

CloudFormation Guard

# Policy results that preserve intent.

I corrected cases where Guard could hide a rejection between evaluating a rule and reporting the result. That fix shipped in Guard 3.2.1.

**My decision.** I tested which rule failed and why. A nonzero exit alone could mean that a different rule failed.

This change corrected cases where the evaluator or reporter could hide a rejection. Its regression tests cover those cases, not every policy in a rule pack.

[Inspect the verdict correction in Guard PR #717](https://github.com/aws-cloudformation/cloudformation-guard/pull/717) [Find the verdict fix in the Guard 3.2.1 release](https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.1)

[CloudFormation Guard source code](https://github.com/aws-cloudformation/cloudformation-guard)

**Who this helps**
Cloud platform and security teams that rely on policy checks to make safe infrastructure decisions.

**My role**
I traced policy errors across evaluation and reporting, corrected the semantics, and added regression coverage for the full verdict path.

**Current state**
Guard 3.2.1 corrected verdict reporting. Guard 3.2.2 preserves surrounding text during replacements and pairs rules with their intended tests.

**Public activity**
Public contribution activity · 2026

**Other changes in this project**

Other changes in this project

On GitHub

- [Open project: aws-cloudformation/cloudformation-guard](https://github.com/aws-cloudformation/cloudformation-guard)

    [**Guard #727: query and reporting behavior** Read the reviewed change](https://github.com/aws-cloudformation/cloudformation-guard/pull/727)

    Historical reversal within PR #727: this commit undid a change to text replacement during review.

    **Implementation details**

    [Historical reversal within PR #727 — Revert "Keep the text regex\_replace did not match, instead of only the captures"](https://github.com/aws-cloudformation/cloudformation-guard/commit/40195e57d619837ace3269a13d4b5fad11f50629) [Related file — guard/src/rules/functions/strings\_tests.rs](https://github.com/aws-cloudformation/cloudformation-guard/blob/40195e57d619837ace3269a13d4b5fad11f50629/guard%2Fsrc%2Frules%2Ffunctions%2Fstrings_tests.rs)
- aws-cloudformation/cloudformation-guard

    [**Guard #720: outcomes for empty comparisons** Read the reviewed change](https://github.com/aws-cloudformation/cloudformation-guard/pull/720)

    Historical reversal within PR #720: this commit undid a change to how Guard reported test files without a matching rule.

    **Implementation details**

    [Historical reversal within PR #720 — Revert "Name the test files no rules file claimed, instead of dropping them in silence"](https://github.com/aws-cloudformation/cloudformation-guard/commit/fe089407b3a423bfa3df8e2f329492244070d607) [Related file — guard/tests/test\_command.rs](https://github.com/aws-cloudformation/cloudformation-guard/blob/567c0d7b93cca9746ed6d478defd809ed5094634/guard%2Ftests%2Ftest_command.rs)

How it works / 06 stages

## From constraint to a system a team can own.

Six stages connect the original pressure to the system that now exists.

Keep the meaning in the result.

**Policy + input**

Evaluate, then explain

- **Meets the rule** A passing result

- **Does not meet it** A rejection and its reason

- **Nothing to compare** Missing is not a pass

- **Evaluation error** The check could not complete

Keep the rule fixed and change the input. A missing value or an evaluation error does not turn into a passing result.

1. Pressure

    ### A policy verdict must carry its meaning end to end.

    Infrastructure policy depends on more than avoiding a crash. A rule can report compliance for input it should reject, a negative test can pass for the wrong reason, or a published pack can differ from the source checked in isolation. Operators need the verdict to preserve the policy author’s intent.

    [See the starting point](https://github.com/aws-cloudformation/cloudformation-guard)

    **More links from this decision**

    - [CloudFormation Guard #717, verdict integrity correction](https://github.com/aws-cloudformation/cloudformation-guard/pull/717)

2. Constraint

    ### Correctness crosses every evaluator boundary.

    Parser boundaries, empty collections, missing values, filters, captures, coercion, negation, reporting, test harnesses, and assembled rule packs all influence the final result. A superficial fix at the last symptom would leave neighboring false-confidence paths intact and make future regressions harder to localize.

    - Distinguish missing data from true, false, and error outcomes.
    - Preserve the rule path and diagnostic that produced a negative result.
    - Test the assembled pack that users consume, not only isolated source files.

    [Inspect the boundary](https://github.com/aws-cloudformation/cloudformation-guard/pull/717)

    **More links from this decision**

    - [Guard #720, historical review of four-valued outcomes](https://github.com/aws-cloudformation/cloudformation-guard/pull/720)
    - [Guard #727, historical review of query and reporter behavior](https://github.com/aws-cloudformation/cloudformation-guard/pull/727)
    - [Guard Rules Registry #287, assembled-pack assurance](https://github.com/aws-cloudformation/aws-guard-rules-registry/pull/287)

3. Decision

    ### Trace meaning, not just the process exit.

    The work treats correctness as a pipeline contract. Each change identifies the first semantic divergence, repairs it at the responsible layer, and then asserts both the outcome and the explanatory path. Negative tests must demonstrate that the intended rule failed, rather than accepting any nonzero process exit as proof.

    [Why a rejected policy needs a test for the reason it failed](https://mh0pe.github.io/decisions/#guard-fail-closed)

    [Review the decision](https://github.com/aws-cloudformation/cloudformation-guard/pull/717)

    **More links from this decision**

    - [Guard #720, historical review of four-valued outcomes](https://github.com/aws-cloudformation/cloudformation-guard/pull/720)
    - [Guard #727, historical review of query and reporter behavior](https://github.com/aws-cloudformation/cloudformation-guard/pull/727)

4. Implementation

    ### Strengthen the full verdict path.

    Guard #717 corrected evaluator and reporter defects and shipped in 3.2.1. Two separate reviews explored how to handle empty comparisons (#720) and how to report query results (#727). Each review includes commits that reverse an individual edit. For released behavior, follow the release notes.

    - Repair wrong-pass and missing-diagnostic behavior at the root semantic layer.
    - Inspect the proposed fourth outcome for empty and absent comparisons in the #720 review history.
    - Exercise published rule packs after assembly to catch duplicate declarations.
    - Treat ranges inside lists as range membership and keep non-finite number comparisons consistent.
    - Preserve unmatched text during replacements and pair each test with the most specific policy filename.

    [Inspect the build](https://github.com/aws-cloudformation/cloudformation-guard/pull/717)

    **More links from this decision**

    - [Guard #720, historical review of four-valued outcomes](https://github.com/aws-cloudformation/cloudformation-guard/pull/720)
    - [Guard #727, historical review of query and reporter behavior](https://github.com/aws-cloudformation/cloudformation-guard/pull/727)
    - [Guard #747, range membership in policy lists](https://github.com/aws-cloudformation/cloudformation-guard/pull/747)
    - [Guard #748, consistent non-finite number comparisons](https://github.com/aws-cloudformation/cloudformation-guard/pull/748)
    - [Guard #749, preserve text around pattern replacements](https://github.com/aws-cloudformation/cloudformation-guard/pull/749)
    - [Guard #750, match tests to the intended policy file](https://github.com/aws-cloudformation/cloudformation-guard/pull/750)
    - [Guard Rules Registry #287, assembled-pack assurance](https://github.com/aws-cloudformation/aws-guard-rules-registry/pull/287)

5. State

    ### The work spans a released fix and a broader integrity path.

    Guard 3.2.1 includes the evaluator and reporter correction. Guard 3.2.2 makes two everyday tasks more predictable: replacing part of a string and pairing a policy file with its tests. The linked public implementations also explore range and numeric behavior.

    [See where it works](https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.1)

    **More links from this decision**

    - [CloudFormation Guard 3.2.2 release notes](https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.2)
    - [CloudFormation Guard #717, verdict integrity correction](https://github.com/aws-cloudformation/cloudformation-guard/pull/717)
    - [Guard #749, preserve text around pattern replacements](https://github.com/aws-cloudformation/cloudformation-guard/pull/749)
    - [Guard #750, match tests to the intended policy file](https://github.com/aws-cloudformation/cloudformation-guard/pull/750)
    - [Guard #747, range membership in policy lists](https://github.com/aws-cloudformation/cloudformation-guard/pull/747)
    - [Guard #748, consistent non-finite number comparisons](https://github.com/aws-cloudformation/cloudformation-guard/pull/748)

6. Source

    ### Trace the verdict through code, fixtures, and release notes.

    The release notes credit the individual changes. The linked reviews and regression tests show how a rule’s meaning is preserved, from input to verdict.

    [Follow the public work](https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.1)

    **More links from this decision**

    - [CloudFormation Guard 3.2.2 release notes](https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.2)
    - [CloudFormation Guard #717, verdict integrity correction](https://github.com/aws-cloudformation/cloudformation-guard/pull/717)
    - [Guard #749, preserve text around pattern replacements](https://github.com/aws-cloudformation/cloudformation-guard/pull/749)
    - [Guard #750, match tests to the intended policy file](https://github.com/aws-cloudformation/cloudformation-guard/pull/750)
    - [Guard #747, range membership in policy lists](https://github.com/aws-cloudformation/cloudformation-guard/pull/747)
    - [Guard #748, consistent non-finite number comparisons](https://github.com/aws-cloudformation/cloudformation-guard/pull/748)
    - [Guard Rules Registry #287, assembled-pack assurance](https://github.com/aws-cloudformation/aws-guard-rules-registry/pull/287)

Public work / Implementation trail

## Inspect the work behind the result.

Open the working code, review discussions, exact changes, and documentation behind each part.

I write about these evaluator decisions on LinkedIn too: [A policy evaluator needs words for unfinished answers](https://www.linkedin.com/pulse/policy-evaluator-needs-words-unfinished-answers-steiner-cissp-p6fcf/) covers the four outcomes; [Keeping policy semantics visible during small refactors](https://www.linkedin.com/pulse/keeping-policy-semantics-visible-during-small-steiner-cissp-1h5kc/) covers membership and replacement behavior; and [A regression test should prove it can object](https://www.linkedin.com/pulse/regression-test-should-prove-can-object-madison-hope-steiner-cissp-cx93f/) covers how a check shows it would notice a change.

What changed

Available in release

### A verdict-integrity correction is available in CloudFormation Guard 3.2.1.

Implemented

**Where this work lives**

**Available now**
Available in the linked upstream release.

**Integration**
Merged upstream in Guard #717 and included in 3.2.1.

**What supports it**
Release-backed regression coverage for evaluator and reporter defects.

[CloudFormation Guard #717, verdict integrity correction](https://github.com/aws-cloudformation/cloudformation-guard/pull/717) [CloudFormation Guard 3.2.1](https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.1)

What changed

Available in public branch

### Policy authors can try more consistent range membership and numeric comparisons in the linked implementations.

Implemented

**Where this work lives**

**Available now**
Available in linked public pull-request branches.

**Integration**
Guard #747 and #748 carry focused implementations. The earlier reviews #720 and #727 include reversals of individual changes; the review histories do not establish what shipped. Rules Registry #287 covers assembled rule packs.

**What supports it**
Executable implementations with targeted fixtures and regression tests.

[Guard #747, range membership in policy lists](https://github.com/aws-cloudformation/cloudformation-guard/pull/747) [Guard #748, consistent non-finite number comparisons](https://github.com/aws-cloudformation/cloudformation-guard/pull/748) [Guard #720, historical review of four-valued outcomes](https://github.com/aws-cloudformation/cloudformation-guard/pull/720) [Guard #727, historical review of query and reporter behavior](https://github.com/aws-cloudformation/cloudformation-guard/pull/727) [Guard Rules Registry #287, assembled-pack assurance](https://github.com/aws-cloudformation/aws-guard-rules-registry/pull/287)

What changed

Available in release

### Pattern replacements keep the surrounding text, and tests run against the intended rule file even when filenames share a prefix.

Implemented

**Where this work lives**

**Available now**
Available in CloudFormation Guard 3.2.2.

**Integration**
Guard #749 and #750 are credited in the 3.2.2 release notes.

**What supports it**
Focused regression tests cover replacement boundaries and the most specific matching rule filename.

[CloudFormation Guard 3.2.2 release notes](https://github.com/aws-cloudformation/cloudformation-guard/releases/tag/3.2.2) [Guard #749, preserve text around pattern replacements](https://github.com/aws-cloudformation/cloudformation-guard/pull/749) [Guard #750, match tests to the intended policy file](https://github.com/aws-cloudformation/cloudformation-guard/pull/750)

Continue exploring

## Compare the decisions across systems.

Move to another result, or return to the complete work collection.

[Explore all work](https://mh0pe.github.io/work/) [Read my philosophy](https://mh0pe.github.io/method/) [Follow the public work](https://mh0pe.github.io/proof/)
