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

# How to add a customized Topic policy

> Create a Topic Guard Policy that classifies and blocks unsafe content, then apply it.

A **Topic policy** classifies content against topics and blocks unsafe matches. This recipe creates one and verifies a real `BLOCK`.

## 1. Create & assign

Open your Guardian → **Policies** → **Add** → **Create & Assign Policy**. Name it (e.g. `Topic Policy`) and set **Policy Type = Topic**.

<Frame caption="Create a Topic policy">
  <img src="https://mintcdn.com/aimintelligence/A1_c5EL9JAZ7xlFg/images/v1.2/admin/topic-create-assign.png?fit=max&auto=format&n=A1_c5EL9JAZ7xlFg&q=85&s=c5aefd5c98e839c5aed8027f56118309" alt="Create a Topic policy" width="1200" height="626" data-path="images/v1.2/admin/topic-create-assign.png" />
</Frame>

## 2. Define topics

A Topic policy is a list of topics. Each topic defines how to classify content:

```json theme={null}
[
  {
    "id": "WPN",
    "title": "Weapons",
    "description": "Requests about manufacturing weapons or explosives.",
    "safe": { "description": "General, factual, news-level mentions." },
    "unsafe": { "description": "Step-by-step instructions to make/modify weapons or explosives." },
    "controversial": { "description": "Borderline cases." }
  }
]
```

A match returns a **`classification`** (`safe` / `unsafe` / `controversial`); **unsafe** content is blocked. Edit topics via the form or the **JSON** view, then **Save** (creates a new version).

## 3. Apply the new version

Saving created a new version but **doesn't apply it** — re-point (pin) the Guardian to the new version, or live behavior won't change. See [Version & apply a policy update](/en/v1.2/admin/how-to/version-and-apply-policy).

<Frame caption="Re-point the Guardian to the new version">
  <img src="https://mintcdn.com/aimintelligence/A1_c5EL9JAZ7xlFg/images/v1.2/admin/edit-policy-version.png?fit=max&auto=format&n=A1_c5EL9JAZ7xlFg&q=85&s=577dd17c719589c02fbf83ef8c3c66d5" alt="Re-point the Guardian to the new version" width="1200" height="626" data-path="images/v1.2/admin/edit-policy-version.png" />
</Frame>

## 4. Verify

Send a prompt that should hit an unsafe topic and confirm `"action":"BLOCK"`:

```json theme={null}
{
  "action": "BLOCK",
  "input_results": [{ "action": "BLOCK", "results": [{
    "policy_name": "Topic Policy", "policy_type": "TOPIC", "action": "BLOCK",
    "detected_items": [{ "rule_id": "WPN", "rule_name": "Weapons", "classification": "unsafe" }]
  }]}]
}
```

<Frame caption="The BLOCK trace in Opticon">
  <img src="https://mintcdn.com/aimintelligence/A1_c5EL9JAZ7xlFg/images/v1.2/admin/opticon-tracing-list.png?fit=max&auto=format&n=A1_c5EL9JAZ7xlFg&q=85&s=ca3b5350feea43406e2aab333f261552" alt="The BLOCK trace in Opticon" width="1200" height="626" data-path="images/v1.2/admin/opticon-tracing-list.png" />
</Frame>

<Tip>
  Starfort ships a **default Topic policy** covering weapons, illegal activity, jailbreak/test-mode, self-harm, system-prompt exposure, and more — a good baseline to load via JSON and adjust.
</Tip>
