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

# Python capture and privacy

> Control captured content, streams, structured values and credential references.

## Content policy

Use a closed destination policy when an Impact route must omit selected content categories:

```python theme={null}
runtime = impact.init(
    content={
        "input": False,
        "output": False,
        "tools": False,
        "retrieval": False,
        "media": False,
    },
)
```

The five optional Boolean fields default to `True`. Omitting `content` keeps the defaults. `tools` controls
tool arguments and results, `retrieval` includes memory content, `input` includes instructions, and `media`
controls observed image/audio/video/file bytes. Configuration is validated and snapshotted before activation.
Impact applies it to detached Impact span and log copies before serialization, size accounting and queueing,
while customer records and independently configured destinations remain unchanged. Log instrumentation-scope
and resource content receive their own projection. Unrelated customer log bodies keep their own classification
even when resource metadata contains a GenAI marker. An acquisition marker such as
`partial.serialization-loss` describes the value available at the capture owner. If the destination suppresses
a captured or partial tool argument or result, its outgoing direction marker reports `omitted.policy`, or
`omitted.signal` when a signal setting closed it. Unavailable native content can still carry its original
reason. Check the outgoing value and its marker together to determine what reached Impact. For an ordinary
input, closing the input policy removes its value and MIME type. The outgoing delivery marker is
`omitted.policy`, and the original capture marker can still say `partial.serialization-loss`. A tool whose
result is incomplete cannot count as a complete return. Restricted records carry the normalized
`impact.content.policy` and a reason in `impact.content.<category>`. A projection failure drops the affected
Impact record and increments its signal's `content_dropped` count.

`tools=False` closes tool arguments and results on tool carriers. If the app returns the same value as its own
request output, that copy follows the output policy. Restrict output too if it can carry data you want
omitted.

`OTEL_INSTRUMENTATION_GENAI_CAPTURE_CONTENT` selects `NO_CONTENT`, `SPAN_ONLY`, `EVENT_ONLY`, or
`SPAN_AND_EVENT` (case insensitive). Impact snapshots it before activation and applies it to semantic GenAI
records from every capture owner on its own destination. The same setting closes input/output on Impact-owned
manual AI operations (`impact.span` and `impact.operation`). Unrelated customer telemetry keeps its own
content policy. Span attributes and span events use their respective signal modes. Metadata, identifiers and
usage remain. Invalid or empty explicit values use `NO_CONTENT`. An unset value preserves Impact's
unrestricted capture default. Customer providers and destinations keep their original records.

Legacy `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` remains owner specific: the GenAI owners use the
enum above and Botocore uses `true`/`false`. Explicit restrictions from either variable compose
conservatively. The new variable cannot reopen content closed by the legacy owner setting or by Impact's
`content` configuration. Impact never rewrites these settings. An invalid legacy value disables affected owned
acquisition. Impact drops an affected externally produced record when its explicit legacy control cannot be
interpreted.

The current standard signal setting excludes tool schemas/descriptions. Impact's stricter `input=False` still
closes those definitions. Normal content uses structured OTLP AnyValue on the current OTel SDK. Older or
custom providers keep the historical JSON representation and original schema identity. Binary media stays
binary. A value outside OTLP's signed 64-bit integer range is omitted from the standard structure with
`partial.serialization-loss`. Its bounded original JSON is retained in `impact.native.gen_ai.*` and obeys the
same privacy projection.

## Streaming and semantic output

Capture observes semantic stream output only as the native owner and caller expose it. It does not read ahead,
call a model again, close an application stream during SDK shutdown or turn partial consumption into a
completed response. Completion, caller stop, provider error, cancellation and SDK shutdown remain distinct.
Terminal identity and usage are known only when the native path exposes them. Dropping an unclosed stream
cannot promise terminal output or usage.

The Google Interactions supplement assembles consumed text, function calls and function results. Its buffer
admits up to 1 MiB of JSON-encoded semantic values and 2,048 segments, snapshots structured values before
yielding them, and marks overflow as `impact.google.stream.projection=partial.local-limit`. Terminal identity,
usage and outcome remain observable after that content limit. EOF without a terminal event and interrupted
consumption retain an explicitly partial or unavailable result.

Selected Product content includes semantic input, output, system instructions, tool definitions, model,
response identity, finish reason and usage. It does not promise a raw provider request or response envelope,
unknown vendor extensions, or replay of every consumed chunk. Unknown fields that an upstream owner or
explicit application capture does emit remain intact through the telemetry pipeline. Focused integrations may
retain additional bounded evidence as described in the [integration catalogue](https://docs.impact.ai/sdk/python/integrations.md).
Overflow and serialization loss carry markers.

The selected OpenAI instrumentation `1.3b0` owns `Responses.parse`. Impact retains focused semantic history
and partial-response supplements. Ordinary messages still use the upstream semantic projection.

For Responses streams that stop before a terminal response, Impact retains bounded text deltas actually
consumed and the identity observed in `response.created`. Missing terminal usage remains unknown. Retention is
bounded by encoded content size, fragment count and part count. Omitted content carries an explicit limit
marker. The compatibility owner avoids an extra async iterator around the selected native streams and leaves
provider-owned iterator cleanup with OpenAI after native response cleanup. It preserves native errors and
cancellation without reading ahead. Stream-manager cleanup stays with OpenAI, including decoder and HTTP
client cleanup.

## Pydantic values

Explicit capture preserves ordinary stored Pydantic model fields after a bounded inspection of the model's
resolved CoreSchema. Declared field exclusions and resolved serialization aliases are honored. Models with
custom or computed fields, conditional exclusion, extra fields, or an unsupported field shape leave out the
affected fields without calling application hooks. Their safe siblings remain with
`partial.serialization-loss`. A custom model serializer or unsupported model shape records
`omitted.serialization-failure` instead of exposing a raw backing-field representation.

## Provider schemas and credential references

Google records function parameter schemas in `gen_ai.tool.definitions` and a requested response schema in
`impact.google.response.schema`. `impact.google.response.schema_source` preserves which supported config
spelling supplied it. OpenAI records a requested output schema in `impact.openai.response.schema`, with source
`text.format.schema`, `response_format.json_schema.schema`, `text_format` or `response_format`. Anthropic uses
`impact.anthropic.response.schema` for a plain `output_config.format.schema` dictionary. Typed `output_format`
retains native parsing and a source marker, with `unavailable.native-schema` rather than an inferred schema.
When available, `impact.capture.<provider>.response.schema` records capture or a known
serialization/attribute-limit omission. A failed pre-call snapshot or a limit too small for the marker can
leave both the schema and marker unavailable. Provider transport configuration, HTTP clients and known OpenAI,
Anthropic and Google MCP credential paths are excluded from copied evidence. Impact omits signed or
authenticated URLs in recognized media, native resource and tool/server reference fields on outgoing copies,
including structured values and known native JSON mirrors, even under full capture.
`impact.content.credential_references=omitted.unsafe-reference` marks a reference or unverifiable native JSON
envelope omitted by this filter. Ordinary reference URLs are retained subject to the integration's reference
rules. Free-form prompt text and arbitrary application fields keep their configured content policy. Native
request and response objects and customer-owned telemetry keep their original values.


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