> For the complete documentation index, see [llms.txt](https://docs.mozilla.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mozilla.ai/any-guardrail/api-reference/taxonomy.md).

# Taxonomy

The vocabulary behind guardrail metadata (see the [AnyGuardrail reference](/any-guardrail/api-reference/any_guardrail.md) for the `list_guardrails` / `group_by` query API and [Guardrails](/any-guardrail/api-reference/index.md) for the catalog grouped by primary category).

A machine-readable export of every guardrail's metadata is published at <https://raw.githubusercontent.com/mozilla-ai/any-guardrail/main/schemas/guardrail_metadata.json>.

## GuardrailCategory

What a guardrail is designed to detect (a guardrail may span several).

| Value              | Meaning                                                                        |
| ------------------ | ------------------------------------------------------------------------------ |
| `prompt_injection` | Prompt injection, jailbreak, and instruction-override attempts.                |
| `content_safety`   | Harmful content: violence, sexual, self-harm, dangerous, or criminal material. |
| `toxicity`         | Hate, harassment, and profanity.                                               |
| `pii`              | Personal / sensitive-data detection.                                           |
| `hallucination`    | Groundedness / RAG-faithfulness of a response against provided context.        |
| `off_topic`        | Topical relevance / answer relevance.                                          |
| `bias`             | Social bias / fairness.                                                        |
| `tool_use`         | Function-calling / agent-action validity.                                      |
| `general_judge`    | Open-ended rubric / quality scoring against bring-your-own criteria.           |

## GuardrailStage

Where in a request/response flow a guardrail runs.

A guardrail that screens both the prompt and the response has `stages == {INPUT, OUTPUT}` (there is no separate `EITHER` value). `RAG_CONTEXT` marks guardrails that additionally consume retrieved documents/context.

| Value         | Meaning                                                          |
| ------------- | ---------------------------------------------------------------- |
| `input`       | Screens the user prompt (pre-call).                              |
| `output`      | Screens the model response (post-call).                          |
| `rag_context` | Consumes retrieved documents/context (e.g. groundedness checks). |

## OutputShape

The decision form a guardrail produces (aligns with the populated `GuardrailOutput` fields).

| Value         | Meaning                                                   |
| ------------- | --------------------------------------------------------- |
| `binary`      | A single flagged / not-flagged verdict.                   |
| `multi_label` | Independent per-category scores/verdicts.                 |
| `categorical` | A taxonomy verdict (e.g. Llama Guard S-codes).            |
| `score`       | A scalar risk score.                                      |
| `rubric`      | A judge score against a rubric (e.g. 1-5 / 1-10).         |
| `span`        | Character-offset spans (e.g. hallucination or PII spans). |

## BackendType

How a guardrail executes.

| Value             | Meaning                                                                 |
| ----------------- | ----------------------------------------------------------------------- |
| `local_encoder`   | A local encoder classifier (HuggingFace or encoderfile).                |
| `local_decoder`   | A local decoder LLM (HuggingFace or llamafile).                         |
| `hosted_api`      | A hosted service requiring a key/endpoint.                              |
| `library_wrapped` | A third-party Python library invoked directly (its own optional extra). |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mozilla.ai/any-guardrail/api-reference/taxonomy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
