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

# Set Guardrails for Unknown MCPs and Skills

> Choose whether MCP servers and skills outside your Catalog are allowed and monitored, or blocked

## Overview

The [AI Guardrails](https://app.formal.ai/recipes/ai-guardrails) recipe sets the default handling for MCP servers and skills that aren't in your [Catalog](https://docs.formal.ai/docs/guides/ai-governance/catalog.md). Items in the Catalog follow their own access controls instead.

The recipe has two settings:

| Setting | Applies when |
| - | - |
| **Unknown MCPs** | An agent uses an MCP server that is not in the Catalog |
| **Unknown Skills** | An agent loads a skill that is not in the Catalog |

For each setting, choose:

* **Allow and Monitor:** Formal lets the traffic through and logs it. New items appear in [Shadow AI](https://docs.formal.ai/docs/guides/ai-governance/shadow-ai.md) for review.
* **Block:** Formal blocks the traffic. For unknown MCP servers, the agent receives a list of approved alternatives. For unknown skills, the user sees Formal's standard block message.

When you block unknown MCPs, you can also turn on **Allow managed connectors**. Claude connectors and ChatGPT apps reach MCP servers through Anthropic and OpenAI, so they never match the Catalog. Personal accounts use the same relays, so pair this with tenant restrictions.

Changing settings requires the **Policies** permission. You can also change one setting from [Shadow AI](https://docs.formal.ai/docs/guides/ai-governance/shadow-ai.md) with **Change Default**.

## Configure a Guardrail

**1. Open AI Guardrails**

Go to [Recipes](https://app.formal.ai/recipes) and open **AI Guardrails**.

**2. Choose what happens**

For unknown MCP servers and unknown skills, select **Allow and Monitor** or **Block**.

**3. Write the block message (optional)**

With **Block** selected, enter **Message shown to blocked users**. Formal stores it as the policy's `reason`, which appears in Logs. Users don't see this text yet: they get the alternatives list or Formal's standard block message.

**4. Save**

Click **Save Changes**.

**Verify:** Go to [Policies](https://app.formal.ai/policies). With **Block** selected, you see **Block unknown MCPs** or **Block unknown skills**.

## What Formal Creates

Each guardrail set to **Block** is a generated [policy](https://docs.formal.ai/docs/guides/policies/introduction.md). Selecting **Allow** removes it.

### Block Unknown MCPs

The policy blocks MCP tool calls to servers that have no Formal Resource:

```rego theme={"languages":{"custom":["/languages/cel.json","/languages/rego.json"]}}
package formal.v2

import future.keywords.if

request := {
  "action": "block",
  "type": "mcp_suggest_alternatives",
  "reason": "This MCP is not approved by your organization.",
} if {
  input.resource.technology == "mcp"
  input.resource.name == ""
  input.mcp.method == "tools/call"
}
```

The `mcp_suggest_alternatives` block tells the agent which approved MCP servers it can use instead. It also explains how to request the blocked server. See [Suggest approved MCP alternatives](https://docs.formal.ai/docs/guides/policies/enforcement.md#suggest-approved-mcp-alternatives).

Only the [Formal Endpoint](https://docs.formal.ai/docs/guides/client-apps/desktop-app.md) sees MCP servers that have no Formal Resource. This guardrail applies on devices that run the Endpoint with Transparent Mode.

### Block Unknown Skills

The policy blocks LLM requests that load a skill whose name is not in an approved list:

```rego theme={"languages":{"custom":["/languages/cel.json","/languages/rego.json"]}}
package formal.v2

import future.keywords.if
import future.keywords.in

unknown_skill := {
  "approvedSkills": ["code-review", "release-notes"],
  "blockMessage": "This skill is not approved by your organization.",
}

request := {
  "action": "block",
  "type": "block_with_formal_message",
  "reason": unknown_skill.blockMessage,
} if {
  input.resource.technology == "llm"
  some skill in input.llm.loaded_skills
  not skill.name in unknown_skill.approvedSkills
}
```

`approvedSkills` holds the names of the managed skills in your Catalog. Formal updates the list when someone with the **Policies** permission opens the Catalog, Shadow AI, or the AI Guardrails recipe.

Formal detects loaded skills in Claude Code traffic only, so this guardrail doesn't affect other agents. It names each loaded skill after the folder that holds its `SKILL.md`.

> [!WARNING]
>
> Change guardrails from the AI Guardrails recipe, not in the policy editor. Saving
> a guardrail rewrites its generated rules. See
> [Policy Tags](https://docs.formal.ai/docs/guides/policies/introduction.md#policy-tags) to recognize
> generated policies.

## Troubleshooting

> [accordion] An unknown MCP server isn't blocked
>
> **Cause:** The traffic doesn't pass through the Formal Endpoint, or the server has a Formal Resource. **Fix:** Confirm that a [network rule](https://docs.formal.ai/docs/guides/network-rules.md) intercepts `mcp` traffic on the device. Servers with a Formal Resource follow their Catalog access controls.

> [accordion] A managed skill is blocked
>
> **Cause:** The skill's access controls exclude the user. **Fix:** Open the skill in the Catalog and check **Access Controls**.

## Next Steps

> [card] [Shadow AI](https://docs.formal.ai/docs/guides/ai-governance/shadow-ai.md)
>
> Review items that people already use

> [card] [Access Requests](https://docs.formal.ai/docs/guides/ai-governance/access-requests.md)
>
> Approve employee requests for blocked MCP servers


## Related topics

- [What is Formal?](https://docs.formal.ai/docs/guides/getting-started/what-is-formal.md)
- [Policies](https://docs.formal.ai/docs/guides/policies/introduction.md)
- [Govern AI Usage](https://docs.formal.ai/docs/guides/use-cases/govern-ai-usage.md)
- [Review Shadow AI](https://docs.formal.ai/docs/guides/ai-governance/shadow-ai.md)
- [Catalog](https://docs.formal.ai/docs/guides/ai-governance/catalog.md)


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