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

# Capture and redaction

> Control what BotGauge exports from your agent. Choose metadata, text, or full capture, keep PII and credential masking on, and allow extra attribute keys.

Two settings control what leaves your app. **Capture** selects which content is exported: `metadata`, `text`, or `full`. **Redaction** decides whether detected PII and credentials are masked.

With `botgauge instrument`, set `BOTGAUGE_CAPTURE` and `BOTGAUGE_REDACTED`. With `tracing.init()`, pass `capture=` and `redacted=`.

```python app.py theme={null}
from botgauge import tracing

tracing.init(capture="text", redacted=True)  # these are the defaults
```

## What each combination exports

BotGauge ran all six combinations on a LangChain prompt that contained an email address and a card number.

| Capture | Redacted | Prompt and response text | Email and card number |
| - | - | - | - |
| `metadata` | `true` | Not exported. The LLM span keeps model name, token counts, finish reason, ids, and timing. | Not exported |
| `text` (default) | `true` (default) | Exported | Masked |
| `full` | `true` | Exported, plus images and audio | Masked |
| `metadata` | `false` | Exported | Exported unmasked |
| `text` | `false` | Exported | Exported unmasked |
| `full` | `false` | Exported | Exported unmasked |

> [!WARNING]
>
> `redacted=false` overrides the capture setting. Every capture mode then exports the original content, so `metadata` with `false` is not a metadata-only setting. If you want metadata only, keep redaction on.

## Choosing a mode

The default is `text`, which exports prompts, responses, and tool data, but no images, audio, or embedding vectors. That matches how most tracing platforms treat media. Choose `full` to export images and audio inline. For a text-only agent, `text` and `full` exported the same content in BotGauge's test.

Choose `metadata` when prompts can contain data you can't send off your infrastructure. You keep model names, token counts, finish reasons, and timing, which is enough to compute cost and latency.

An unrecognized `BOTGAUGE_CAPTURE` value falls back to `metadata` with a warning.

## Masking has limits

Masking catches common formats like email addresses and card numbers. It does not catch every possible sensitive value. Treat it as a safety net, and use `metadata` capture for data you must never export.

String values that BotGauge protects are capped at 4096 characters.

## Allow extra attribute keys

BotGauge filters span attributes by default. To keep additional keys, list them in `BOTGAUGE_CAPTURE_ALLOW_KEYS` as a comma-separated list. Globs are allowed, and the list is merged with the `capture_allow_keys=` argument.

```bash terminal theme={null}
export BOTGAUGE_CAPTURE_ALLOW_KEYS="app.tenant_tier,myco.*"
```

## Infrastructure spans

By default BotGauge filters infrastructure spans such as HTTP and database calls. Set `BOTGAUGE_TRACE_SCOPE=all` to export them in full.

Tune capture and redactionOpen [BotGauge](https://cloud.botgauge.com) to see how your spans appear, then adjust capture and redaction in your app.

[Try BotGauge →](https://cloud.botgauge.com)

## Spans sent without the SDK

Spans forwarded through a plain OTLP exporter or an OpenTelemetry Collector reach BotGauge exactly as your instrumentation produced them, and nothing is masked. Use the SDK when you need masking. See [Any OTLP exporter](https://www.botgauge.com/docs/integrations/otlp.md).


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