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

# Span Types

> Canonical SpanType enum and semantics shared across all SDKs.

The `SpanType` enum is identical across every Bitfab SDK. It is a string literal union; passing any other value is an error.

<Note>
  The span type is a **label only**. It is used to organize, filter, and display spans in the dashboard. It does **not** change how a span is traced, replayed, mocked, or evaluated. Two spans with identical code behave identically regardless of their type; picking `"llm"` versus `"function"` versus `"custom"` never alters runtime behavior.
</Note>

## Values

| Value         | Semantic                                                                   |
| ------------- | -------------------------------------------------------------------------- |
| `"llm"`       | A direct LLM API call. Prompt and model metadata are expected              |
| `"agent"`     | An autonomous orchestrator that makes decisions and dispatches other spans |
| `"function"`  | A deterministic tool or function call                                      |
| `"guardrail"` | A safety, validation, or policy check                                      |
| `"handoff"`   | An agent-to-agent transfer or human handoff                                |
| `"custom"`    | Default when unspecified. Application-specific tracing                     |

## Default

When omitted, every SDK defaults to `"custom"`.

## Per-SDK Representation

| SDK        | Type                                                                                                             |
| ---------- | ---------------------------------------------------------------------------------------------------------------- |
| TypeScript | `export type SpanType = "llm" \| "agent" \| "function" \| "guardrail" \| "handoff" \| "custom"`                  |
| Python     | `SpanType = Literal["llm", "agent", "function", "guardrail", "handoff", "custom"]`                               |
| Ruby       | `Bitfab::Client::SPAN_TYPES = %w[llm agent function guardrail handoff custom]` - passed as a `String` to `type:` |
| Go         | `string` passed to `WithType(spanType string) SpanOption`. No compile-time enum                                  |

## Invalid Values

* TypeScript: caught at compile time by the type system
* Python: not runtime-validated; the value is forwarded to the backend as-is
* Ruby: not runtime-validated; the value is forwarded to the backend as-is
* Go: not validated; the string is forwarded to the backend as-is

Unknown values sent to the backend are rejected by the trace ingestion endpoint.
