# Class LittleGhost::Support::ContentCapture

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Support/ContentCapture.html

ContentCapture lets an application opt selected diagnostic content into
telemetry after redaction and scrubbing. Capture stays off until an
application installs an enabled policy.

    policy = LittleGhost::Support::ContentCapture.new(
      enabled: true,
      max_bytes: 16_384,
      redactions: [ENV.fetch("API_TOKEN")]
    )
    LittleGhost::Instrumentation.capture_content(policy)

### Choose captured data

Enabling capture may place model input, output, tool definitions, and
exception details into telemetry. Redaction and a custom scrubber reduce
accidental disclosure but cannot recognize every sensitive value. Configure
one capture policy per process and apply exporter-side controls as well.

## Inheritance

`LittleGhost::Support::ContentCapture < Object`

## Class methods

<a id="method-c-disabled"></a>
### `.disabled`

```ruby
.disabled()
```

Creates a policy that never captures diagnostics.

<a id="method-c-new"></a>
### `.new`

```ruby
.new(enabled: false, max_bytes: nil, scrubber: nil, redactions: [])
```

Configures a policy. `max_bytes` is applied per captured attribute and
`scrubber` receives already redacted values.

## Instance methods

<a id="method-i-capture"></a>
### `#capture`

```ruby
#capture(values)
```

Produces scrubbed, JSON-encoded diagnostic attributes selected from `values`,
or an empty hash when disabled.
