Platform Updates8 min read

Policy Engine Ships: Guardrails and Coverage for workflow automation

By Arielle Santos

TL;DR

ButterGrow is shipping Policy Engine and Run Policies, a built-in control layer that evaluates every run in context and applies the right action without code changes. The release introduces coverage reporting, reusable policy packs, and native approvals that work across channels. The system helps teams move faster while keeping data handling predictable. It adds a single place to declare rules, measure their reach, and raise exceptions when needed. The primary upgrade is a safer path to workflow automation without slowing shipping velocity.

What shipped and why it matters

Policy Engine adds a unified evaluator, a small decision graph that runs alongside each job and observes parameters like channel, audience, region, budget, and creative metadata. The evaluator decides whether to block, warn, or route for approval. Run Policies are the declarative files you attach to playbooks, folders, or entire workspaces. Coverage dashboards show where rules apply and where gaps remain. This combination closes the trust gap that often appears when teams scale automation to dozens of channels and regions.

The release includes three concrete components:

  • A declarative policy language with typed references to playbook inputs and resolved secrets.
  • An enforcement runtime that supports block, warn, and gate actions with audit logs.
  • A coverage and outcomes model that reports evaluation rate, violation counts, and approval latency.

You can explore ButterGrow from the product entry point at ButterGrow and review the full set of AI marketing automation features that now include policies as a first class module.

How the system works in production

The goal is to keep policy logic close to the run while separating it from business steps. That way, policy changes ship independently, which reduces change risk and keeps operations compliant.

Step 1Define policies in code or no code

Policies live as YAML files. Each policy has a selector, a condition, and an action. Selectors decide where the rule applies. Conditions evaluate against typed fields. Actions describe what to do when a violation occurs.

apiVersion: policy.buttergrow/v1
kind: RunPolicy
metadata:
  name: required-consent-for-eu
spec:
  selector:
    channels: ["email", "sms"]
    region: "EU"
  condition: inputs.consent.status == "granted"
  action:
    onFail: "gate"
    approvalRoute: "Privacy Team"
    message: "Consent is required for EU audiences"

The same structure supports prohibited audiences, creative labeling, spend caps, and per channel checks.

Step 2Attach policies to playbooks or workspaces

Attach at the smallest useful scope. Teams often start at the folder level for shared playbooks, then apply workspace wide guardrails. Attaching at different scopes allows local exceptions to be documented. For example, a sandbox workspace can run in evaluation mode while production uses strict enforcement.

Step 3Choose enforcement mode per policy

Each policy supports three enforcement modes. Block stops the run and records an incident. Warn continues the run and logs the violation. Gate routes to a named approval flow and waits for a decision. Approvals can be time boxed and layered so that spend thresholds route to Finance while privacy issues route to Legal.

Step 4Measure coverage and outcomes

Coverage shows what percent of eligible runs actually pass through a relevant policy. It also surfaces the shape of exceptions. Outcomes show violation rates and the time between violation and resolution. These reports make it obvious where teams need to add rules or reduce noisy ones. Many teams use coverage alongside action latency to spot brittle processes, and they track both in the same weekly review.

Example policies you can use today

Below are four practical examples you can paste into your repository. They showcase common scenarios across channels.

Prohibited audience in a social channel

apiVersion: policy.buttergrow/v1
kind: RunPolicy
metadata:
  name: block-employee-retargeting
spec:
  selector:
    channels: ["social"]
  condition: !inputs.audience.includes("employees")
  action:
    onFail: "block"
    message: "Employee audiences are excluded from social retargeting"

Spend cap with budget aware approvals

apiVersion: policy.buttergrow/v1
kind: RunPolicy
metadata:
  name: daily-spend-cap
spec:
  selector:
    channels: ["ads"]
  condition: inputs.spend.daily <= params.max_daily_spend
  action:
    onFail: "gate"
    approvalRoute: "Finance"
    message: "Proposed spend exceeds the daily cap"

Region aware data routing

apiVersion: policy.buttergrow/v1
kind: RunPolicy
metadata:
  name: route-eu-data
spec:
  selector:
    channels: ["email", "ads"]
  condition: true
  action:
    onFail: "warn"
    message: "N/A"
  sideEffects:
    runnerGroup: "eu"

Creative labeling with structured checks

apiVersion: policy.buttergrow/v1
kind: RunPolicy
metadata:
  name: creative-label-required
spec:
  selector:
    channels: ["ads", "social"]
  condition: inputs.creative.labels.any(["original", "ai-generated"]) == true
  action:
    onFail: "block"
    message: "Creative must be labeled as original or ai-generated"

Default policy packs and templates

To reduce setup time, we ship a small library of policy packs. These include regional consent checks, data residency routing, prohibited audience catalogs, spend caps, and labeling rules. You can fork a pack and specialize it by channel or brand. Packs are versioned so that updates can be diffed and rolled out gradually.

Our earlier release of OpenClaw Diff and Dry-Run Mode makes it straightforward to roll policy changes safely. Many teams deploy in evaluation mode first, then enable block or gate after a week of observation.

Measuring policy coverage

Coverage is first class. Dashboards show evaluation rate by channel, region, and workspace. The metric is simple: eligible runs that hit a policy divided by total eligible runs in the same period. The numerator counts runs that reached the evaluator. The denominator excludes runs that are out of scope so that coverage does not penalize channels without applicable checks.

