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

# Guardrails

> Guardrails are reusable usage policies that control which models your team can call, how often, and how much a member can spend. Create them in the dashboard and attach them to roles, members, or API tokens.

export const TechArticleSchema = ({title, description, path, articleSection, about, proficiencyLevel = "Beginner", dependencies, keywords = [], datePublished, dateModified, image, inLanguage = "en"}) => {
  const baseUrl = "https://www.edenai.co/docs";
  const canonicalUrl = `${baseUrl}/${path}`.replace(/\/+$/, "");
  const ogParams = new URLSearchParams({
    division: articleSection || "",
    title: title || "",
    description: description || ""
  });
  const resolvedImage = image || `https://edenai.mintlify.app/_mintlify/api/og?${ogParams.toString()}`;
  const data = {
    "@context": "https://schema.org",
    "@type": "TechArticle",
    "@id": `${canonicalUrl}#techarticle`,
    mainEntityOfPage: {
      "@type": "WebPage",
      "@id": canonicalUrl
    },
    headline: title,
    name: title,
    description: description,
    url: canonicalUrl,
    inLanguage: inLanguage,
    isPartOf: {
      "@type": "WebSite",
      name: "Eden AI Documentation",
      url: baseUrl
    },
    author: [{
      "@type": "Organization",
      name: "Eden AI",
      url: "https://www.edenai.co/"
    }],
    publisher: {
      "@type": "Organization",
      name: "Eden AI",
      url: "https://www.edenai.co/",
      logo: {
        "@type": "ImageObject",
        url: "https://www.edenai.co/assets/logo.png"
      }
    }
  };
  if (articleSection) data.articleSection = articleSection;
  if (about) data.about = {
    "@type": "Thing",
    name: about
  };
  if (proficiencyLevel) data.proficiencyLevel = proficiencyLevel;
  if (dependencies) data.dependencies = dependencies;
  if (keywords && keywords.length) data.keywords = keywords;
  if (datePublished) data.datePublished = datePublished;
  if (dateModified) data.dateModified = dateModified;
  data.image = Array.isArray(resolvedImage) ? resolvedImage : [resolvedImage];
  const json = JSON.stringify(data);
  const schemaId = `techarticle-${canonicalUrl}`;
  React.useEffect(() => {
    if (typeof document === "undefined") return;
    document.querySelectorAll(`script[data-schema-id="${schemaId}"]`).forEach(n => n.remove());
    const script = document.createElement("script");
    script.type = "application/ld+json";
    script.dataset.schemaId = schemaId;
    script.textContent = json;
    document.head.appendChild(script);
    return () => script.remove();
  }, [json, schemaId]);
  return null;
};

<TechArticleSchema title={"Guardrails"} description={"Guardrails are reusable usage policies that control which models your team can call, how often, and how much a member can spend. Create them in the dashboard and attach them to roles, members, or API tokens."} path="v3/organization/guardrails" articleSection="Organization" about={"Access Control"} proficiencyLevel="Intermediate" keywords={["Eden AI", "guardrails", "usage policy", "access control", "rate limits", "model restrictions", "budget cap", "spending limit"]} datePublished="2026-06-11T00:00:00Z" dateModified="2026-07-21T00:00:00Z" />

A **guardrail** is a reusable usage policy that controls:

