> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flokitai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Guardrails

> Control what FloKit can recommend, prepare, and execute.

Guardrails define the boundary between FloKit observing, recommending, and acting. They determine which actions enter the approval queue, what FloKit is permitted to execute, and when a running action should be reversed. Configure guardrails before enabling any write access to your ad platforms.

```mermaid theme={null}
flowchart TD
    PROPOSED["Action proposed<br/>(draft)"] --> CHECKS{"Guardrail checks:<br/>spend caps, excluded entities,<br/>confidence threshold, action type"}
    CHECKS -- "All pass" --> QUEUE["ready_for_approval<br/>(visible in queue)"]
    CHECKS -- "Any fail" --> HELD["Held in draft<br/>(guardrail.triggered fires)"]
    QUEUE --> RUNNING["Approved and running"]
    RUNNING --> MONITOR{"Rollback trigger<br/>breached?"}
    MONITOR -- "No" --> COMPLETED["Completed"]
    MONITOR -- "Yes" --> ROLLBACK["Flag for review or auto-rollback<br/>(guardrail.triggered fires)"]
```

***

## What guardrails control

**Spend caps**
Set a maximum budget movement per action and per campaign. FloKit will not generate an action that exceeds these limits, even if the expected payback impact is high. Caps are enforced independently per action — a single action cannot move more than the per-action cap, even if the daily cap has remaining headroom.

**Excluded entities**
Mark specific campaigns, ad sets, countries, or audience segments that FloKit cannot touch. Common exclusions: brand campaigns, campaigns in active manual A/B tests, and markets with regulatory constraints.

**Confidence thresholds**
Set the minimum statistical confidence required before an action moves from `draft` to `ready_for_approval`. FloKit's default is 80%. Recommended setting for new workspaces: 85%.

**Action types**
Disable entire categories of actions. For example, if your growth team manages paywall experiments separately through a dedicated tool, disable the `paywall_experiment` action type in FloKit to prevent duplication.

**Approval requirements**
Require named approvers or a minimum number of approvals for specific action types. For example: require two approvals for any `budget_shift` above \$10,000/week, and allow single-approver review for `creative_pause` actions.

**Rollback triggers**
Define the metric thresholds that trigger an automatic rollback for any running action. FloKit monitors CAC and ROAS continuously while an action is in `running` state. If a threshold is breached, FloKit can flag the action for manual review or roll back automatically, depending on your configuration.

***

## Recommended guardrail setup before your first action

Before approving any action, configure at minimum:

* **Daily spend cap**: Set to ≤20% of your current daily budget. This limits blast radius while you're validating FloKit's recommendations.
* **Excluded campaigns**: Exclude any campaign currently in an active manual A/B test.
* **Minimum confidence threshold**: Set to 85%.
* **Approval mode**: Require manual approval for all action types.
* **Rollback trigger**: Auto-flag (or auto-rollback) if CAC increases more than 25% within 72 hours of an action going live.

<Warning>
  Keep write access disabled and all actions in approval-required mode until you have 30 days of validated payback data and at least 5 completed action cycles with recorded outcomes. Teams that move to automation before this baseline is established have higher rollback rates and slower trust recovery when regressions occur.
</Warning>

***

## Configuring guardrails

Go to **FloKit → Settings → Guardrails**.

Guardrails are configured per workspace. If you manage multiple apps or geos within a single workspace, you can apply different guardrail profiles per channel — for example, stricter spend caps on brand campaigns than on performance campaigns.

**Per-channel guardrail example:**

| Channel                   | Spend cap (per action) | Confidence threshold | Approval        |
| ------------------------- | ---------------------- | -------------------- | --------------- |
| Paid social — performance | \$5,000/week           | 80%                  | Single approver |
| Paid social — brand       | \$1,000/week           | 90%                  | Two approvers   |
| Apple Search Ads          | \$2,000/week           | 80%                  | Single approver |

***

## Guardrail events

When a guardrail triggers — either preventing an action from entering the queue or rolling back a running action — FloKit fires a `guardrail.triggered` webhook event and sends a notification in the dashboard.

Example webhook payload:

```json theme={null}
{
  "event": "guardrail.triggered",
  "action_id": "act_01hx9z...",
  "action_type": "budget_shift",
  "guardrail": "spend_cap",
  "detail": "Proposed budget shift of $8,200 exceeds per-action cap of $5,000.",
  "timestamp": "2025-06-15T10:22:00Z"
}
```

See [Webhooks](/api-reference/webhooks) for the full event schema and delivery configuration.
