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

# Guardrails

> The boundaries that keep an agent from going too far

Instructions say what the agent should do; Guardrails say what it **must not** do. This is a control layer sitting outside the model, independent of whether the agent "remembers" its guidance: however long the Instructions run, the rules in Guardrails still apply.

## Two places to manage guardrails

| Where | How to get there | Scope |
| - | - | - |
| **Agent guardrails** | Open the agent, go to **Agent builder**, pick **Guardrails** on the left | This agent only |
| **Shared guardrails** | Console left menu, **Safety & Governance** group → **Guardrails** | Every agent the rule is attached to |

## Opening Guardrails from the Instructions screen

You can add a guardrail without leaving the Instructions screen. The **Configuration** panel on the right lists Model, Connections, Skills and **Guardrails**.

<Steps>
  <Step title="Open the Configuration panel">
    On the Instructions screen, the Configuration panel sits in the right column. Scroll to Guardrails to see the rules attached to this agent.
  </Step>

  <Step title="Click the + next to Guardrails">
    A menu offers two choices: **Add from workspace** to attach an approved shared policy, or **Create new** to write a rule for this agent alone.
  </Step>
</Steps>

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_agent_details.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=6ad106152a64032fe2bc1762e7ab4901" alt="Configuration panel in Instructions" width="1562" height="784" data-path="images/en_agent_details.jpg" />

<Note>
  If the workspace has no guardrails yet, **Add from workspace** shows an empty list. Create the shared rule under the workspace Guardrails section first.
</Note>

## Three kinds of boundary

The agent Guardrails screen shows three suggestion cards to help you decide what kind of rule to build.

| Kind | Use it to |
| - | - |
| **Limit sensitive content** | Keep the agent away from subjects you do not want it discussing: competitors, legal advice, politics |
| **Protect personal data** | Mask or block emails, phone numbers and other personal data before the agent replies |
| **Hold back risky actions** | Route calls to external tools through a human approver before they run |

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_gr_agent_empty.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=46c50bf336db94dacd3d3679163a200e" alt="Agent Guardrails screen" width="1562" height="784" data-path="images/en_gr_agent_empty.jpg" />

## The fields in a guardrail

| Field | Required | Limit | What it means |
| - | - | - | - |
| **Topic** | Yes | 100 chars | A short name for the restricted subject, for example "Legal advice" |
| **Description** | Yes | 800 chars | Why the agent must not go there. The model reads exactly this to recognise the situation |
| **Samples** | No | 2000 chars | Example questions that should trigger the rule, one per line |
| **Response** | Yes | - | How the agent answers when the rule fires |
| **Fixed reply text** | Yes, if you chose a fixed reply | 300 chars | The passage the agent sends word for word |
| **This rule applies to every agent** | No | - | Shared guardrails only: switch it on and every agent has to obey |

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_gr_form_filled.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=64f6fc8951748f02292cd5d6d147efad" alt="Add guardrail form, filled in" width="1562" height="784" data-path="images/en_gr_form_filled.jpg" />

### Two kinds of response

* **Agent writes its own reply**: the agent composes something that fits the context when the rule fires. Right when you want the wording to sound natural.
* **Reply with a fixed passage**: the agent returns exactly the text you wrote. Right when the answer has to be signed off by Legal or Communications.

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_gr_form_fixed_reply.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=f9d6490b4d19f4d2d31294064a1061f2" alt="Choosing a fixed reply" width="1562" height="784" data-path="images/en_gr_form_fixed_reply.jpg" />

## Managing an agent's guardrails

### Create a guardrail

<Steps>
  <Step title="Open the Guardrails section">
    Open the agent, go to **Agent builder** and pick **Guardrails** on the left. The + next to Guardrails in the Configuration panel on the Instructions screen works too.
  </Step>

  <Step title="Choose how to add it">
    Click **Create new** to write a rule for this agent, or **Add from workspace** to attach a shared policy.
  </Step>

  <Step title="Fill in the Add guardrail form">
    Enter the Topic, Description and Samples (one per line), then pick a Response type. The field table above explains each box.
  </Step>

  <Step title="Save the guardrail">
    Click **Save guardrail**. The rule appears in the list and is enabled straight away.
  </Step>
</Steps>

<Warning>
  A guardrail you just created lives only in the agent's draft. The agent has to be **published** before the rule takes effect on live channels.
</Warning>

### Viewing the list and the detail

Each guardrail shows as a row with its topic, a shortened description, the response type and a status switch. Choose **View details** from the ⋯ menu to read the whole thing without risking an accidental edit.

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_gr_detail.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=5e42aa9d547cc5740ccec2bb76c51653" alt="Guardrail details" width="1562" height="784" data-path="images/en_gr_detail.jpg" />

### Edit a guardrail

<Steps>
  <Step title="Open the ⋯ menu">
    Click the ⋯ button at the end of the row (or on the card) for the guardrail you want to change.
  </Step>

  <Step title="Choose Edit">
    The form reopens with everything you entered. You can also click **Edit** from inside the View details box.
  </Step>

  <Step title="Save">
    Click **Save guardrail** to overwrite the previous configuration.
  </Step>