Teams should pair coverage with outcome quality. A high coverage with low violations can be healthy or it can signal that rules are not specific enough. A low coverage in a high risk channel indicates a gap. For a deeper discussion on the metric, see our analysis on why policy engines matter for AI marketing which explains coverage alongside approval and incident rates.

External standards informed the design. The NIST AI Risk Management Framework outlines how to identify and manage risk in automated systems, and it emphasizes measurable controls. The IAB Tech Lab Global Privacy Platform documents signals that carry user privacy choices across the ad stack, which helps structure consent checks. The UK ICO guidance on data protection by design and default reinforces building privacy into the process rather than treating it as a bolt on.

Governance that does not slow builders

Policies are designed to reduce friction for implementers. Builders can keep their playbooks simple while governance teams add rules around them. Automation workflows do not need to include error prone conditionals or copy pasted checks. This separation of concerns yields simpler code and more predictable reviews.

Approvals integrate with chat and email. Reviewers see context such as audience snapshots, proposed spend, creative thumbnails, and the exact rule that fired. Decisions are recorded with timestamps and reasons. Repeated approvals for the same scenario can be turned into a policy update, which reduces future friction.

Deployment model and compatibility

Policy evaluation runs beside each job as a lightweight step that reads typed inputs, outputs, and the plan. The evaluator keeps CPU and memory overhead low by caching selectors and reusing compiled conditions. It is compatible with typed playbooks, schema registry, and secretless auth features. When a policy references a field that no longer exists, preflight fails with a clear error and the diff highlights the mismatch.

Policy changes benefit from the same safety rails as code. Teams use draft runs, preflight checks, and dry runs to validate changes. They can also isolate changes in preview environments before promoting to production.

What this unlocks for teams

Policy Engine gives operations and governance teams the same leverage that feature flags gave application developers. It centralizes guardrails, makes them measurable, and integrates approvals where human judgment is required. The result is faster delivery with fewer incidents and clearer accountability. Teams can remove bespoke checks from playbooks and instead declare rules once for consistent enforcement.

If you are rolling out autonomous agents for advertising, policy driven approvals are a practical way to start. It is easier to justify broader automation when a reviewer can see violations, reasons, and outcomes for each decision. This is also how to enforce marketing data policies across workflows without piling on brittle conditionals.

Getting started

You can try the feature in new or existing workspaces. Start by attaching evaluation mode policies to one high traffic playbook. Watch the dashboards for a week to gauge coverage and violation patterns. Then enable blocking or gating on the rules that matter most. The product documentation includes examples and a small starter pack that you can adapt to your brand.

If you are ready to expand, the guide to answers to common questions covers approvals and coverage dashboards, and you can browse more from the ButterGrow blog for deeper dives. For background on the philosophy, see our analysis on why policy engines matter for AI marketing. ButterGrow is the hosted OpenClaw assistant that ships with governance built in.

The last note is a small reminder. Measure policy coverage alongside approval latency. Both are leading indicators of operational health. Most teams set a quarterly target for coverage and keep a simple report in their weekly operations review.

ButterGrow customers can enable Policy Engine today. Existing workspaces receive the evaluator upgrade automatically. New workspaces include policy packs by default so you can attach them during onboarding without extra setup. The launch brings better visibility to enforcement and outcomes so teams can build with confidence. The platform continues to make orchestrated workflows safer and easier to operate at scale.

Try the new Policy Engine by opening a workspace and following the get started in minutes guide. Attach a starter pack, enable evaluation mode, and review coverage after the first week.

References

Frequently Asked Questions

How do Run Policies differ from approval gates in ButterGrow?+

Run Policies are always-on rules evaluated at execution time, while approval gates are a human-in-the-loop control that can be invoked as a policy action. You can use policies to block, warn, or route a run to a specific approval path based on context such as channel, audience segment, or spend.

What is a good starting set of policies for an ad account with regional consent rules?+

Start with consent verification per region, prohibited audience blocks, and spend caps per campaign. Add a data residency rule that routes EU data to the EU runner group. Use policy coverage reports to confirm that at least 90 percent of eligible runs are evaluated by these rules.

How is policy coverage calculated in the new dashboards?+

Coverage is the percentage of runs that matched at least one relevant policy for their channel, audience, or data region over a selected window. The metric includes a denominator of eligible runs and a numerator of runs that reached a policy evaluation step, which helps identify gaps in enforcement.

Can I test policies without risking production changes?+

Yes. Use evaluation mode with shadow enforcement to log violations without blocking the run. Combine this with dry runs to review proposed actions and policy decisions before enabling strict enforcement in production.

How do policies integrate with OpenClaw typed playbooks and schema validation?+

Policies can reference typed inputs and schema fields so that checks are validated at compile time. When schemas change, the policy evaluator surfaces mismatches during preflight, which reduces runtime errors and keeps enforcement deterministic.

What happens if a policy times out or the evaluator is unavailable?+

You can configure a fail open or fail closed mode per workspace. Fail open allows the run to proceed while emitting an alert; fail closed blocks the run and escalates to on-call. Most teams choose fail closed for compliance-critical rules and fail open for low-risk checks.

Ready to try ButterGrow?

See how ButterGrow can supercharge your growth with a quick demo.

Book a Demo