* **Model access**: which providers and models can be called.
* **Rate limits**: how many requests can be made over a given period.
* **Member budget**: a spending cap for a member over a period (see [Budget cap](#budget-cap)).

You create a guardrail once, then attach it to a **role**, a **member**, or an individual **API token**. For example, one team can be limited to a curated set of models, a shared token can be capped to a low request rate, or a member can be given a monthly spending cap.

<Note>
  Guardrails are part of the advanced organisation features. See [plans and pricing](https://www.edenai.co/pricing) for availability.
</Note>

## Creating a guardrail

<Steps>
  <Step title="Open Guardrails in Settings">
    In the [Eden AI dashboard](https://app.edenai.run/), go to **Settings** and, under **Organization**, select **Guardrails**.
  </Step>

  <Step title="Create a new guardrail">
    Click **+ Create Guardrail** and give it a **Name** and an optional **Description**.
  </Step>

  <Step title="Set a rate limit (optional)">
    In the **Rate Limit** field, enter a limit in the form `N/period`, for example `10/minute`. Leave it blank to inherit the rate from the next level up. See [Rate limits](#rate-limits) below.
  </Step>

  <Step title="Restrict models (optional)">
    Turn on **Enable model rules** to control which models can be used, then define your allow/deny rules. See [Model rules](#model-rules) below.
  </Step>

  <Step title="Set a member budget (optional)">
    Enter a **Budget** amount and a **period** (daily, weekly, or monthly) to cap how much a member can spend. See [Budget cap](#budget-cap) below.
  </Step>

  <Step title="Save">
    Click **Create Guardrail**. It now appears in your guardrails list, ready to assign.
  </Step>
</Steps>

## Model rules

When you enable model rules, a guardrail uses a **default action** plus a list of **exceptions**:

* **Default**: `allow` or `deny` every model unless a rule says otherwise.
* **Rules**: each rule targets a model by pattern and sets its action to `allow` or `deny`. Rules are checked in order and the first match wins; if none match, the default applies.

Patterns can target a single model or a whole provider:

| Pattern         | Matches                        |
| --------------- | ------------------------------ |
| `openai/gpt-4o` | One specific model             |
| `anthropic/*`   | Every model from that provider |
| `*/*`           | Every model                    |

Each rule can optionally be scoped to specific **features** (e.g. only `llm/chat`, or only `image/generation`). A request that hits a `deny` rule is rejected.

<Tip>
  Two common setups:

  * **Allow-list**: set the default to **deny**, then add **allow** rules for only the models you permit.
  * **Deny-list**: set the default to **allow**, then add **deny** rules for the models you want to block.
</Tip>

## Rate limits

The rate limit uses the format `N/period`, where `period` is `second`, `minute`, `hour`, or `day`:

```
10/second
100/minute
5000/hour
```

Leave the rate limit empty on a guardrail to inherit it from the next level up (role → organisation default).

## Budget cap

A guardrail can cap how much a **member** spends over a recurring period. In the **Create/Edit Guardrail** dialog, turn on **Member budget** ("Cap each member's spend across all their API keys"), then set a **Budget** amount (in USD) and a **Per** period:

| Period    | Window            |
| --------- | ----------------- |
| `daily`   | Resets each day   |
| `weekly`  | Resets each week  |
| `monthly` | Resets each month |

Both fields are set together — a budget needs a period, and a period needs an amount. Leave them empty to apply no spend cap.

How it behaves:

* **Per member, not shared.** The cap applies to each member the guardrail resolves to individually — it is not a shared pool across the team.
* **Soft cap.** The check happens before each request. A request already in flight can push spend past the cap; the *next* request is the one that gets blocked. The limit is a spending guardrail, not a hard cutoff mid-request.
* **Counts real usage only.** [Sandbox](/docs/v3/general/sandbox) calls and calls made with your own provider keys ([BYOK](/docs/v3/general/byok)) don't count toward the budget. Refunds credit it back.

<Note>
  The budget only applies when a guardrail is attached to a **role** or a **member**. A budget set on a guardrail that is attached to an **API token** is ignored — use a [token budget](/docs/v3/general/custom-api-keys) to cap a single key instead.
</Note>

## Assigning a guardrail

A guardrail does nothing until it's attached to something. You can assign it to:

* **A role**: from **Settings → Roles & Permissions**, so everyone with that role inherits the policy.
* **A member**: from **Settings → Members**, to apply it to one person.
* **An API token**: to constrain a single key (for example a shared or CI token).

When a request comes in, Eden AI resolves the policy **per field, most specific wins**:

```
token  →  member  →  role  →  organisation default
```

For **model rules** and **rate limit** independently, Eden AI uses the value from the most specific level that has it set, and inherits the rest. So a token can override the model rules while still inheriting its role's rate limit.

The **member budget** resolves differently: only the **member** and **role** levels are considered (token budgets are handled separately, on the token itself), and the budget amount and period are always taken together from the most specific level that sets them — they are never mixed across levels.

<Note>
  Guardrails can also be managed programmatically through the User Management API if you need to automate provisioning. See the [API Reference](https://www.edenai.co/docs) for the `guardrails` endpoints.
</Note>

## Related

* [Users & Organisation](/docs/v3/organization/users-organisation): roles, permissions, and members.
* [Custom API Keys](/docs/v3/general/custom-api-keys): per-token budgets, which cap a single key rather than a member.
* [Rate Limits](/docs/v3/overview/rate-limits): how default rate limiting works.