</Steps>

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_gr_row_menu.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=5955e040710a99383f6c02c1087141da" alt="Guardrail row menu" width="1562" height="784" data-path="images/en_gr_row_menu.jpg" />

### Pause and resume

Flip the switch in the **Status** column, or choose **Pause** from the ⋯ menu. The rule stops applying immediately but keeps its configuration, and flipping the switch again brings it back.

### Delete a guardrail

Choose **Delete** from the ⋯ menu. The confirmation box repeats the rule you are about to remove - read it before you click **Delete**.

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_gr_delete_confirm.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=a235ff361dccacd69361527c555488db" alt="Confirm guardrail deletion" width="1562" height="784" data-path="images/en_gr_delete_confirm.jpg" />

<Warning>
  Deletion is permanent and cannot be undone. If you only want to stop the rule for a while, use Pause instead.
</Warning>

## Managing shared workspace guardrails

Anything that amounts to company policy belongs at workspace level, attached down to individual agents: edit it once and every agent changes together, rather than editing by hand in each place.

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_gr_ws_empty.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=5064ce897b5a0c8d8f55e3217d35c35b" alt="Shared guardrails with no rules yet" width="1562" height="784" data-path="images/en_gr_ws_empty.jpg" />

<Steps>
  <Step title="Open the workspace Guardrails section">
    In the Console left menu, under **Safety & Governance**, choose **Guardrails**.
  </Step>

  <Step title="Create a shared rule">
    Click **Create guardrail** (or **Add guardrail** once the list has rules in it) and fill in the same form as at agent level.
  </Step>

  <Step title="Decide whether it is mandatory">
    Tick **This rule applies to every agent** if it is a policy nobody may skip. Leave it clear and the rule only applies to agents that deliberately attach it.
  </Step>

  <Step title="Attach the rule to an agent">
    Open the agent, go to Guardrails and choose **Add from workspace**.
  </Step>
</Steps>

The shared guardrail list is a table with a search box and a count of active rules.

| Column | What it shows |
| - | - |
| **Guardrail** | The rule's topic and shortened description |
| **Response action** | Agent-written reply, or fixed passage |
| **Applies to all** | Whether the rule is mandatory for every agent |
| **Status** | The enable / pause switch |
| **Actions** | The ⋯ menu with View details, Edit, Pause and Delete |

<img src="https://mintcdn.com/fpt-62e894b4/OEIa1zuMs6GjYr6X/images/en_gr_ws_list.jpg?fit=max&auto=format&n=OEIa1zuMs6GjYr6X&q=85&s=66647873cf10e9dc658dfbf32acd2a46" alt="Shared guardrail list" width="1562" height="784" data-path="images/en_gr_ws_list.jpg" />

<Note>
  Editing or deleting a shared guardrail affects **every agent** that has it attached, not just the one you have open. When in doubt, pause it first and watch what happens.
</Note>

## Three ways to write guardrails that work

The same intention written differently gives very different results. These three formulas cover most rules.

### 1: Topic - boundary - way out

The **Description** box should answer three things: what the agent must not do, what is **still allowed**, and where the user should be sent. Miss the second and the agent starts blocking harmless questions; miss the third and the user is left stranded.

| | Description text |
| - | - |
| ❌ Weak | Do not talk about pricing. |
| ✅ Better | The agent does not quote prices, discounts or cost estimates for any plan. It may still describe the features and technical limits of each plan. When a customer asks about price, point them to the Sales team. |

### 2: Write by intent, not by keyword

Guardrails match the **meaning** of a question, not a string of characters. A description along the lines of "block the word X" falls over the moment someone asks indirectly or asks in English.

| | Description text |
| - | - |
| ❌ Weak | Block anything containing the word "competitor". |
| ✅ Better | The agent does not compare our products with other vendors or comment on their strengths and weaknesses, even when asked indirectly. |

Then pour a variety of phrasings into the **Samples** box, one per line:

* "Is vendor X any better?"
* "How does this compare with what we use today?"
* "If it were you, who would you pick?"
* "Why should we pick you over vendor X?"

### 3: Match the response type to the risk

| Risk level | Response type to use |
| - | - |
| Low - off-topic subjects, small talk | **Agent writes its own reply**, so the wording fits the context |
| High - legal, financial, medical, reputational crisis | **Fixed passage** signed off by Legal or Communications |

A fixed passage only gets 300 characters, so cover two things: the reason for declining, and the next step.

> I am not able to advise on legal matters. Please send your question to the Legal department inbox for direct support.

<Tip>
  Once written, paste the lines from your Samples box into the **Test** tab to check the rule catches them, then ask one ordinary question close to the subject to be sure it is not over-blocking.
</Tip>

## Things to keep in mind

* **Description matters more than topic**: the model recognises situations from the Description, so spell out the scope instead of leaving a vague phrase.
* **Use real examples**: take questions users have actually asked as Samples and the rule catches far more accurately.
* **One topic per rule**: bundling several topics into one rule makes it hard to pause or edit any part of it later.
* **Test before publishing**: use the **Test** or **Try it** tab to ask exactly the questions in Samples and watch how the agent reacts.
* **Guardrails do not replace Instructions**: they block what must not happen; how to do the job right still belongs in the Instructions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.